Module: TasksCLI
- Defined in:
- lib/tasks_cli.rb,
lib/tasks_cli/cli.rb,
lib/tasks_cli/task.rb,
lib/tasks_cli/version.rb,
lib/tasks_cli/task_manager.rb
Defined Under Namespace
Classes: CLI, Error, Task, TaskManager
Constant Summary collapse
- VERSION =
'0.1.3'
Class Attribute Summary collapse
-
.config ⇒ Object
Returns the value of attribute config.
Class Method Summary collapse
- .configure {|config| ... } ⇒ Object
-
.format_date(date) ⇒ Object
Utility methods.
-
.logger ⇒ Object
Logging.
- .parse_date(date_string) ⇒ Object
-
.version ⇒ Object
Version information.
Class Attribute Details
.config ⇒ Object
Returns the value of attribute config.
19 20 21 |
# File 'lib/tasks_cli.rb', line 19 def config @config end |
Class Method Details
.configure {|config| ... } ⇒ Object
21 22 23 |
# File 'lib/tasks_cli.rb', line 21 def configure yield(config) if block_given? end |
.format_date(date) ⇒ Object
Utility methods
27 28 29 |
# File 'lib/tasks_cli.rb', line 27 def self.format_date(date) date.strftime(config[:date_format]) end |
.logger ⇒ Object
Logging
41 42 43 44 45 |
# File 'lib/tasks_cli.rb', line 41 def self.logger @logger ||= Logger.new($stdout).tap do |log| log.progname = 'TasksCLI' end end |
.parse_date(date_string) ⇒ Object
31 32 33 |
# File 'lib/tasks_cli.rb', line 31 def self.parse_date(date_string) DateTime.strptime(date_string, config[:date_format]) end |
.version ⇒ Object
Version information
36 37 38 |
# File 'lib/tasks_cli.rb', line 36 def self.version VERSION end |