Module: Nero

Extended by:
Resolvable
Defined in:
lib/nero.rb,
lib/nero/util.rb,
lib/nero/version.rb
more...

Overview

TODO fail on unknown tag TODO show missing env’s at once TODO raise when missing arg(s) for tag

Defined Under Namespace

Modules: Resolvable, Util Classes: BaseTag, Configuration, EnvTag, Error, PathRootTag

Constant Summary collapse

VERSION =

NOTE this is written upon release via: $ rake gem:build

"0.5.0.pre"

Class Method Summary collapse

Methods included from Resolvable

deep_resolve, gen_resolve_tryer, resolve_nested!, try_resolve

Class Method Details

.configurationObject

[View source] [View on GitHub]

66
67
68
# File 'lib/nero.rb', line 66

def self.configuration
  @configuration ||= Configuration.new
end

.configure {|configuration| ... } ⇒ Object

Yields:

[View source] [View on GitHub]

70
71
72
# File 'lib/nero.rb', line 70

def self.configure
  yield configuration if block_given?
end

.load(raw, root: nil, env: nil, resolve: true) ⇒ Object

[View source] [View on GitHub]

337
338
339
340
341
342
# File 'lib/nero.rb', line 337

def self.load(raw, root: nil, env: nil, resolve: true)
  root ||= env
  add_tags!

  process_yaml(yaml_load(raw, yaml_options), root:, resolve:)
end

.load_config(file, root: nil, env: nil, resolve: true) ⇒ Object

[View source] [View on GitHub]

314
315
316
317
318
319
320
321
322
323
324
325
# File 'lib/nero.rb', line 314

def self.load_config(file, root: nil, env: nil, resolve: true)
  root ||= env
  add_tags!

  config_file = resolve_file(file)

  if config_file.exist?
    process_yaml(yaml_load_file(config_file, yaml_options), root:, config_file:, resolve:)
  else
    raise "Can't find file #{config_file}"
  end
end

.reset_configuration!Object

[View source] [View on GitHub]

295
296
297
298
299
300
301
302
303
# File 'lib/nero.rb', line 295

def self.reset_configuration!
  @configuration = nil

  configure do |config|
    config.config_dir = Pathname.pwd
  end

  add_default_tags!
end