Module: Nugget

Defined in:
lib/nugget.rb,
lib/nugget/cli.rb,
lib/nugget/log.rb,
lib/nugget/web.rb,
lib/nugget/config.rb,
lib/nugget/service.rb,
lib/nugget/version.rb,
lib/nugget/backstop.rb

Defined Under Namespace

Classes: Backstop, CLI, Config, Log, Service, Web

Constant Summary collapse

VERSION =
"0.0.10"

Class Method Summary collapse

Class Method Details

.mainObject



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/nugget.rb', line 29

def main
  cli = Nugget::CLI.new
  cli.parse_options
  Nugget::Config.merge!(cli.config)

  Nugget::Log.level(Nugget::Config.log_level)

  if Nugget::Config.web
    Nugget::Web.run()
  else
    if Nugget::Config.config
      if Nugget::Config.daemon
        Nugget::Service.run_daemon(Nugget::Config.test)
      else
        Nugget::Service.run_once(Nugget::Config.test)
      end
    else
      Nugget::Log.error("No config supplied! Use \"-c FILE\".")
    end
  end
end