Class: StacksOnDeck::Main

Inherits:
Mjolnir
  • Object
show all
Defined in:
lib/stacksondeck/main.rb

Overview

StacksOnDeck’s entrypoint.

Constant Summary collapse

SYSTEM_KNIFE =
'/etc/chef/knife.rb'
USER_KNIFE =
File.join(ENV['HOME'] || '', '.chef', 'knife.rb')
DEFAULT_KNIFE =
if File.exist? SYSTEM_KNIFE
  SYSTEM_KNIFE
elsif File.exist? USER_KNIFE
  USER_KNIFE
end

Constants inherited from Mjolnir

StacksOnDeck::Mjolnir::COMMON_OPTIONS

Instance Method Summary collapse

Methods inherited from Mjolnir

include_common_options

Instance Method Details

#artObject



24
25
26
# File 'lib/stacksondeck/main.rb', line 24

def art
  puts "\n%s\n" % ART
end

#serverObject



75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/stacksondeck/main.rb', line 75

def server
  App.set :log, log
  App.set :bind, options.bind
  App.set :port, options.port
  App.set :config, options.config
  App.set :refresh, options.refresh
  App.set :username, options.username
  App.set :environment, options.environment
  App.set :hints, options.hints

  if options.debug?
    App.set :raise_errors, true
    App.set :dump_errors, true
    App.set :show_exceptions, true
    App.set :logging, ::Logger::DEBUG
  end

  Celluloid.logger = options.trace? ? log : nil

  log.info event: 'server', options: options
  App.run!
end

#versionObject



18
19
20
# File 'lib/stacksondeck/main.rb', line 18

def version
  puts VERSION
end