Sha256: 780021c9af7518483bc89e4f7a2aa57a857d0ba2d128398c4f3ea1e2a340b226

Contents?: true

Size: 527 Bytes

Versions: 1

Compression:

Stored size: 527 Bytes

Contents

# frozen_string_literal: true

module Cacofonix
  module DTDs
    Error = Class.new(StandardError)

    def self.xml_catalog_path
      File.expand_path("../../data/catalog.xml", __dir__)
    end

    def self.apply_libxml_env!(env = ENV)
      existing_value = env[libxml_env_key]

      if block_given? && existing_value && existing_value != xml_catalog_path
        yield existing_value
      end

      env[libxml_env_key] = xml_catalog_path
    end

    def self.libxml_env_key
      "XML_CATALOG_FILES"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cacofonix-dtds-0.1.0 lib/cacofonix/dtds.rb