Class: Daygram::CLI
- Inherits:
-
Thor
- Object
- Thor
- Daygram::CLI
- Includes:
- Thor::Actions, ThorPlus::Actions
- Defined in:
- lib/daygram/cli.rb
Overview
The Command Line Interface (CLI) for the gem.
Class Method Summary collapse
Instance Method Summary collapse
- #config ⇒ Object
- #help(task = nil) ⇒ Object
-
#initialize(args = [], options = {}, config = {}) ⇒ CLI
constructor
A new instance of CLI.
- #version ⇒ Object
Constructor Details
#initialize(args = [], options = {}, config = {}) ⇒ CLI
Returns a new instance of CLI.
65 66 67 |
# File 'lib/daygram/cli.rb', line 65 def initialize args = [], = {}, config = {} super args, , config end |
Class Method Details
.configuration ⇒ Object
61 62 63 |
# File 'lib/daygram/cli.rb', line 61 def self.configuration Runcom::Configuration.new file_name: Daygram::Identity.file_name end |
Instance Method Details
#config ⇒ Object
82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/daygram/cli.rb', line 82 def config path = self.class.configuration.computed_path unless File.exists? path FileUtils.touch(path) end if .edit? then `#{editor} #{path}` elsif .info? then say(path) else help(:config) end end |
#help(task = nil) ⇒ Object
103 104 105 |
# File 'lib/daygram/cli.rb', line 103 def help task = nil say and super end |
#version ⇒ Object
97 98 99 |
# File 'lib/daygram/cli.rb', line 97 def version say Identity.version_label end |