diff options
author | danielsdeleo <dan@getchef.com> | 2015-05-29 08:43:26 -0700 |
---|---|---|
committer | danielsdeleo <dan@getchef.com> | 2015-05-29 10:00:43 -0700 |
commit | 8e3e5248ba0d2fbae7aba15129b635ee6c2587c6 (patch) | |
tree | ecbfa51ff3107d615180a697197507813e8ebc6d /Rakefile | |
parent | c58162b9ce165bde444ff396a95668666884c052 (diff) | |
download | chef-8e3e5248ba0d2fbae7aba15129b635ee6c2587c6.tar.gz |
Run `gem install` tasks w/o bundler's env
When bundler 1.10 is installed, running these tasks w/ bundler causes
`gem install` to fail with no output
Diffstat (limited to 'Rakefile')
-rw-r--r-- | Rakefile | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -108,9 +108,19 @@ Dir[File.expand_path("../*gemspec", __FILE__)].reverse.each do |gemspec_path| Gem::PackageTask.new(gemspec).define end +def with_clean_env(&block) + if defined?(Bundler) + Bundler.with_clean_env(&block) + else + block.call + end +end + desc "Build and install a chef gem" task :install => [:package] do - sh %{gem install pkg/#{GEM_NAME}-#{VERSION}.gem --no-rdoc --no-ri} + with_clean_env do + sh %{gem install pkg/#{GEM_NAME}-#{VERSION}.gem --no-rdoc --no-ri} + end end task :uninstall do |