From 8e3e5248ba0d2fbae7aba15129b635ee6c2587c6 Mon Sep 17 00:00:00 2001 From: danielsdeleo Date: Fri, 29 May 2015 08:43:26 -0700 Subject: 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 --- chef-config/Rakefile | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'chef-config') diff --git a/chef-config/Rakefile b/chef-config/Rakefile index 6eb195f672..10b6010de3 100644 --- a/chef-config/Rakefile +++ b/chef-config/Rakefile @@ -8,9 +8,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-config gem" task :install => [:package] do - sh %{gem install pkg/chef-config-#{ChefConfig::VERSION}.gem --no-rdoc --no-ri} + with_clean_env do + sh(%{gem install pkg/chef-config-#{ChefConfig::VERSION}.gem --no-rdoc --no-ri}, verbose: true) + end end task :default => :spec -- cgit v1.2.1