Class: Pik::List
Instance Attribute Summary collapse
-
#remote ⇒ Object
readonly
Returns the value of attribute remote.
-
#verbose ⇒ Object
readonly
Returns the value of attribute verbose.
Attributes inherited from Command
#config, #debug, #options, #output, #version
Instance Method Summary collapse
Methods inherited from Command
#actual_gem_home, #add_sigint_handler, aka, choose_from, clean_gem_batch, #close, cmd_name, #cmd_name, #create, #current_gem_bin_path, #current_version?, #default_gem_home, #delete_old_pik_batches, description, #editors, #find_config_from_path, #get_gem_home, #get_version, hl, inherited, #initialize, it, names, #parse_options, #pik_version, #sh, summary
Constructor Details
This class inherits a constructor from Pik::Command
Instance Attribute Details
#remote ⇒ Object (readonly)
Returns the value of attribute remote.
8 9 10 |
# File 'lib/pik/commands/list_command.rb', line 8 def remote @remote end |
#verbose ⇒ Object (readonly)
Returns the value of attribute verbose.
8 9 10 |
# File 'lib/pik/commands/list_command.rb', line 8 def verbose @verbose end |
Instance Method Details
#execute ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/pik/commands/list_command.rb', line 10 def execute if remote remote_list else list end end |
#list ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/pik/commands/list_command.rb', line 22 def list current_path = Which::Ruby.find config.sort.each do |name, conf| name += ' *' if current_path == conf[:path] puts name if verbose conf.each{|k,v| puts " %s: %s" % [k, v]} puts end end end |
#remote_list ⇒ Object
18 19 20 |
# File 'lib/pik/commands/list_command.rb', line 18 def remote_list puts Implementations.list.to_yaml end |