lib/ddr/extraction.rb in ddr-extraction-0.2.1 vs lib/ddr/extraction.rb in ddr-extraction-0.3.0

- old
+ new

@@ -1,26 +1,38 @@ require_relative "extraction/version" require_relative "extraction/configuration" require_relative "extraction/extractor" +require_relative "extraction/adapters" module Ddr # - # Ddr::Extraction - A file text and metadata extraction service. + # Ddr::Extraction - A pluggable content extraction service. # module Extraction class << self + # Returns the service configuration def config @config ||= Configuration.new end - # Yields a configuration object for the service + # Yields the service configuration to a block def configure yield config end - + + # Loads default configuration settings + def load_defaults! + require_relative "extraction/defaults" + end + + def build_extractor(adapter_name = nil) + Extractor.build(adapter_name) + end + end end end +Dir[File.join(__dir__, "extraction", "adapters", "*_adapter.rb")].each { |adapter| require(adapter) }