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
50 51 52 53 54 55 56 57 |
# File 'lib/scatter/cli.rb', line 50 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
34 35 36 |
# File 'lib/scatter/cli.rb', line 34 def cap(*cmd) exec "cap", cmd end |
#config(*args) ⇒ Object
61 62 63 64 65 66 67 68 69 70 |
# File 'lib/scatter/cli.rb', line 61 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
28 29 30 |
# File 'lib/scatter/cli.rb', line 28 def deploy run end |
#exec(*cmd) ⇒ Object
39 40 41 |
# File 'lib/scatter/cli.rb', line 39 def exec(*cmd) run cmd.join ' ' end |