Module: Tinychef::Commands

Defined in:
lib/tinychef/commands.rb

Instance Method Summary collapse

Instance Method Details

#bag_create_commandObject



14
15
16
17
# File 'lib/tinychef/commands.rb', line 14

def bag_create_command
  recipe = ARGV[1] ; name = ARGV[2]
  Tinychef::DataBag.new(recipe, name).create
end

#bag_decrypt_commandObject



24
25
26
27
# File 'lib/tinychef/commands.rb', line 24

def bag_decrypt_command
  recipe = ARGV[1] ; name = ARGV[2]
  Tinychef::DataBag.new(recipe, name).decrypt
end

#bag_encrypt_commandObject



19
20
21
22
# File 'lib/tinychef/commands.rb', line 19

def bag_encrypt_command
  recipe = ARGV[1] ; name = ARGV[2]
  Tinychef::DataBag.new(recipe, name).encrypt
end

#boot_commandObject



9
10
11
12
# File 'lib/tinychef/commands.rb', line 9

def boot_command
  dest = ARGV[1] ; script = ARGV[2]
  Tinychef::BootScript.new(dest, script).run
end

#key_generate_commandObject



37
38
39
# File 'lib/tinychef/commands.rb', line 37

def key_generate_command
  Tinychef::Key.new(ARGV[1]).generate
end

#key_lock_commandObject



29
30
31
# File 'lib/tinychef/commands.rb', line 29

def key_lock_command
  Tinychef::Key.new(ARGV[1]).password_protect
end

#key_unlock_commandObject



33
34
35
# File 'lib/tinychef/commands.rb', line 33

def key_unlock_command
  Tinychef::Key.new(ARGV[1]).unlock_and_restore
end

#new_commandObject



4
5
6
7
# File 'lib/tinychef/commands.rb', line 4

def new_command
  dir_name = ARGV[1]
  Tinychef::NewDirectory.new(dir_name).create
end

#run_commandObject



47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/tinychef/commands.rb', line 47

def run_command
  options = {}

  options[:node] = ARGV[1]

  if ARGV.size == 3 # assume the destination is not given
    options[:dest] = nil ; options[:run_list] = ARGV[2]
  else
    options[:dest] = ARGV[2] ; options[:run_list] = ARGV[3]
  end

  Tinychef::NodeRun.new(options).start
end

#secure_commandObject



41
42
# File 'lib/tinychef/commands.rb', line 41

def secure_command
end

#unsecure_commandObject



44
45
# File 'lib/tinychef/commands.rb', line 44

def unsecure_command
end