Class: SublimeTextKit::CLI
- Inherits:
-
Thor
- Object
- Thor
- SublimeTextKit::CLI
- Includes:
- Thor::Actions, ThorPlus::Actions
- Defined in:
- lib/sublime_text_kit/cli.rb
Instance Method Summary collapse
- #edit ⇒ Object
- #help(task = nil) ⇒ Object
-
#initialize(args = [], options = {}, config = {}) ⇒ CLI
constructor
Initialize.
- #project ⇒ Object
- #session ⇒ Object
- #version ⇒ Object
Constructor Details
#initialize(args = [], options = {}, config = {}) ⇒ CLI
Initialize.
12 13 14 15 16 |
# File 'lib/sublime_text_kit/cli.rb', line 12 def initialize args = [], = {}, config = {} super args, , config @settings_file = File.join ENV.fetch("HOME"), ".sublime", "settings.yml" @settings = load_yaml @settings_file end |
Instance Method Details
#edit ⇒ Object
50 51 52 |
# File 'lib/sublime_text_kit/cli.rb', line 50 def edit `#{editor} #{@settings_file}` end |
#help(task = nil) ⇒ Object
62 63 64 |
# File 'lib/sublime_text_kit/cli.rb', line 62 def help task = nil say and super end |
#project ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/sublime_text_kit/cli.rb', line 22 def project say case when [:create] then when [:destroy] then else help("--project") end say end |
#session ⇒ Object
37 38 39 40 41 42 43 44 45 46 |
# File 'lib/sublime_text_kit/cli.rb', line 37 def session say case when [:rebuild_recent_workspaces] then rebuild_recent_workspaces else help("--session") end say end |
#version ⇒ Object
56 57 58 |
# File 'lib/sublime_text_kit/cli.rb', line 56 def version say "Sublime Text Kit " + VERSION end |