Module: BundlerExt

Defined in:
lib/bundler_ext.rb,
lib/bundler_ext/output.rb,
lib/bundler_ext/gemfile.rb,
lib/bundler_ext/runtime.rb,
lib/bundler_ext/version.rb,
lib/bundler_ext/system.rb

Defined Under Namespace

Classes: Gemfile, Output, Runtime, System

Constant Summary collapse

VERSION =
'0.4.2'

Class Method Summary collapse

Class Method Details

.runtimeObject



7
8
9
# File 'lib/bundler_ext.rb', line 7

def self.runtime
  @runtime ||= BundlerExt::Runtime.new
end

.system_require(gemfile, *groups) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/bundler_ext.rb', line 11

def self.system_require(gemfile, *groups)
  runtime.setup_env

  Gemfile.parse(gemfile, *groups).each do |name, gem_dep|
    if System.activate?
      System.activate!(name)
    end

    runtime.system_require(gem_dep[:files])
  end
end

.system_setup(gemfile, *groups) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/bundler_ext.rb', line 23

def self.system_setup(gemfile, *groups)
  Gemfile.setup_env(gemfile)
  runtime.gemfile(Pathname.new(gemfile))
  runtime.setup_env
  runtime.clear
  Gemfile.parse(gemfile, *groups).each do |name, gem_dep|
    if System.activate?
      System.activate!(name)
    end

    runtime.add_spec(gem_dep[:dep].to_spec())
  end
end