Sha256: a0f06b990c1280e523575f4990d24424b533de95387ce2cc5be12200a11c4ed0

Contents?: true

Size: 728 Bytes

Versions: 4

Compression:

Stored size: 728 Bytes

Contents

require 'conjur-asset-dsl2'

module Conjur
  module DSL2
    module YAML
      class Loader
        class << self
          def load yaml, filename = nil
            parser = Psych::Parser.new(handler = Handler.new)
            handler.filename = filename
            handler.parser = parser
            begin
              parser.parse(yaml)
            rescue
              handler.log { $!.message }
              handler.log { $!.backtrace.join("  \n") }
              raise Invalid.new($!.message, filename, parser.mark)
            end
            handler.result
          end
          
          def load_file filename
            load File.read(filename), filename
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
conjur-asset-dsl2-0.4.2 lib/conjur/dsl2/yaml/loader.rb
conjur-asset-dsl2-0.3.2 lib/conjur/dsl2/yaml/loader.rb
conjur-asset-dsl2-0.3.1 lib/conjur/dsl2/yaml/loader.rb
conjur-asset-dsl2-0.3.0 lib/conjur/dsl2/yaml/loader.rb