Module: Sprockets::Paths
| Relationships & Source Files | |
| Extension / Inclusion / Inheritance Descendants | |
|
Extended In:
| |
|
Included In:
| |
| Super Chains via Extension / Inclusion / Inheritance | |
|
Instance Chain:
|
|
| Defined in: | lib/sprockets/paths.rb |
Constant Summary
Instance Attribute Summary
-
#root
rw
Returns
Environmentroot. -
#root=(path)
rw
private
Internal: Change Environment root.
Instance Method Summary
-
#append_path(path)
Append a
pathto the #paths list. -
#clear_paths
Clear all paths and start fresh.
-
#each_file
Public: Iterate over every file under all load paths.
-
#paths
Returns an
Arrayof pathStrings. -
#prepend_path(path)
Prepend a
pathto the #paths list.
PathUtils - Included
| #absolute_path? | On Windows, ALT_SEPARATOR is \ Delegate to Pathname since the logic gets complex. |
| #atomic_write | Public: Write to a file atomically. |
| #directory? | Public: Like |
| #entries | Public: A version of |
| #file? | Public: Like |
| #find_matching_path_for_extensions | Internal: Match paths in a directory against available extensions. |
| #find_upwards | Internal: Find target basename checking upwards from path. |
| #join | Public: Joins path to base path. |
| #match_path_extname | Internal: Match path extnames against available extensions. |
| #path_extnames | Internal: Get path’s extensions. |
| #path_parents | Internal: Returns all parents for path. |
| #paths_split | Internal: Detect root path and base for file in a set of paths. |
| #relative_path? | Public: Check if path is explicitly relative. |
| #relative_path_from | Public: Get relative path from |
| #set_pipeline | Public: Sets pipeline for path. |
| #split_subpath | Internal: Get relative path for root path and subpath. |
| #stat | Public: Like |
| #stat_directory | Public: Stat all the files under a directory. |
| #stat_sorted_tree | Public: Recursive stat all the files under a directory in alphabetical order. |
| #stat_tree | Public: Recursive stat all the files under a directory. |
Utils - Included
| #concat_javascript_sources | Internal: Accumulate asset source to buffer and append a trailing semicolon if necessary. |
| #dfs | Internal: Post-order Depth-First search algorithm. |
| #dfs_paths | Internal: Post-order Depth-First search algorithm that gathers all paths along the way. |
| #duplicable? | Internal: Check if object can safely be .dup’d. |
| #hash_reassoc | Internal: Duplicate and store key/value on new frozen hash. |
| #hash_reassoc1 | Internal: Duplicate and store key/value on new frozen hash. |
| #module_include | Internal: Inject into target module for the duration of the block. |
| #string_end_with_semicolon? | Internal: Check if string has a trailing semicolon. |
Instance Attribute Details
#root (rw)
Returns Environment root.
All relative paths are expanded with root as its base. To be useful set this to your applications root directory. (Rails.root)
#root=(path) (rw, private)
Internal: Change Environment root.
Only the initializer should change the root.
# File 'lib/sprockets/paths.rb', line 20
def root=(path) self.config = hash_reassoc(config, :root) do File.(path) end end
Instance Method Details
#append_path(path)
Append a path to the #paths list.
Paths at the beginning of the Array have a higher priority.
#clear_paths
Clear all paths and start fresh.
There is no mechanism for reordering paths, so its best to completely wipe the paths list and reappend them in the order you want.
#each_file
Public: Iterate over every file under all load paths.
Returns Enumerator if no block is given.
#paths
Returns an Array of path Strings.
These paths will be used for asset logical path lookups.
# File 'lib/sprockets/paths.rb', line 30
def paths config[:paths] end
#prepend_path(path)
Prepend a path to the #paths list.
Paths at the end of the Array have the least priority.