Sha256: 7f76a1b3d660ac2d4f8867ad4c79ecb16663e09abad8306a251768b2f4f4848d
Contents?: true
Size: 1.12 KB
Versions: 2
Compression:
Stored size: 1.12 KB
Contents
require 'mattock/command-task' module Mattock class BundleCommandTask < CommandTask class BundleEnvCleaner < CommandLine def initialize(original) @original = original end def run original_env = ENV.to_hash if defined? Bundler %w{ BUNDLER_EDITOR BUNDLE_APP_CONFIG BUNDLE_BIN_PATH BUNDLE_CONFIG BUNDLE_PATH BUNDLE_SPEC_RUN DEBUG DEBUG_RESOLVER EDITOR GEM_HOME GEM_PATH MANPAGER PAGER PATH RB_USER_INSTALL RUBYOPT VISUAL }.each do |bundler_varname| begin ENV[bundler_varname] = Bundler::ORIGINAL_ENV.fetch(bundler_varname) rescue KeyError ENV.delete(bundler_varname) end end end %w{ BUNDLE_GEMFILE } @original.run ensure ENV.replace(original_env) end end def decorated(command) BundleEnvCleaner.new(command) end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
mattock-0.3.3 | lib/mattock/bundle-command-task.rb |
mattock-0.3.2 | lib/mattock/bundle-command-task.rb |