Sha256: 7e0767ccc234263471e587e5a27ced086bcdf31e7e60f6db173f74bcf5c1ed92

Contents?: true

Size: 496 Bytes

Versions: 3

Compression:

Stored size: 496 Bytes

Contents

require 'ostruct'

class RTesseract
  class Configuration < OpenStruct
    def merge(options)
      RTesseract::Configuration.new(to_h.merge(options))
    end

    def command
      @table[:command]
    end
  end

  class << self
    def config
      @config ||= RTesseract::Configuration.new(
        command: 'tesseract',
        debug_file: '/dev/null'
      )
    end

    def configure
      yield(config) if block_given?
    end

    def reset_config!
      @config = nil
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rtesseract-3.0.5 lib/rtesseract/configuration.rb
rtesseract-3.0.4 lib/rtesseract/configuration.rb
rtesseract-3.0.3 lib/rtesseract/configuration.rb