Sha256: f752b5f341b5c63deb131db2b0a17149f360c208558999d6a68925a305e9fae7

Contents?: true

Size: 1.05 KB

Versions: 10

Compression:

Stored size: 1.05 KB

Contents

class Hiera
  module Backend
    module Eyaml
      class Options

        def self.[]= key, value
          @@options ||= {}
          @@options[ key.to_sym ] = value
        end

        def self.[] key
          @@options ||= {}
          @@options[ key.to_sym ]
        end

        def self.set hash
          @@options = {}
          hash.each do |k, v|
            @@options[ k.to_sym ] = v
          end
        end

        def self.trace
          LoggingHelper::trace "Dump of eyaml tool options dict:"
          LoggingHelper::trace "--------------------------------"
          @@options.each do |k, v|
            begin
              LoggingHelper::trace sprintf "%18s %-18s = %18s %-18s", "(#{k.class.name})", k.to_s, "(#{v.class.name})", v.to_s
            rescue
              LoggingHelper::trace sprintf "%18s %-18s = %18s %-18s", "(#{k.class.name})", k.to_s, "(#{v.class.name})", "<unprintable>" # case where v is binary
            end
          end
          LoggingHelper::trace "--------------------------------"
        end

      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
hiera-eyaml-3.4.0 lib/hiera/backend/eyaml/options.rb
hiera-eyaml-3.3.0 lib/hiera/backend/eyaml/options.rb
hiera-eyaml-3.2.2 lib/hiera/backend/eyaml/options.rb
hiera-eyaml-3.2.1 lib/hiera/backend/eyaml/options.rb
hiera-eyaml-3.2.0 lib/hiera/backend/eyaml/options.rb
hiera-eyaml-3.1.1 lib/hiera/backend/eyaml/options.rb
hiera-eyaml-3.1.0 lib/hiera/backend/eyaml/options.rb
hiera-eyaml-3.0.0 lib/hiera/backend/eyaml/options.rb
hiera-eyaml-2.1.0 lib/hiera/backend/eyaml/options.rb
hiera-eyaml-2.1.0.rc2 lib/hiera/backend/eyaml/options.rb