Module: Bundler

Defined in:
lib/bundler-unload.rb

Defined Under Namespace

Classes: RubygemsIntegration

Class Method Summary collapse

Class Method Details

.unload!(rubygems_specs) ⇒ Object



34
35
36
37
38
39
# File 'lib/bundler-unload.rb', line 34

def unload!(rubygems_specs)
  @load = nil
  @definition = nil
  ENV.replace(ORIGINAL_ENV)
  Bundler.rubygems.plain_specs = rubygems_specs
end

.with_bundle(&block) ⇒ Object



41
42
43
44
45
46
# File 'lib/bundler-unload.rb', line 41

def with_bundle(&block)
  rubygems_specs = Bundler.rubygems.plain_specs
  block.call(Bundler.load)
ensure
  unload!(rubygems_specs)
end