Sha256: d3b99b2a8e46bb740c86816293a670f450b4324464646dcae99979a67b03d46f

Contents?: true

Size: 540 Bytes

Versions: 5

Compression:

Stored size: 540 Bytes

Contents

require 'yaml'
module I18n::Tasks
  module Data
    module Adapter
      module YamlAdapter
        extend 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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
i18n-tasks-0.9.2 lib/i18n/tasks/data/adapter/yaml_adapter.rb
i18n-tasks-0.9.1 lib/i18n/tasks/data/adapter/yaml_adapter.rb
i18n-tasks-0.9.0 lib/i18n/tasks/data/adapter/yaml_adapter.rb
i18n-tasks-0.9.0.rc2 lib/i18n/tasks/data/adapter/yaml_adapter.rb
i18n-tasks-0.9.0.rc1 lib/i18n/tasks/data/adapter/yaml_adapter.rb