This project is archived and is in readonly mode.
Bundler deprecated options in Gemfile with application template using method "gem"
Reported by Adrian Sanchez | May 5th, 2010 @ 06:59 AM
Deprecated gem options in application templates
Bunlder deprecated options
Update deprecated options in rails application template when method "gem" is called and options are:
- :env
- :only
- :lib
- :require_as
For example:
Given I have a rails application template "my_template.rb"
with:
gem 'cucumber', :env => :test, :version =>
'>=0.7.2'
gem 'cucumber-rails', :only => :test
When I create a rails app with:
rails my_app --template=my_template.rb
Then "my_app/Gemfile" file should contain:
gem "cucumber", ">=0.7.2", :group =>
:test
gem "cucumber-rails", :group => :test
And I should get a warning message something like:
DEPRECATION WARNING: :env option in gem is
deprecated, use :group instead.
DEPRECATION WARNING: :only option in gem is
deprecated, use :group instead.
Updated Test file (rails/railties/test/generators/actions_test.rb):
def test_gem_with_env_should_include_all_dependencies_in_gemfile
run_generator
assert_deprecated do
action :gem, 'rspec', :env => %w(development test)
end
assert_deprecated do
action :gem, 'rspec-rails', :only => %w(development test)
end
assert_file 'Gemfile', /gem "rspec", :group => \["development", "test"\]/
assert_file 'Gemfile', /gem "rspec-rails", :group => \["development", "test"\]/
end
def test_gem_with_options_should_include_all_options_in_gemfile
run_generator
assert_deprecated do
action :gem, 'mislav-will-paginate', :lib => 'will-paginate', :source => 'http://gems.github.com'
end
assert_deprecated do
action :gem, 'thoughtbot-factory_girl', :require_as => 'factory_girl', :source => 'http://gems.github.com'
end
assert_file 'Gemfile', /gem "mislav\-will\-paginate", :require => "will\-paginate"/
assert_file 'Gemfile', /source "http:\/\/gems\.github\.com"/
assert_file 'Gemfile', /gem "thoughtbot-factory_girl", :require => "factory_girl"/
end
Versions
rails (3.0.0.beta3)
railties (3.0.0.beta3)
bundler (0.9.25)
Thank you.
Comments and changes to this ticket
-
Adrian Sanchez May 5th, 2010 @ 07:12 AM
- Tag changed from bundler, gem, gem_dependency, rails3, railties, templates to bundler, gem, gem_dependency, patch, rails3, railties, templates
Patch for ticket #4534
Thank you.
-
Repository May 15th, 2010 @ 08:51 AM
- State changed from new to resolved
(from [bcf5fea5e5a22edd5c7b27c29a53de0a4bedbc27]) Bundler deprecated options in Gemfile with application template using method "gem" [#4534 state:resolved]
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/bcf5fea5e5a22edd5c7b27c29a53de...
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Referenced by
- 4534 Bundler deprecated options in Gemfile with application template using method "gem" Patch for ticket #4534
- 4534 Bundler deprecated options in Gemfile with application template using method "gem" (from [bcf5fea5e5a22edd5c7b27c29a53de0a4bedbc27]) Bundler...