Method: Tap::Support::Gems.select_gems

Defined in:
lib/tap/support/gems.rb

.select_gems(latest = true) ⇒ Object

Selects gem specs for which the block returns true. If latest is specified, only the latest version of each gem will be passed to the block.



32
33
34
35
36
37
38
39
40
# File 'lib/tap/support/gems.rb', line 32

def select_gems(latest=true)
  index = latest ?
    Gem.source_index.latest_specs :
    Gem.source_index.gems.collect {|(name, spec)| spec }
  
  index.select do |spec|
    yield(spec)
  end.sort
end