Class: Stickler::Client::List

Inherits:
Stickler::Client show all
Defined in:
lib/stickler/client/list.rb

Instance Attribute Summary

Attributes inherited from Stickler::Client

#argv, #sources

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Stickler::Client

config, #initialize, #parse, #parser, #remote_repo_for

Constructor Details

This class inherits a constructor from Stickler::Client

Class Method Details



4
5
6
7
8
9
10
11
12
# File 'lib/stickler/client/list.rb', line 4

def self.banner
<<-_
List the gems in the stickler server with repository information.

Usage: stickler list

  Options:
_
end

Instance Method Details

#runObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/stickler/client/list.rb', line 14

def run
  opts = parse( self.argv )
  repo = remote_repo_for( opts )
  gems = Hash.new { |h,k| h[k] = Array.new }

  repo.specs_list.each do |name, version, platform|
    spec = Stickler::SpecLite.new( name, version, platform )
    gems[name] << spec
  end

  gems.keys.sort.each do |name|
    puts "#{name} (#{gems[name].collect { |s| s.version_platform }.join( ", " )})"
  end
end