Class: Bundler::Restrict::BundlerGems

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/bundler/restrict/bundler_gems.rb

Instance Method Summary collapse

Constructor Details

#initialize(bundler = Bundler.new) ⇒ BundlerGems

Returns a new instance of BundlerGems.



9
10
11
# File 'lib/bundler/restrict/bundler_gems.rb', line 9

def initialize(bundler=Bundler.new)
  @bundler = bundler
end

Instance Method Details

#eachObject



13
14
15
16
17
18
# File 'lib/bundler/restrict/bundler_gems.rb', line 13

def each
  @bundler.list.scan(/\*\s+([[:alnum:]-]+)\s+\(([\d\.]+)\)/).each do |match|
    yield Gem.new(match[0]).version(match[1])
  rescue Gems::NotFound
  end
end