Class: Gzr::Commands::Plan

Inherits:
SubCommandBase show all
Defined in:
lib/gzr/commands/plan.rb,
lib/gzr/commands/plan/ls.rb,
lib/gzr/commands/plan/rm.rb,
lib/gzr/commands/plan/cat.rb,
lib/gzr/commands/plan/run.rb,
lib/gzr/commands/plan/enable.rb,
lib/gzr/commands/plan/import.rb,
lib/gzr/commands/plan/disable.rb,
lib/gzr/commands/plan/failures.rb,
lib/gzr/commands/plan/randomize.rb

Defined Under Namespace

Classes: Cat, Disable, Enable, Failures, Import, Ls, Randomize, Rm, RunIt

Instance Method Summary collapse

Methods inherited from SubCommandBase

banner, subcommand_prefix

Instance Method Details

#cat(plan_id) ⇒ Object



119
120
121
122
123
124
125
126
# File 'lib/gzr/commands/plan.rb', line 119

def cat(plan_id)
  if options[:help]
    invoke :help, ['cat']
  else
    require_relative 'plan/cat'
    Gzr::Commands::Plan::Cat.new(plan_id,options).execute
  end
end

#disable(plan_id) ⇒ Object



63
64
65
66
67
68
69
70
# File 'lib/gzr/commands/plan.rb', line 63

def disable(plan_id)
  if options[:help]
    invoke :help, ['disable']
  else
    require_relative 'plan/disable'
    Gzr::Commands::Plan::Disable.new(plan_id,options).execute
  end
end

#enable(plan_id) ⇒ Object



75
76
77
78
79
80
81
82
# File 'lib/gzr/commands/plan.rb', line 75

def enable(plan_id)
  if options[:help]
    invoke :help, ['enable']
  else
    require_relative 'plan/enable'
    Gzr::Commands::Plan::Enable.new(plan_id,options).execute
  end
end

#failuresObject



39
40
41
42
43
44
45
46
# File 'lib/gzr/commands/plan.rb', line 39

def failures(*)
  if options[:help]
    invoke :help, ['failures']
  else
    require_relative 'plan/failures'
    Gzr::Commands::Plan::Failures.new(options).execute
  end
end

#import(plan_file, obj_type, id) ⇒ Object



105
106
107
108
109
110
111
112
# File 'lib/gzr/commands/plan.rb', line 105

def import(plan_file, obj_type, id )
  if options[:help]
    invoke :help, ['import']
  else
    require_relative 'plan/import'
    Gzr::Commands::Plan::Import.new(plan_file, obj_type, id, options).execute
  end
end

#lsObject



139
140
141
142
143
144
145
146
# File 'lib/gzr/commands/plan.rb', line 139

def ls(*)
  if options[:help]
    invoke :help, ['ls']
  else
    require_relative 'plan/ls'
    Gzr::Commands::Plan::Ls.new(options).execute
  end
end

#randomize(plan_id = nil) ⇒ Object



155
156
157
158
159
160
161
162
# File 'lib/gzr/commands/plan.rb', line 155

def randomize(plan_id = nil)
  if options[:help]
    invoke :help, ['randomize']
  else
    require_relative 'plan/randomize'
    Gzr::Commands::Plan::Randomize.new(plan_id, options).execute
  end
end

#rm(plan_id) ⇒ Object



87
88
89
90
91
92
93
94
# File 'lib/gzr/commands/plan.rb', line 87

def rm(plan_id)
  if options[:help]
    invoke :help, ['rm']
  else
    require_relative 'plan/rm'
    Gzr::Commands::Plan::Rm.new(plan_id, options).execute
  end
end

#runit(plan_id) ⇒ Object



51
52
53
54
55
56
57
58
# File 'lib/gzr/commands/plan.rb', line 51

def runit(plan_id)
  if options[:help]
    invoke :help, ['runit']
  else
    require_relative 'plan/run'
    Gzr::Commands::Plan::RunIt.new(plan_id,options).execute
  end
end