Class: Danger::GemsResolver

Inherits:
Object
  • Object
show all
Defined in:
lib/danger/plugin_support/gems_resolver.rb

Instance Method Summary collapse

Constructor Details

#initialize(gem_names) ⇒ GemsResolver

Returns a new instance of GemsResolver.



5
6
7
8
# File 'lib/danger/plugin_support/gems_resolver.rb', line 5

def initialize(gem_names)
  @gem_names = gem_names
  @dir = Dir.mktmpdir # We want it to persist until OS cleans it on reboot
end

Instance Method Details

#callObject

Returns an Array of paths (plugin lib file paths) and gems (of metadata)



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/danger/plugin_support/gems_resolver.rb', line 11

def call
  path_gems = []

  Bundler.with_clean_env do
    Dir.chdir(dir) do
      create_gemfile_from_gem_names
      `bundle install --path vendor/gems`
      path_gems = 
    end
  end

  return path_gems
end