Class: Sashimi::Commands::List

Inherits:
Object
  • Object
show all
Defined in:
lib/sashimi/commands.rb

Instance Method Summary collapse

Constructor Details

#initialize(base_command) ⇒ List

Returns a new instance of List.



169
170
171
# File 'lib/sashimi/commands.rb', line 169

def initialize(base_command)
  @base_command = base_command        
end

Instance Method Details

#optionsObject



173
174
175
176
177
178
179
# File 'lib/sashimi/commands.rb', line 173

def options
  OptionParser.new do |o|
    o.set_summary_indent('  ')
    o.banner =    "Usage: #{@base_command.script_name} list"
    o.define_head "List all installed plugins."
  end
end

#parse!(args) ⇒ Object



181
182
183
184
185
186
187
# File 'lib/sashimi/commands.rb', line 181

def parse!(args)
  options.parse!(args)
  output = Plugin.list.sort.collect do |plugin, contents|
    "#{plugin}\t\t#{contents['summary']}"
  end.join("\n")
  puts output
end