Sha256: e213793323ea55a81fa18a010632f90c9a88c4ae8e3dea9953848c1b2107f7c7

Contents?: true

Size: 757 Bytes

Versions: 9

Compression:

Stored size: 757 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|
        # Configure the asset_finder:
        # Only set this when a user-configured asset finder has not been
        # configured already.
        if config.asset_finder.nil?
          # In default Rails apps, this will be a fully operational
          # Sprockets::Environment instance
          config.asset_finder = app.instance_variable_get(:@assets)
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
inline_svg-1.10.0 lib/inline_svg/railtie.rb
inline_svg-1.9.0 lib/inline_svg/railtie.rb
inline_svg-1.8.0 lib/inline_svg/railtie.rb
rails_mini_profiler-0.2.0 vendor/bundle/ruby/3.0.0/gems/inline_svg-1.7.2/lib/inline_svg/railtie.rb
inline_svg-1.7.2 lib/inline_svg/railtie.rb
inline_svg-1.7.1 lib/inline_svg/railtie.rb
inline_svg-1.7.0 lib/inline_svg/railtie.rb
inline_svg-1.6.0 lib/inline_svg/railtie.rb
inline_svg-1.5.2 lib/inline_svg/railtie.rb