Sha256: 8c5943d9f25d30d3a0b5ab8e76df4978f25796d4484ae4071ba3c405d3663623

Contents?: true

Size: 1.95 KB

Versions: 7

Compression:

Stored size: 1.95 KB

Contents

require 'active_fedora'
require 'deprecation'

module Hydra
  module Derivatives
    extend ActiveSupport::Concern
    extend ActiveSupport::Autoload
    extend Deprecation
    self.deprecation_horizon = "hydra-derivatives 1.0"

    # Runners take a single input and produce one or more outputs
    # The runner typically accomplishes this by using one or more processors
    autoload_under 'runners' do
      autoload :ActiveEncodeDerivatives
      autoload :AudioDerivatives
      autoload :DocumentDerivatives
      autoload :FullTextExtract
      autoload :ImageDerivatives
      autoload :Jpeg2kImageDerivatives
      autoload :PdfDerivatives
      autoload :Runner
      autoload :VideoDerivatives
    end

    autoload :Processors
    autoload :Config
    autoload :Logger
    autoload :TempfileService
    autoload :IoDecorator
    autoload :AudioEncoder

    autoload_under 'services' do
      autoload :RetrieveSourceFileService
      autoload :RemoteSourceFile
      autoload :PersistOutputFileService
      autoload :PersistBasicContainedOutputFileService
      autoload :PersistExternalFileOutputFileService
      autoload :TempfileService
      autoload :MimeTypeService
    end

    # Raised if the timout elapses
    class TimeoutError < ::Timeout::Error; end

    def self.config
      @config ||= reset_config!
    end

    def self.reset_config!
      @config = Config.new
    end

    CONFIG_METHODS = %i[ffmpeg_path libreoffice_path temp_file_base fits_path kdu_compress_path
                        kdu_compress_recipes enable_ffmpeg source_file_service output_file_service active_encode_poll_time].freeze
    CONFIG_METHODS.each do |method|
      module_eval <<-RUBY
        def self.#{method}
          config.#{method}
        end
        def self.#{method}= val
          config.#{method}= val
        end
      RUBY
    end

    included do
      class_attribute :source_file_service
      self.source_file_service = Hydra::Derivatives.source_file_service
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
hydra-derivatives-3.7.0 lib/hydra/derivatives.rb
hydra-derivatives-3.6.1 lib/hydra/derivatives.rb
hydra-derivatives-3.6.0 lib/hydra/derivatives.rb
hydra-derivatives-3.5.0 lib/hydra/derivatives.rb
hydra-derivatives-3.4.2 lib/hydra/derivatives.rb
hydra-derivatives-3.4.1 lib/hydra/derivatives.rb
hydra-derivatives-3.4.0 lib/hydra/derivatives.rb