Class: SublimeTextKit::CLI
- Inherits:
-
Thor
- Object
- Thor
- SublimeTextKit::CLI
- Includes:
- Thor::Actions, ThorPlus::Actions
- Defined in:
- lib/sublime_text_kit/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
Initialize.
- #metadata ⇒ Object
- #session ⇒ Object
- #update ⇒ Object
- #version ⇒ Object
Constructor Details
#initialize(args = [], options = {}, config = {}) ⇒ CLI
Initialize.
21 22 23 |
# File 'lib/sublime_text_kit/cli.rb', line 21 def initialize args = [], = {}, config = {} super args, , config end |
Class Method Details
Instance Method Details
#config ⇒ Object
73 74 75 76 77 78 79 80 81 |
# File 'lib/sublime_text_kit/cli.rb', line 73 def config path = self.class.configuration.path if .edit? then `#{editor} #{path}` elsif .info? path ? say(path) : say("Configuration doesn't exist.") else help(:config) end end |
#help(task = nil) ⇒ Object
91 92 93 |
# File 'lib/sublime_text_kit/cli.rb', line 91 def help task = nil say and super end |
#metadata ⇒ Object
51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/sublime_text_kit/cli.rb', line 51 def say if [:create] then elsif [:destroy] then elsif [:rebuild] then else help("--metadata") end say end |
#session ⇒ Object
40 41 42 43 44 |
# File 'lib/sublime_text_kit/cli.rb', line 40 def session say .rebuild? ? rebuild_session : help("--session") say end |
#update ⇒ Object
27 28 29 30 31 |
# File 'lib/sublime_text_kit/cli.rb', line 27 def update say rebuild_session end |
#version ⇒ Object
85 86 87 |
# File 'lib/sublime_text_kit/cli.rb', line 85 def version say Identity.version_label end |