Sha256: 1f8a1b528b995f8e82c52a3ac32b85de54de191ef7a96c4f80cbef81d4e76ea5

Contents?: true

Size: 684 Bytes

Versions: 11

Compression:

Stored size: 684 Bytes

Contents

require "relaton-render"

module Relaton
  module Render
    module IsoDoc
      class General < ::Relaton::Render::General
        def config_loc
          YAML.load_file(File.join(File.dirname(__FILE__), "config.yml"))
        end

        def read_config
          super.deep_merge(config_loc)
        end
      end
    end
  end
end

class ::Hash
  def deep_merge(second)
    merger = proc { |_, v1, v2|
      if Hash === v1 && Hash === v2
        v1.merge(v2, &merger)
      elsif Array === v1 && Array === v2
        v1 | v2
      elsif [:undefined, nil,
             :nil].include?(v2)
        v1
      else
        v2
      end
    }
    merge(second.to_h, &merger)
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
isodoc-2.2.1 lib/relaton/render/general.rb
isodoc-2.2.0 lib/relaton/render/general.rb
isodoc-2.1.5 lib/relaton/render/general.rb
isodoc-2.1.4 lib/relaton/render/general.rb
isodoc-2.1.3 lib/relaton/render/general.rb
isodoc-2.1.2.1 lib/relaton/render/general.rb
isodoc-2.1.2 lib/relaton/render/general.rb
isodoc-2.1.1 lib/relaton/render/general.rb
isodoc-2.1.0.2 lib/relaton/render/general.rb
isodoc-2.1.0.1 lib/relaton/render/general.rb
isodoc-2.1.0 lib/relaton/render/general.rb