Permalink
Browse files

Fix generation of prototype files, it should work with --javascript p…

…rototype, not --prototype
  • Loading branch information...
1 parent 5d63a36 commit 779a60dee553bda9a5238ac658d68f5022cf9810 @drogus drogus committed Dec 15, 2010
View
2 railties/lib/rails/generators/rails/app/app_generator.rb
@@ -109,7 +109,7 @@ def javascripts
copy_file "public/javascripts/#{@options[:javascript]}.js"
copy_file "public/javascripts/#{@options[:javascript]}_ujs.js", "public/javascripts/rails.js"
- if options[:prototype]
+ if options[:javascript] == "prototype"
copy_file "public/javascripts/controls.js"
copy_file "public/javascripts/dragdrop.js"
copy_file "public/javascripts/effects.js"
View
2 railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb
@@ -101,7 +101,7 @@ def javascripts
copy_file "#{app_templates_dir}/public/javascripts/#{options[:javascript]}.js", "public/javascripts/#{options[:javascript]}.js"
copy_file "#{app_templates_dir}/public/javascripts/#{options[:javascript]}_ujs.js", "public/javascripts/rails.js"
- if options[:prototype]
+ if options[:javascript] == "prototype"
copy_file "#{app_templates_dir}/public/javascripts/controls.js", "public/javascripts/controls.js"
copy_file "#{app_templates_dir}/public/javascripts/dragdrop.js", "public/javascripts/dragdrop.js"
copy_file "#{app_templates_dir}/public/javascripts/effects.js", "public/javascripts/effects.js"
View
3 railties/test/generators/app_generator_test.rb
@@ -135,6 +135,9 @@ def test_prototype_and_test_unit_are_added_by_default
assert_file "public/javascripts/application.js"
assert_file "public/javascripts/prototype.js"
assert_file "public/javascripts/rails.js"
+ assert_file "public/javascripts/controls.js"
+ assert_file "public/javascripts/dragdrop.js"
+ assert_file "public/javascripts/dragdrop.js"
assert_file "test"
end

0 comments on commit 779a60d

Please sign in to comment.