Class: Domo::CLI

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = [], options = {}, config = {}) ⇒ CLI

Returns a new instance of CLI.



9
10
11
12
# File 'lib/domo/cli.rb', line 9

def initialize(args=[], options={}, config={})
  super(args, options, config)
  @domo = Domo::Core.new
end

Class Method Details

.help(shell) ⇒ Object



93
94
95
96
97
98
99
100
# File 'lib/domo/cli.rb', line 93

def self.help(shell, *)
  list = printable_tasks
  shell.say "Usage: domo [command] [options]"
  shell.say "Commands:"
  shell.print_table(list, :ident => 2, :truncate => true)
  shell.say
  class_options_help(shell)
end

Instance Method Details

#backup_config(target) ⇒ Object



74
75
76
# File 'lib/domo/cli.rb', line 74

def backup_config(target)
  @domo.backup_config(target, options[:dest])
end

#clone(src, dest, job_list) ⇒ Object



41
42
43
# File 'lib/domo/cli.rb', line 41

def clone(src, dest, job_list)
  @domo.clone(src, dest, job_list)
end

#create_jobs(target, config_dir) ⇒ Object



79
80
81
# File 'lib/domo/cli.rb', line 79

def create_jobs(target, config_dir)
  @domo.create_jobs(target, config_dir)
end

#delete(target, job_list) ⇒ Object



51
52
53
# File 'lib/domo/cli.rb', line 51

def delete(target, job_list)
  @domo.delete(target, job_list, options[:dryrun])
end

#delete_all(target) ⇒ Object



60
61
62
# File 'lib/domo/cli.rb', line 60

def delete_all(target)
  @domo.delete_all(target, options[:dryrun])
end

#help(*args) ⇒ Object



89
90
91
# File 'lib/domo/cli.rb', line 89

def help(*args)
  super(*args)
end

#install(target, plugin_list) ⇒ Object



65
66
67
# File 'lib/domo/cli.rb', line 65

def install(target, plugin_list)
  @domo.install(target, plugin_list)
end

#list(target) ⇒ Object



17
18
19
# File 'lib/domo/cli.rb', line 17

def list(target)
  @domo.list(target, true)
end

#toggle(target, action, job_list) ⇒ Object



36
37
38
# File 'lib/domo/cli.rb', line 36

def toggle(target, action, job_list)
  @domo.toggle(target, action, job_list)
end

#toggle_all(target, action) ⇒ Object



31
32
33
# File 'lib/domo/cli.rb', line 31

def toggle_all(target, action)
  @domo.toggle_all(target, action)
end

#trigger(target, job_list) ⇒ Object



26
27
28
# File 'lib/domo/cli.rb', line 26

def trigger(target, job_list)
  @domo.trigger(target, job_list, options[:dryrun])
end

#versionObject



84
85
86
# File 'lib/domo/cli.rb', line 84

def version
  puts Domo::Version.to_s
end