Class: Gem::ArbitrarySearcher

Inherits:
GemPathSearcher
  • Object
show all
Defined in:
lib/generators/templates/application/common/merb_thor/common.rb

Instance Method Summary collapse

Constructor Details

#initialize(source_index) ⇒ ArbitrarySearcher

Returns a new instance of ArbitrarySearcher.



20
21
22
23
# File 'lib/generators/templates/application/common/merb_thor/common.rb', line 20

def initialize(source_index)
  @source_index = source_index
  super()
end

Instance Method Details

#init_gemspecsObject



25
26
27
28
29
# File 'lib/generators/templates/application/common/merb_thor/common.rb', line 25

def init_gemspecs
  @source_index.map { |_, spec| spec }.sort { |a,b|
    (a.name <=> b.name).nonzero? || (b.version <=> a.version)
  }
end