aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRamon Soares <eu@ramonsoares.com>2010-02-21 20:49:54 -0300
committerJosé Valim <jose.valim@gmail.com>2010-02-26 10:54:44 +0100
commit79c47abe6ce0bdcc81c35aa30da8a05c3650d04d (patch)
tree4fb1cfec957ceb38c1a93636ce7cafc1298cfd8f
parent36a234609da3955464adf529e2b9dfb3bc572427 (diff)
downloadrails-79c47abe6ce0bdcc81c35aa30da8a05c3650d04d.tar.gz
rails-79c47abe6ce0bdcc81c35aa30da8a05c3650d04d.tar.bz2
rails-79c47abe6ce0bdcc81c35aa30da8a05c3650d04d.zip
the folder public/javascripts should be created by default [#4027 status:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
-rw-r--r--railties/lib/generators/rails/app/app_generator.rb7
-rw-r--r--railties/test/generators/app_generator_test.rb1
2 files changed, 6 insertions, 2 deletions
diff --git a/railties/lib/generators/rails/app/app_generator.rb b/railties/lib/generators/rails/app/app_generator.rb
index ea1930a966..92e0d37436 100644
--- a/railties/lib/generators/rails/app/app_generator.rb
+++ b/railties/lib/generators/rails/app/app_generator.rb
@@ -138,8 +138,11 @@ module Rails::Generators
end
def create_prototype_files
- return if options[:skip_prototype]
- directory "public/javascripts"
+ unless options[:skip_prototype]
+ directory "public/javascripts"
+ else
+ empty_directory_with_gitkeep "public/javascripts"
+ end
end
def create_script_files
diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb
index 01d643cd8c..412034029e 100644
--- a/railties/test/generators/app_generator_test.rb
+++ b/railties/test/generators/app_generator_test.rb
@@ -107,6 +107,7 @@ class AppGeneratorTest < Rails::Generators::TestCase
def test_prototype_and_test_unit_are_skipped_if_required
run_generator [destination_root, "--skip-prototype", "--skip-testunit"]
assert_no_file "public/javascripts/prototype.js"
+ assert_file "public/javascripts"
assert_no_file "test"
end