Sha256: d8340023662460437b86afa5226a83d7ad6048ddcfe243732977e3b9a10729db

Contents?: true

Size: 923 Bytes

Versions: 1

Compression:

Stored size: 923 Bytes

Contents

require "inline_svg/version"
require "inline_svg/action_view/helpers"
require "inline_svg/finds_asset_paths"
require "inline_svg/asset_file"
require "inline_svg/railtie" if defined?(Rails)
require 'active_support/core_ext'
require 'nokogiri'

module InlineSvg
  class Configuration
    class Invalid < ArgumentError; end

    attr_reader :asset_finder

    def asset_finder=(finder)
      if finder.respond_to?(:find_asset)
        @asset_finder = finder
      else
        raise InlineSvg::Configuration::Invalid.new("Asset Finder should implement the #find_asset method")
      end
      asset_finder
    end
  end

  @configuration = InlineSvg::Configuration.new

  class << self
    attr_reader :configuration

    def configure
      if block_given?
        yield configuration
      else
        raise InlineSvg::Configuration::Invalid.new('Please set configuration options with a block')
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
inline_svg-0.3.0 lib/inline_svg.rb