Sha256: 83b618cf2db82f48b22a903c352ceb782e0976bdad954535d04be163e51ff3a4

Contents?: true

Size: 720 Bytes

Versions: 8

Compression:

Stored size: 720 Bytes

Contents

class IMGKit
  class Configuration
    attr_accessor :meta_tag_prefix, :wkhtmltoimage, :default_options, :default_format

    def initialize
      @meta_tag_prefix = 'imgkit-'
      @wkhtmltoimage   = '/usr/local/bin/wkhtmltoimage'
      @default_options = {}
      @default_format  = :jpg
    end
  end

  class << self
    attr_accessor :configuration
  end

  # Configure IMGKit someplace sensible,
  # like config/initializers/imgkit.rb
  #
  # @example
  #   IMGKit.configure do |config|
  #     config.wkhtmltoimage = '/usr/bin/wkhtmltoimage'
  #   end
  
  def self.configuration
    @configuration ||= Configuration.new
  end
  
  
  def self.configure
    self.configuration 
    yield(configuration)
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
imgkit-1.3.7 lib/imgkit/configuration.rb
imgkit-1.3.6 lib/imgkit/configuration.rb
imgkit-1.3.5 lib/imgkit/configuration.rb
imgkit-1.3.4 lib/imgkit/configuration.rb
imgkit-1.3.3 lib/imgkit/configuration.rb
imgkit-1.3.2 lib/imgkit/configuration.rb
imgkit-1.3.1 lib/imgkit/configuration.rb
imgkit-1.3.0 lib/imgkit/configuration.rb