require 'eancom/version' require 'eancom/edifact' module Eancom class Error < StandardError; end FILE_TYPES = [ :desadv, :pricat, :ordrsp, :salsrp, :invrp, :orders ] attr_accessor :definitions def self.definitions @@configs ||= Hash.new end def self.register_definition(definition) type = definition.type name = definition.name definitions[type] ||= Hash.new definitions[type][name] = definition end def self.find_definition(name:, type:) definitions[type][name] end end require "eancom/factory" require "eancom/definition" spec = Gem::Specification.find_by_name("eancom") gem_root = spec.gem_dir Dir[File.join(gem_root, "definitions", "**/*.rb")].sort.each do |file| require file end