Sha256: 1647dccdae3464aeb858521a86981a833842fa61f2507a6c118eeb3d0370e345

Contents?: true

Size: 608 Bytes

Versions: 6

Compression:

Stored size: 608 Bytes

Contents

# frozen_string_literal: true
require 'yaml'
module I18n::Tasks
  module Data
    module Adapter
      module YamlAdapter
        class << self
          # @return [Hash] locale tree
          def parse(str, options)
            if YAML.method(:load).arity.abs == 2
              YAML.load(str, options || {})
            else
              # older jruby and rbx 2.2.7 do not accept options
              YAML.load(str)
            end
          end

          # @return [String]
          def dump(tree, options)
            tree.to_yaml(options || {})
          end
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
i18n-tasks-0.9.12 lib/i18n/tasks/data/adapter/yaml_adapter.rb
i18n-tasks-0.9.11 lib/i18n/tasks/data/adapter/yaml_adapter.rb
i18n-tasks-0.9.10 lib/i18n/tasks/data/adapter/yaml_adapter.rb
i18n-tasks-0.9.9 lib/i18n/tasks/data/adapter/yaml_adapter.rb
i18n-tasks-0.9.8 lib/i18n/tasks/data/adapter/yaml_adapter.rb
i18n-tasks-0.9.7 lib/i18n/tasks/data/adapter/yaml_adapter.rb