Skip to content

Commit

Permalink
Support bundler
Browse files Browse the repository at this point in the history
  • Loading branch information
jferris committed Mar 23, 2010
1 parent 211003d commit f488c09
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
1 change: 1 addition & 0 deletions features/rails.feature
Expand Up @@ -20,6 +20,7 @@ Feature: Install the Gem in a Rails application
And I run the hoptoad generator with "-k myapikey"
Then the command should have run successfully
When I uninstall the "hoptoad_notifier" gem
And I install cached gems
And I run "rake hoptoad:test"
Then the command should have run successfully
And I should receive two Hoptoad notifications
Expand Down
11 changes: 10 additions & 1 deletion features/step_definitions/rails_application_steps.rb
Expand Up @@ -129,7 +129,10 @@
end

When /^I unpack the "([^\"]*)" gem$/ do |gem_name|
if rails_manages_gems?
if bundler_manages_gems?
@terminal.cd(RAILS_ROOT)
@terminal.run("bundle pack")
elsif rails_manages_gems?
@terminal.cd(RAILS_ROOT)
@terminal.run("rake gems:unpack GEM=#{gem_name}")
else
Expand All @@ -146,6 +149,12 @@
end
end

When /^I install cached gems$/ do
if bundler_manages_gems?
When %{I run "bundle install"}
end
end

When /^I install the "([^\"]*)" plugin$/ do |plugin_name|
FileUtils.mkdir_p("#{RAILS_ROOT}/vendor/plugins/#{plugin_name}")
end
Expand Down
8 changes: 7 additions & 1 deletion features/support/terminal.rb
Expand Up @@ -59,7 +59,13 @@ def install_gem_to(root, gem)
end

def environment_settings
"GEM_HOME=#{LOCAL_GEM_ROOT} GEM_PATH=#{LOCAL_GEM_ROOT}:#{BUILT_GEM_ROOT}"
["GEM_HOME=#{LOCAL_GEM_ROOT}",
"GEM_PATH=#{LOCAL_GEM_ROOT}:#{BUILT_GEM_ROOT}",
"PATH=#{gem_bin_path}:#{ENV['PATH']}"].join(' ')
end

def gem_bin_path
File.join(LOCAL_GEM_ROOT, "bin")
end

attr_reader :logger
Expand Down

0 comments on commit f488c09

Please sign in to comment.