Class: OTask
- Inherits:
-
Object
- Object
- OTask
- Defined in:
- lib/otask.rb,
lib/version.rb
Constant Summary collapse
- VERSION =
'0.2.4'
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(arguments, stdin) ⇒ OTask
constructor
A new instance of OTask.
-
#run ⇒ Object
Parse options, check arguments, then process the command.
Constructor Details
#initialize(arguments, stdin) ⇒ OTask
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/otask.rb', line 14 def initialize(arguments, stdin) @arguments = arguments @stdin = stdin # Set defaults = OpenStruct.new .verbose = false .quiet = false .list = false .completion = false of = app('OmniFocus') @dd = of.default_document # TO DO - add additional defaults end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
12 13 14 |
# File 'lib/otask.rb', line 12 def end |
Instance Method Details
#run ⇒ Object
Parse options, check arguments, then process the command
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/otask.rb', line 31 def run if usage_and_exit unless arguments_valid? end if && arguments_valid? if .verbose puts "Start at #{DateTime.now}\n\n" puts "--Options--------------------" if .verbose # [Optional] puts "--Task-Properties------------" end process_arguments process_command puts "\nFinished at #{DateTime.now}" if .verbose else usage_and_exit end end |