Class: Scatter::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/scatter/cli.rb

Instance Method Summary collapse

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 options.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

#deployObject



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

#versionObject



45
46
47
# File 'lib/scatter/cli.rb', line 45

def version
  say Scatter::VERSION
end