Skip to content

Commit

Permalink
Fixed --dev flag for new bundler
Browse files Browse the repository at this point in the history
  • Loading branch information
mikel committed Feb 2, 2010
1 parent d1eed07 commit 485f12f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion railties/lib/generators/rails/app/app_generator.rb
Expand Up @@ -181,7 +181,7 @@ def apply_rails_template
end

def bundle_if_dev_or_edge
run "gem bundle" if dev_or_edge?
run "bundle install" if dev_or_edge?
end

protected
Expand Down
2 changes: 1 addition & 1 deletion railties/lib/generators/rails/app/templates/Gemfile
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions railties/test/generators/app_generator_test.rb
Expand Up @@ -168,15 +168,15 @@ def test_file_is_added_for_backwards_compatibility
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)}$/
Expand Down

0 comments on commit 485f12f

Please sign in to comment.