aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamian Terentiev <infusiastic@gmail.com>2009-03-12 14:45:55 +0000
committerPratik Naik <pratiknaik@gmail.com>2009-03-12 14:45:55 +0000
commit8a17fd1a65ab8e2fa6b36d79603fde0e6ffd083f (patch)
tree4828d02adf1bf9ba57a6899a090688f8bd71beaf
parentdb26ace030f6704da6fc80bcc6cd00a2aee664ce (diff)
downloadrails-8a17fd1a65ab8e2fa6b36d79603fde0e6ffd083f.tar.gz
rails-8a17fd1a65ab8e2fa6b36d79603fde0e6ffd083f.tar.bz2
rails-8a17fd1a65ab8e2fa6b36d79603fde0e6ffd083f.zip
Fixed that template runner gem method to output :lib => false correctly [#1940 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
-rw-r--r--railties/lib/rails_generator/generators/applications/app/template_runner.rb2
-rw-r--r--railties/test/generators/rails_template_runner_test.rb5
2 files changed, 6 insertions, 1 deletions
diff --git a/railties/lib/rails_generator/generators/applications/app/template_runner.rb b/railties/lib/rails_generator/generators/applications/app/template_runner.rb
index 73ab57d4f0..3b49b1fa92 100644
--- a/railties/lib/rails_generator/generators/applications/app/template_runner.rb
+++ b/railties/lib/rails_generator/generators/applications/app/template_runner.rb
@@ -90,7 +90,7 @@ module Rails
gems_code = "config.gem '#{name}'"
if options.any?
- opts = options.inject([]) {|result, h| result << [":#{h[0]} => '#{h[1]}'"] }.sort.join(", ")
+ opts = options.inject([]) {|result, h| result << [":#{h[0]} => #{h[1].inspect.gsub('"',"'")}"] }.sort.join(", ")
gems_code << ", #{opts}"
end
diff --git a/railties/test/generators/rails_template_runner_test.rb b/railties/test/generators/rails_template_runner_test.rb
index 4e1937e0c6..2da6bd59b5 100644
--- a/railties/test/generators/rails_template_runner_test.rb
+++ b/railties/test/generators/rails_template_runner_test.rb
@@ -93,6 +93,11 @@ class RailsTemplateRunnerTest < GeneratorTestCase
assert_generated_file_with_data('config/environments/test.rb', "config.gem 'quietbacktrace'")
end
+ def test_gem_with_lib_option_set_to_false_should_put_gem_dependency_in_enviroment_correctly
+ run_template_method(:gem, 'mislav-will-paginate', :lib => false, :source => 'http://gems.github.com')
+ assert_rails_initializer_includes("config.gem 'mislav-will-paginate', :lib => false, :source => 'http://gems.github.com'")
+ end
+
def test_environment_should_include_data_in_environment_initializer_block
load_paths = 'config.load_paths += %w["#{RAILS_ROOT}/app/extras"]'
run_template_method(:environment, load_paths)