Class: Cuby
- Inherits:
-
Object
- Object
- Cuby
- Defined in:
- lib/cuby.rb
Constant Summary collapse
- VERSION =
File.read(File.dirname(File.dirname(__FILE__)) + "/VERSION")
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(arguments, stdin) ⇒ Cuby
constructor
A new instance of Cuby.
-
#run ⇒ Object
Parse options, check arguments, then process the command.
Constructor Details
#initialize(arguments, stdin) ⇒ Cuby
Returns a new instance of Cuby.
23 24 25 26 27 28 29 |
# File 'lib/cuby.rb', line 23 def initialize(arguments, stdin) @arguments = arguments @stdin = stdin # Set defaults @options = OpenStruct.new end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
21 22 23 |
# File 'lib/cuby.rb', line 21 def @options end |
Instance Method Details
#run ⇒ Object
Parse options, check arguments, then process the command
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/cuby.rb', line 32 def run if && arguments_valid? puts "Start at #{DateTime.now}\n\n" if @options.verbose process_arguments process_command puts "\nFinished at #{DateTime.now}" if @options.verbose else output_usage end end |