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, #close, cmd_name, #cmd_name, #create, #current_gem_bin_path, #current_version?, #default_gem_home, #delete_old_pik_script, description, #editors, #find_config_from_path, #gem_path, #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 |
# File 'lib/pik/commands/list_command.rb', line 22 def list config.sort.each do |name, conf| puts layout(name, conf) puts conf.map{|k,v| " %s: %s" % [k, v]} + ["\n"] if verbose 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 |