Module: SmallWonder

Defined in:
lib/small_wonder.rb,
lib/small_wonder/cli.rb,
lib/small_wonder/log.rb,
lib/small_wonder/utils.rb,
lib/small_wonder/config.rb,
lib/small_wonder/deploy.rb,
lib/small_wonder/application.rb,
lib/small_wonder/configuratorator.rb

Defined Under Namespace

Classes: Application, CLI, Config, Configuratorator, Deploy, Log, Utils

Class Method Summary collapse

Class Method Details

.long_mainObject



43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/small_wonder.rb', line 43

def long_main()

  cli = SmallWonder::CLI.new
  cli.parse_options

  # consume small wonder config
  SmallWonder::Utils.consume_config_file(cli, cli.config[:config_file])

  # consume knife config
  SmallWonder::Utils.consume_config_file(cli, cli.config[:knife_config_file])

  main()
end

.mainObject



79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/small_wonder.rb', line 79

def main()

  # inintialize chef/knife config
  Chef::Config[:node_name] = SmallWonder::Config.node_name
  Chef::Config[:client_key] = SmallWonder::Config.client_key
  Chef::Config[:chef_server_url] = SmallWonder::Config.chef_server_url

  # Set up salticid
  self.salticid = Salticid.new
  self.salticid.load(File.expand_path(File.join(
    SmallWonder::Config.application_deployments_dir, '**', '*.rb')))

  case SmallWonder::Config.action
  when "vicki"
    system("open http://www.youtube.com/watch?v=ukSvjqwJixw")
  else
    SmallWonder::Log.info("Using specified action(s): #{SmallWonder::Config.action}")
    SmallWonder::Deploy.run
  end

end

.salticidObject



39
40
41
# File 'lib/small_wonder.rb', line 39

def salticid
  @salticid
end

.salticid=(h) ⇒ Object



35
36
37
# File 'lib/small_wonder.rb', line 35

def salticid=(h)
  @salticid = h
end

.short_mainObject



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/small_wonder.rb', line 57

def short_main()

  cli = SmallWonder::CLI.new
  cli.parse_options

  # consume small wonder config
  SmallWonder::Utils.consume_config_file(cli, cli.config[:config_file])

  # consume knife config
  SmallWonder::Utils.consume_config_file(cli, cli.config[:knife_config_file])

  # sw facade deploy [fqdn]
  SmallWonder::Config.app = ARGV[0]
  SmallWonder::Config.action = ARGV[1]

  if ARGV[2]
    SmallWonder::Config.query = "fqdn:#{ARGV[2]}"
  end

  main()
end