Class: GridCLI::PPrintCommand

Inherits:
BaseCommand show all
Defined in:
lib/gridcli/commands/pprint.rb

Instance Attribute Summary

Attributes inherited from BaseCommand

#cmd, #desc

Instance Method Summary collapse

Methods inherited from BaseCommand

#add_format_option, #add_option, #error, #log, #output_format, #parse_dates, #parse_opts, #pop_arg, #pprint, #usage

Constructor Details

#initializePPrintCommand

Returns a new instance of PPrintCommand.



3
4
5
6
# File 'lib/gridcli/commands/pprint.rb', line 3

def initialize
  super "pprint", "A program that will pretty print posts/users"
  add_format_option
end

Instance Method Details

#run(args) ⇒ Object



8
9
10
11
12
13
# File 'lib/gridcli/commands/pprint.rb', line 8

def run(args)
  parse_opts args

  ARGV.clear
  ARGF.each { |line| pprint(line) }
end