Permalink
Browse files

Merge pull request #22 from halostatue/bundle-aware-rakefile

The top-level Rakefile requires Bundler awareness.
  • Loading branch information...
2 parents d2ce170 + 62fa3d2 commit 3826d174f466118d9eecaaaac4dcb42d34e50187 @justinko justinko committed Mar 13, 2012
Showing with 10 additions and 1 deletion.
  1. +10 −1 Rakefile
View
@@ -2,6 +2,8 @@ require 'rake'
require 'fileutils'
require 'pathname'
+UsingBundler = !!ENV['BUNDLE_GEMFILE']
+
Projects = ['rspec-expectations', 'rspec-mocks', 'rspec-core', 'rspec', 'rspec-rails']
BaseRspecPath = Pathname.new(Dir.pwd)
ReposPath = BaseRspecPath.join('repos')
@@ -177,7 +179,14 @@ end
task :setup => ["git:clone", "bundle:install"]
task :default do
- run_command 'rake'
+ if UsingBundler
+ Bundler.with_clean_env do
+ ENV.delete 'BUNDLE_GEMFILE'
+ run_command 'bin/rake'
+ end
+ else
+ run_command 'rake'
+ end
end
namespace :doc do

0 comments on commit 3826d17

Please sign in to comment.