Class: AdminModule::Command::Stage

Inherits:
Thor
  • Object
show all
Includes:
ClientAccess
Defined in:
lib/admin_module/command/stage.rb

Instance Method Summary collapse

Instance Method Details

#delete(name) ⇒ Object



102
103
104
105
106
107
108
# File 'lib/admin_module/command/stage.rb', line 102

def delete name
  cs = client.stages
  cs.delete name

ensure
  client.logout
end

#export(filepath) ⇒ Object



84
85
86
87
88
89
90
91
# File 'lib/admin_module/command/stage.rb', line 84

def export filepath
  cs = client.stages
  cs.export filepath

  return
ensure
  client.logout
end

#import(filepath) ⇒ Object



66
67
68
69
70
71
72
73
# File 'lib/admin_module/command/stage.rb', line 66

def import filepath
  cs = client.stages
  cs.import filepath, options[:create]

  return
ensure
  client.logout
end

#listObject



44
45
46
47
48
49
50
51
52
# File 'lib/admin_module/command/stage.rb', line 44

def list
  cs = client.stages
  list = cs.list

  list.each { |s| say s; }

ensure
  client.logout
end

#read(name) ⇒ Object



119
120
121
122
123
124
125
126
127
128
# File 'lib/admin_module/command/stage.rb', line 119

def read name
  cs = client.stages
  data = cs.read(name)
  output = Hash.new
  output[name] = data
  $stdout << output.to_yaml

ensure
  client.logout
end

#rename(src, dest) ⇒ Object



26
27
28
29
30
31
32
33
34
35
# File 'lib/admin_module/command/stage.rb', line 26

def rename src, dest
  cs = client.stages
  cs.rename src, dest

rescue ArgumentError => e
  say e.message, :red

ensure
  client.logout
end