Class: GemWatch::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/gem_watch/command.rb

Overview

Command implements a command to be executed based on options. It is directly used by the command line interface.

Instance Method Summary collapse

Constructor Details

#initializeCommand

Returns a new instance of Command.



13
14
15
# File 'lib/gem_watch/command.rb', line 13

def initialize
  @options = GemWatch::CommandOptions.new
end

Instance Method Details

#run(args = {}) ⇒ Object

Run the command based on default options and given args.



18
19
20
21
22
23
24
25
26
27
# File 'lib/gem_watch/command.rb', line 18

def run(args = {})
  parse_options args
  gw = GemWatch.new(:update => @options.check_update_on)
  gw.run_checks
  if gw.passed?
    say "Nothing to report."
  else
    say gw.results
  end
end