Module: Rocket::Server

Includes:
Konfigurator::Simple
Defined in:
lib/rocket/server.rb,
lib/rocket/server/app.rb,
lib/rocket/server/cli.rb,
lib/rocket/server/misc.rb,
lib/rocket/server/runner.rb,
lib/rocket/server/channel.rb,
lib/rocket/server/helpers.rb,
lib/rocket/server/session.rb,
lib/rocket/server/connection.rb

Defined Under Namespace

Modules: Helpers, Misc Classes: App, CLI, Channel, Connection, Runner, Session

Class Method Summary collapse

Class Method Details

.appsObject



47
48
49
# File 'lib/rocket/server.rb', line 47

def apps
  @apps ||= settings[:apps] || {}
end

.configure_loggerObject



76
77
78
79
80
81
# File 'lib/rocket/server.rb', line 76

def configure_logger
  logger.add_appenders(Logging.appenders.file(settings[:log])) if log
  logger.level = :debug if verbose
  logger.level = :error if !verbose and quiet
  true
end

.default_loggerObject



83
84
85
86
87
88
# File 'lib/rocket/server.rb', line 83

def default_logger
  logger = Logging.logger["Rocket"]
  logger.add_appenders(Logging.appenders.stdout)
  logger.level = :info
  logger
end

.load_settings_with_setup(file, local_settings = {}) ⇒ Object Also known as: load_settings



59
60
61
62
63
64
65
66
67
68
# File 'lib/rocket/server.rb', line 59

def load_settings_with_setup(file, local_settings={})
  load_settings_without_setup(file, false)
  settings.merge!(local_settings)
  configure_logger
  require_plugins
  true
rescue => ex
  puts ex.to_s
  exit 1
end

.loggerObject



51
52
53
# File 'lib/rocket/server.rb', line 51

def logger
  @logger ||= default_logger
end

.logger=(logger) ⇒ Object



55
56
57
# File 'lib/rocket/server.rb', line 55

def logger=(logger)
  @logger = logger
end

.require_pluginsObject



72
73
74
# File 'lib/rocket/server.rb', line 72

def require_plugins
  plugins.to_a.each {|plugin| require plugin }
end