Class: ActionView::Helpers::AssetTagHelper::JavaScriptSources

Inherits:
AssetCollection show all
Includes:
JavaScriptAsset
Defined in:
lib/action_view/helpers/asset_tag_helper.rb

Constant Summary collapse

EXPANSIONS =
{ :defaults => JAVASCRIPT_DEFAULT_SOURCES.dup }
APPLICATION_JS =
"application".freeze
APPLICATION_FILE =
"application.js".freeze

Constants included from JavaScriptAsset

ActionView::Helpers::AssetTagHelper::JavaScriptAsset::DIRECTORY, ActionView::Helpers::AssetTagHelper::JavaScriptAsset::EXTENSION

Constants inherited from AssetCollection

AssetCollection::Cache, AssetCollection::CacheGuard

Class Method Summary collapse

Instance Method Summary collapse

Methods included from JavaScriptAsset

#directory, #extension, #public_directory

Methods inherited from AssetCollection

create, #initialize, #write_asset_file_contents

Constructor Details

This class inherits a constructor from ActionView::Helpers::AssetTagHelper::AssetCollection

Class Method Details

.expansionsObject



763
764
765
# File 'lib/action_view/helpers/asset_tag_helper.rb', line 763

def self.expansions
  EXPANSIONS
end

Instance Method Details

#expand_sourcesObject



770
771
772
773
774
775
776
777
778
779
# File 'lib/action_view/helpers/asset_tag_helper.rb', line 770

def expand_sources
  if @sources.include?(:all)
    assets = all_asset_files
    ((defaults.dup & assets) + assets).uniq!
  else
    expanded_sources = validate_sources!
    expanded_sources << APPLICATION_JS if include_application?
    expanded_sources
  end
end