Class: BundleHack::GemLocator

Inherits:
Object
  • Object
show all
Defined in:
lib/bundle_hack/gem_locator.rb

Instance Method Summary collapse

Constructor Details

#initialize(gemfile_path, gemfile_lock_path) ⇒ GemLocator

Returns a new instance of GemLocator.



5
6
7
8
# File 'lib/bundle_hack/gem_locator.rb', line 5

def initialize(gemfile_path, gemfile_lock_path)
  @gemfile_path = gemfile_path
  @gemfile_lock_path = gemfile_lock_path
end

Instance Method Details

#locate(gem_name) ⇒ Object



10
11
12
13
14
15
# File 'lib/bundle_hack/gem_locator.rb', line 10

def locate(gem_name)
  gem = gems.find { |spec| spec[:name] == gem_name }
  missing_gem_error(gem_name) if gem.nil?

  gem
end