Sha256: 3f22018abf3eb02c135068d7e56db34dfa6b409e8163515d23cb4c1f3a926c6e

Contents?: true

Size: 746 Bytes

Versions: 5

Compression:

Stored size: 746 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 || "(no 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

5 entries across 5 versions & 1 rubygems

Version Path
conjur-asset-dsl2-0.6.1 lib/conjur/dsl2/yaml/loader.rb
conjur-asset-dsl2-0.6.0 lib/conjur/dsl2/yaml/loader.rb
conjur-asset-dsl2-0.5.0 lib/conjur/dsl2/yaml/loader.rb
conjur-asset-dsl2-0.4.4 lib/conjur/dsl2/yaml/loader.rb
conjur-asset-dsl2-0.4.3 lib/conjur/dsl2/yaml/loader.rb