Class: DoTime
- Inherits:
-
Object
- Object
- DoTime
- Includes:
- HighLine::SystemExtensions
- Defined in:
- lib/do_time.rb
Constant Summary collapse
- VERSION =
'0.1.0'
- ENTER_KEY =
RUBY_PLATFORM !~ /mswin32|mingw|cygwin|bccwin32|darwin/ ? "\n" : "\r"
- SPACE_KEY =
" "
- BASIC_ACTIONS =
[ ['p', 'Select a different project','Select from a list of the active projects belonging to owner'], ['l', 'Select a different list','Select a different todo list from those available in the current projects'], ['r', 'Refresh list','Restart session and refresh status of todos in current list'], ['q', 'Quit DoTime', 'Just exit this app'] ]
- ACTIVE_LIST_ACTIONS =
[ ['1-9/01-99', 'Start/Stop todo timer','Press the number of the todo to start/stop timing it. If more than 9 items in list use 01-09.'], ['c', 'Complete todo','Complete a running todo e.g. type c3 to complete todo no 3.'], [ENTER_KEY, 'Complete running todo','Completes the only running todo. Otherwise starts next available todo'], [SPACE_KEY, 'Stop running todo','Stop timing the only running todo. Otherwise starts next available todo'] ]
Instance Attribute Summary collapse
-
#bc_url ⇒ Object
Returns the value of attribute bc_url.
-
#current_list ⇒ Object
Returns the value of attribute current_list.
-
#current_owner ⇒ Object
Returns the value of attribute current_owner.
-
#current_project ⇒ Object
Returns the value of attribute current_project.
-
#login ⇒ Object
Returns the value of attribute login.
-
#password ⇒ Object
Returns the value of attribute password.
-
#running_todos ⇒ Object
writeonly
Sets the attribute running_todos.
-
#session ⇒ Object
Returns the value of attribute session.
-
#use_ssl ⇒ Object
Returns the value of attribute use_ssl.
-
#valid_lists ⇒ Object
Returns the value of attribute valid_lists.
Instance Method Summary collapse
-
#initialize(args) ⇒ DoTime
constructor
A new instance of DoTime.
-
#run ⇒ Object
Entry point to DoTime.
Constructor Details
#initialize(args) ⇒ DoTime
Returns a new instance of DoTime.
43 44 45 46 47 48 49 |
# File 'lib/do_time.rb', line 43 def initialize(args) @login, @password, @use_ssl, @bc_url = *args @bc_url ||= 'webtypes.projectpath.com' init_bc_session @valid_lists = [] @running_todos = {} end |
Instance Attribute Details
#bc_url ⇒ Object
Returns the value of attribute bc_url.
41 42 43 |
# File 'lib/do_time.rb', line 41 def bc_url @bc_url end |
#current_list ⇒ Object
Returns the value of attribute current_list.
41 42 43 |
# File 'lib/do_time.rb', line 41 def current_list @current_list end |
#current_owner ⇒ Object
Returns the value of attribute current_owner.
41 42 43 |
# File 'lib/do_time.rb', line 41 def current_owner @current_owner end |
#current_project ⇒ Object
Returns the value of attribute current_project.
41 42 43 |
# File 'lib/do_time.rb', line 41 def current_project @current_project end |
#login ⇒ Object
Returns the value of attribute login.
41 42 43 |
# File 'lib/do_time.rb', line 41 def login @login end |
#password ⇒ Object
Returns the value of attribute password.
41 42 43 |
# File 'lib/do_time.rb', line 41 def password @password end |
#running_todos=(value) ⇒ Object
Sets the attribute running_todos
41 42 43 |
# File 'lib/do_time.rb', line 41 def running_todos=(value) @running_todos = value end |
#session ⇒ Object
Returns the value of attribute session.
41 42 43 |
# File 'lib/do_time.rb', line 41 def session @session end |
#use_ssl ⇒ Object
Returns the value of attribute use_ssl.
41 42 43 |
# File 'lib/do_time.rb', line 41 def use_ssl @use_ssl end |
#valid_lists ⇒ Object
Returns the value of attribute valid_lists.
41 42 43 |
# File 'lib/do_time.rb', line 41 def valid_lists @valid_lists end |
Instance Method Details
#run ⇒ Object
Entry point to DoTime
52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/do_time.rb', line 52 def run clear_screen unless @current_project select_project end if !@current_list select_list end make_selections end |