Class: GemWatch::Command
- Inherits:
-
Object
- Object
- GemWatch::Command
- 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
-
#initialize ⇒ Command
constructor
A new instance of Command.
-
#run(args = {}) ⇒ Object
Run the command based on default options and given
args.
Constructor Details
#initialize ⇒ Command
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 = {}) 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 |