Sha256: d7c35385f9043c7036ce5ea649e7464c935e02dfe4915147638d7d5da4444eb2

Contents?: true

Size: 860 Bytes

Versions: 1

Compression:

Stored size: 860 Bytes

Contents

require 'rails/railtie'
module InlineSvg
  class Railtie < ::Rails::Railtie
    initializer "inline_svg.action_view" do |app|
      ActiveSupport.on_load :action_view do
        require "inline_svg/action_view/helpers"
        include InlineSvg::ActionView::Helpers
      end
    end

    config.after_initialize do |app|
      InlineSvg.configure do |config|
        # In default Rails apps, this will be a fully operational
        # Sprockets::Environment instance
        # Only set this when a user-configured asset finder has not been
        # configured already.
        if config.asset_finder.nil?
          if assets = app.instance_variable_get(:@assets)
            config.asset_finder = assets
          elsif defined?(Webpacker)
            config.asset_finder = InlineSvg::WebpackAssetFinder
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
inline_svg-1.5.0 lib/inline_svg/railtie.rb