class Producer::Core::Env

Attributes

debug[RW]
dry_run[RW]
error_output[R]
input[R]
logger[R]
output[R]
recipe_argv[RW]
registry[R]
target[RW]
verbose[RW]

Public Class Methods

new(input: $stdin, output: $stdout, error_output: $stderr, remote: nil, registry: {}) click to toggle source
# File lib/producer/core/env.rb, line 10
def initialize input: $stdin, output: $stdout, error_output: $stderr,
    remote: nil, registry: {}
  @verbose = @debug = @dry_run = false
  @input        = input
  @output       = output
  @error_output = error_output
  @remote       = remote
  @registry     = registry
end

Public Instance Methods

[](*args) click to toggle source
# File lib/producer/core/env.rb, line 24
def [] *args
  @registry.fetch *args
rescue KeyError
  raise RegistryKeyError, args.first.inspect
end
Also aliased as: get
cleanup() click to toggle source
# File lib/producer/core/env.rb, line 54
def cleanup
  remote.cleanup
end
debug?() click to toggle source
# File lib/producer/core/env.rb, line 46
def debug?
  @debug
end
dry_run?() click to toggle source
# File lib/producer/core/env.rb, line 50
def dry_run?
  @dry_run
end
get(*args)
Alias for: []
log(message, severity = :info) click to toggle source
# File lib/producer/core/env.rb, line 38
def log message, severity = :info
  logger.send severity, message
end
remote() click to toggle source
# File lib/producer/core/env.rb, line 20
def remote
  @remote ||= Remote.new(target)
end
verbose?() click to toggle source
# File lib/producer/core/env.rb, line 42
def verbose?
  @verbose
end