Sha256: 6c380cae4d46f8d58d566ec0773adf56f69c28876ecf50dafa2f07690d88fec6

Contents?: true

Size: 798 Bytes

Versions: 7

Compression:

Stored size: 798 Bytes

Contents

module SharingTags
  class Engine < ::Rails::Engine
    isolate_namespace SharingTags

    config.assets.precompile += %w( sharing_tags/icons.js )

    if Rails.env.development?
      config.to_prepare do
        init_config = Rails.root.join('config', 'initializers', 'sharing_tags.rb').to_s
        require_dependency init_config if File.exist?(init_config)
      end
    end

    # optional, without it will call `to_prepend` only when a file changes,
    # not on every request
    config.after_initialize do |app|
      app.config.reload_classes_only_on_change = false if Rails.env.development?

      # In default Rails apps, this will be a fully operational
      # Sprockets::Environment instance
      SharingTags.config.asset_finder = app.instance_variable_get(:@assets)
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
sharing_tags-0.0.18 lib/sharing_tags/engine.rb
sharing_tags-0.0.17 lib/sharing_tags/engine.rb
sharing_tags-0.0.16 lib/sharing_tags/engine.rb
sharing_tags-0.0.15 lib/sharing_tags/engine.rb
sharing_tags-0.0.14 lib/sharing_tags/engine.rb
sharing_tags-0.0.13 lib/sharing_tags/engine.rb
sharing_tags-0.0.12 lib/sharing_tags/engine.rb