From e793b4fbfde92516f30a99e08ea9c1263e3e065a Mon Sep 17 00:00:00 2001 From: Aidan Feldman Date: Sat, 16 Oct 2010 01:48:48 -0500 Subject: [PATCH 1/2] upped default jQuery version to 1.4.3 --- README.md | 2 +- lib/generators/jquery/install/install_generator.rb | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index e67eb438..eb031766 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ In your Gemfile, add this line: Then, run `bundle install`. To invoke the generator, run: - rails generate jquery:install #--ui to enable jQuery UI --version to install specific version of JQuery (default is 1.4.2) + rails generate jquery:install #--ui to enable jQuery UI --version to install specific version of JQuery (default is 1.4.3) You're done! Don't forget to output `csrf_meta_tag` somewhere inside your `` tag in your layout! diff --git a/lib/generators/jquery/install/install_generator.rb b/lib/generators/jquery/install/install_generator.rb index 5f65e389..ff7e5cb8 100644 --- a/lib/generators/jquery/install/install_generator.rb +++ b/lib/generators/jquery/install/install_generator.rb @@ -3,8 +3,8 @@ module Generators class InstallGenerator < ::Rails::Generators::Base desc "This generator downloads and installs jQuery, jQuery-ujs HEAD, and (optionally) jQuery UI 1.8.4" class_option :ui, :type => :boolean, :default => false, :desc => "Whether to Include JQueryUI" - class_option :version, :type => :string, :default => "1.4.1", :desc => "Which version of JQuery to fetch" - @@versions = %w( 1.4.2 1.4.1 1.4.0 1.3.2 1.3.1 1.3.0 1.2.6 ) + class_option :version, :type => :string, :default => "1.4.3", :desc => "Which version of JQuery to fetch" + @@versions = %w( 1.4.3 1.4.2 1.4.1 1.4.0 1.3.2 1.3.1 1.3.0 1.2.6 ) def remove_prototype @@ -20,9 +20,9 @@ def download_jquery get "http://ajax.googleapis.com/ajax/libs/jquery/#{options.version}/jquery.min.js", "public/javascripts/jquery.min.js" get "http://ajax.googleapis.com/ajax/libs/jquery/#{options.version}/jquery.js", "public/javascripts/jquery.js" else - puts "JQuery #{options.version} is invalid; fetching #{@@versions[1]} instead." - get "http://ajax.googleapis.com/ajax/libs/jquery/#{@@versions[1]}/jquery.min.js", "public/javascripts/jquery.min.js" - get "http://ajax.googleapis.com/ajax/libs/jquery/#{@@versions[1]}/jquery.js", "public/javascripts/jquery.js" + puts "JQuery #{options.version} is invalid; fetching #{@@versions[0]} instead." + get "http://ajax.googleapis.com/ajax/libs/jquery/#{@@versions[0]}/jquery.min.js", "public/javascripts/jquery.min.js" + get "http://ajax.googleapis.com/ajax/libs/jquery/#{@@versions[0]}/jquery.js", "public/javascripts/jquery.js" end # Downloading latest jQueryUI minified From bae2663eb2bcb5ab3092adb4cda736af1653dd1c Mon Sep 17 00:00:00 2001 From: Aidan Feldman Date: Sat, 16 Oct 2010 01:52:52 -0500 Subject: [PATCH 2/2] on second thought, leave default version as 1.4.1 (but have 1.4.3 as an option) --- README.md | 2 +- lib/generators/jquery/install/install_generator.rb | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index eb031766..4d6c2e5d 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ In your Gemfile, add this line: Then, run `bundle install`. To invoke the generator, run: - rails generate jquery:install #--ui to enable jQuery UI --version to install specific version of JQuery (default is 1.4.3) + rails generate jquery:install #--ui to enable jQuery UI --version to install specific version of JQuery (default is 1.4.1) You're done! Don't forget to output `csrf_meta_tag` somewhere inside your `` tag in your layout! diff --git a/lib/generators/jquery/install/install_generator.rb b/lib/generators/jquery/install/install_generator.rb index ff7e5cb8..899fa2d8 100644 --- a/lib/generators/jquery/install/install_generator.rb +++ b/lib/generators/jquery/install/install_generator.rb @@ -3,7 +3,7 @@ module Generators class InstallGenerator < ::Rails::Generators::Base desc "This generator downloads and installs jQuery, jQuery-ujs HEAD, and (optionally) jQuery UI 1.8.4" class_option :ui, :type => :boolean, :default => false, :desc => "Whether to Include JQueryUI" - class_option :version, :type => :string, :default => "1.4.3", :desc => "Which version of JQuery to fetch" + class_option :version, :type => :string, :default => "1.4.1", :desc => "Which version of JQuery to fetch" @@versions = %w( 1.4.3 1.4.2 1.4.1 1.4.0 1.3.2 1.3.1 1.3.0 1.2.6 ) @@ -20,9 +20,9 @@ def download_jquery get "http://ajax.googleapis.com/ajax/libs/jquery/#{options.version}/jquery.min.js", "public/javascripts/jquery.min.js" get "http://ajax.googleapis.com/ajax/libs/jquery/#{options.version}/jquery.js", "public/javascripts/jquery.js" else - puts "JQuery #{options.version} is invalid; fetching #{@@versions[0]} instead." - get "http://ajax.googleapis.com/ajax/libs/jquery/#{@@versions[0]}/jquery.min.js", "public/javascripts/jquery.min.js" - get "http://ajax.googleapis.com/ajax/libs/jquery/#{@@versions[0]}/jquery.js", "public/javascripts/jquery.js" + puts "JQuery #{options.version} is invalid; fetching #{@@versions[2]} instead." + get "http://ajax.googleapis.com/ajax/libs/jquery/#{@@versions[2]}/jquery.min.js", "public/javascripts/jquery.min.js" + get "http://ajax.googleapis.com/ajax/libs/jquery/#{@@versions[2]}/jquery.js", "public/javascripts/jquery.js" end # Downloading latest jQueryUI minified