Sha256: c3ae8d16f696b17c410c13ea51471dd4b6e9470d4d38d32fc72b6770cd67fffc

Contents?: true

Size: 382 Bytes

Versions: 1

Compression:

Stored size: 382 Bytes

Contents

module Pacto
  module Extensions
    module Loaders
      class YamlOrJsonLoader
        YAML_EXTENSIONS = %w{.yml .yaml}
        def self.load(file)
          raw_data = File.read file
          if YAML_EXTENSIONS.include? File.extname(file)
            YAML::load(raw_data)
          else
            MultiJson.load(raw_data)
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
polytrix-0.0.1 features/pacto/extensions/loaders/yaml_or_json_loader.rb