Module: CMDB

Defined in:
lib/cmdb.rb,
lib/cmdb/version.rb,
lib/cmdb/commands.rb,
lib/cmdb/rewriter.rb,
lib/cmdb/interface.rb,
lib/cmdb/file_source.rb,
lib/cmdb/consul_source.rb

Defined Under Namespace

Modules: Commands Classes: BadData, BadKey, BadValue, ConsulSource, EnvironmentConflict, Error, FileRewriter, FileSource, Interface, MissingKey, NameConflict, Rewriter, ValueConflict

Constant Summary collapse

DEVELOPMENT_ENVIRONMENTS =

Values of RACK_ENV/RAILS_ENV that are considered to be “development,” which relaxes certain runtime sanity checks.

[nil, 'development', 'test'].freeze
VALID_KEY =

Regexp that matches valid key names. Key names consist of one or more dot-separated words; each word must begin with a lowercase alpha character and may contain alphanumerics or underscores.

/^[a-z][a-z0-9_]*(?:\.[a-z][a-z0-9_]*)*$/
Conflict =

Deprecated name for ValueConflict

ValueConflict
VERSION =
'2.6.1'.freeze

Class Method Summary collapse

Class Method Details

.development?Boolean

Determine whether CMDB is running in a development environment.

Returns:

  • (Boolean)


132
133
134
# File 'lib/cmdb.rb', line 132

def development?
  DEVELOPMENT_ENVIRONMENTS.include?(ENV['RACK_ENV'] || ENV['RAILS_ENV'])
end

.logObject



117
118
119
120
121
122
123
124
# File 'lib/cmdb.rb', line 117

def log
  unless @log
    @log = Logger.new(STDOUT)
    @log.level = Logger::WARN
  end

  @log
end

.log=(log) ⇒ Object



126
127
128
# File 'lib/cmdb.rb', line 126

def log=(log)
  @log = log
end