Sha256: a448d12e4aceca4c3d5c45db00b70da0f47ebe639a74342a3cf2b558df639372

Contents?: true

Size: 543 Bytes

Versions: 13

Compression:

Stored size: 543 Bytes

Contents

require 'puppet/resource_api/base_context'

# Implement Resource API Conext to log through an IO object, defaulting to `$stderr`.
# There is no access to a device here. You can supply a transport if necessary.
class Puppet::ResourceApi::IOContext < Puppet::ResourceApi::BaseContext
  attr_reader :transport

  def initialize(definition, target = $stderr, transport = nil)
    super(definition)
    @target = target
    @transport = transport
  end

  protected

  def send_log(level, message)
    @target.puts "#{level}: #{message}"
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
puppet-resource_api-1.8.13 lib/puppet/resource_api/io_context.rb
puppet-resource_api-1.8.9 lib/puppet/resource_api/io_context.rb
puppet-resource_api-1.8.8 lib/puppet/resource_api/io_context.rb
puppet-resource_api-1.8.12 lib/puppet/resource_api/io_context.rb
puppet-resource_api-1.8.11 lib/puppet/resource_api/io_context.rb
puppet-resource_api-1.8.10 lib/puppet/resource_api/io_context.rb
puppet-resource_api-1.8.7 lib/puppet/resource_api/io_context.rb
puppet-resource_api-1.8.6 lib/puppet/resource_api/io_context.rb
puppet-resource_api-1.8.4 lib/puppet/resource_api/io_context.rb
puppet-resource_api-1.8.3 lib/puppet/resource_api/io_context.rb
puppet-resource_api-1.8.2 lib/puppet/resource_api/io_context.rb
puppet-resource_api-1.8.1 lib/puppet/resource_api/io_context.rb
puppet-resource_api-1.8.0 lib/puppet/resource_api/io_context.rb