1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Fixed --dev flag for new bundler

This commit is contained in:
Mikel Lindsaar 2010-02-02 11:24:19 +11:00
parent d1eed079e1
commit 485f12fe4c
3 changed files with 5 additions and 5 deletions

View file

@ -181,7 +181,7 @@ module Rails::Generators
end
def bundle_if_dev_or_edge
run "gem bundle" if dev_or_edge?
run "bundle install" if dev_or_edge?
end
protected

View file

@ -7,7 +7,7 @@ gem "rails", "<%= Rails::VERSION::STRING %>"
## Bundle edge rails:
<%- if options.dev? -%>
directory "<%= Rails::Generators::RAILS_DEV_PATH %>", :glob => "{*/,}*.gemspec"
path "<%= Rails::Generators::RAILS_DEV_PATH %>", :glob => "{*/,}*.gemspec"
gem "rails", "<%= Rails::VERSION::STRING %>"
<%- else -%>
<%= "# " unless options.edge? %>gem "rails", :git => "git://github.com/rails/rails.git"

View file

@ -168,15 +168,15 @@ class AppGeneratorTest < Rails::Generators::TestCase
end
def test_dev_option
generator([destination_root], :dev => true).expects(:run).with("gem bundle")
generator([destination_root], :dev => true).expects(:run).with("bundle install")
silence(:stdout){ generator.invoke }
rails_path = File.expand_path('../../..', Rails.root)
dev_gem = %(directory #{rails_path.inspect}, :glob => "{*/,}*.gemspec")
dev_gem = %(path #{rails_path.inspect}, :glob => "{*/,}*.gemspec")
assert_file 'Gemfile', /^#{Regexp.escape(dev_gem)}$/
end
def test_edge_option
generator([destination_root], :edge => true).expects(:run).with("gem bundle")
generator([destination_root], :edge => true).expects(:run).with("bundle install")
silence(:stdout){ generator.invoke }
edge_gem = %(gem "rails", :git => "git://github.com/rails/rails.git")
assert_file 'Gemfile', /^#{Regexp.escape(edge_gem)}$/