Class: Danger::GemsResolver
- Inherits:
-
Object
- Object
- Danger::GemsResolver
- Defined in:
- lib/danger/plugin_support/gems_resolver.rb
Instance Method Summary collapse
-
#call ⇒ Object
Returns an Array of paths (plugin lib file paths) and gems (of metadata).
-
#initialize(gem_names) ⇒ GemsResolver
constructor
A new instance of GemsResolver.
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
#call ⇒ Object
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 |