Class: Scatter::CLI
- Inherits:
-
Thor
- Object
- Thor
- Scatter::CLI
- Defined in:
- lib/scatter/cli.rb
Instance Method Summary collapse
- #alias(from, *to) ⇒ Object
- #cap(*cmd) ⇒ Object
- #config(*args) ⇒ Object
- #deploy ⇒ Object
- #exec(*cmd) ⇒ Object
- #version ⇒ Object
Instance Method Details
#alias(from, *to) ⇒ Object
46 47 48 49 50 51 52 53 |
# File 'lib/scatter/cli.rb', line 46 def alias(from, *to) config = Config.get config['aliases'] ||= {} config['aliases'][from] = to.join ' ' Config.save config say Config.show 'aliases' end |
#cap(*cmd) ⇒ Object
30 31 32 |
# File 'lib/scatter/cli.rb', line 30 def cap(*cmd) exec "cap", cmd end |
#config(*args) ⇒ Object
57 58 59 60 61 62 63 64 65 66 |
# File 'lib/scatter/cli.rb', line 57 def config(*args) unless .show abort "Incorrect number of arguments" unless args.length == 2 setting = args.first value = args.last Config.set setting, value end say Config.show end |
#deploy ⇒ Object
24 25 26 |
# File 'lib/scatter/cli.rb', line 24 def deploy run end |
#exec(*cmd) ⇒ Object
35 36 37 |
# File 'lib/scatter/cli.rb', line 35 def exec(*cmd) run cmd.join ' ' end |
#version ⇒ Object
41 42 43 |
# File 'lib/scatter/cli.rb', line 41 def version say Scatter::VERSION end |