Module: Trinidad

Defined in:
lib/trinidad/server.rb,
lib/trinidad/helpers.rb,
lib/trinidad/logging.rb,
lib/trinidad/version.rb,
lib/trinidad/web_app.rb,
lib/trinidad/extensions.rb,
lib/trinidad/configuration.rb,
lib/trinidad/lifecycle/base.rb,
lib/trinidad/lifecycle/host.rb,
lib/trinidad/command_line_parser.rb,
lib/trinidad/lifecycle/web_app/war.rb,
lib/trinidad/lifecycle/web_app/shared.rb,
lib/trinidad/lifecycle/web_app/default.rb,
lib/trinidad/lifecycle/host/restart_reload.rb,
lib/trinidad/lifecycle/host/rolling_reload.rb

Defined Under Namespace

Modules: Extensions, Helpers, Lifecycle, Logging Classes: CommandLineParser, Configuration, RackWebApp, RailsWebApp, Server, WarWebApp, WebApp

Constant Summary collapse

LogFormatter =

backwards compatibility

Logging::DefaultFormatter
VERSION =
'1.4.6'
RackupWebApp =
RackWebApp

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configurationObject

Returns the value of attribute configuration.



3
4
5
# File 'lib/trinidad/configuration.rb', line 3

def configuration
  @configuration
end

Class Method Details

.configure(*args) {|config| ... } ⇒ Object

Creates a new global configuration (unless already exists) and (deep) merges the current values using the provided options.

Yields:

  • (config)


8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/trinidad/configuration.rb', line 8

def self.configure(*args)
  config = ( self.configuration ||= Configuration.new )
  args.compact!
  if options = args.shift
    options = Configuration.symbolize_options(options)
    args.each do |opts|
      opts = Configuration.symbolize_options(opts)
      options = Configuration.merge_options(options, opts)
    end
    config.update!(options)
  end

  yield config if block_given?
  config
end

.configure!(*args, &block) ⇒ Object

Forces a new global configuration using default and the provided options.



25
26
27
28
# File 'lib/trinidad/configuration.rb', line 25

def self.configure!(*args, &block)
  self.configuration = Configuration.new
  configure(*args, &block)
end