Sha256: c11cf9dd12a6593b17da2a639ea30a4d8db454352159518877ab66584904d6a9

Contents?: true

Size: 770 Bytes

Versions: 4

Compression:

Stored size: 770 Bytes

Contents

module ActionView::Helpers::AssetTagHelper
  def expand_javascript_sources_with_engine_assets(sources, recursive = false)
    if sources.include?(:all)
      result = (determine_source(:defaults, @@javascript_expansions).dup | expand_javascript_sources_without_engine_assets(sources, recursive))
      result.map! { |entry| entry =~ /\.js$/ ? entry : "#{entry}.js" }
      return result.uniq
    else
      raise NotImplementedError
    end
  end
  alias_method_chain :expand_javascript_sources, :engine_assets

  def asset_file_path_with_engine_assets(path)
    primary = asset_file_path_without_engine_assets(path)
    return primary if File.exist?(primary)

    EngineAssets::PublicLocator.locate(path)
  end
  alias_method_chain :asset_file_path, :engine_assets
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
engine-assets-0.4.2 lib/engine_assets/extensions/rails/assets.rb
engine-assets-0.4.1 lib/engine_assets/extensions/rails/assets.rb
engine-assets-0.4.0 lib/engine_assets/extensions/rails/assets.rb
engine-assets-0.3.3 lib/engine_assets/extensions/rails/assets.rb