Module: Sprockets::Paths

### Home Classes Methods

### In Files

- lib/sprockets/paths.rb

### Methods

- #append_path
- #clear_paths
- #extensions
- #paths
- #prepend_path
- #root

### Class/Module Index

Quicksearch

- Sprockets
- Sprockets::ArgumentError
- Sprockets::Asset
- Sprockets::AssetAttributes
- Sprockets::Base
- Sprockets::BundledAsset
- Sprockets::Cache
- Sprockets::Cache::FileStore
- Sprockets::Caching
- Sprockets::CharsetNormalizer
- Sprockets::CircularDependencyError
- Sprockets::ClosureCompressor
- Sprockets::Compressing
- Sprockets::ContentTypeMismatch
- Sprockets::Context
- Sprockets::DirectiveProcessor
- Sprockets::EcoTemplate
- Sprockets::EjsTemplate
- Sprockets::EncodingError
- Sprockets::EngineError
- Sprockets::Engines
- Sprockets::Environment
- Sprockets::Error
- Sprockets::FileNotFound
- Sprockets::FileOutsidePaths
- Sprockets::Index
- Sprockets::JstProcessor
- Sprockets::Manifest
- Sprockets::Mime
- Sprockets::NotImplementedError
- Sprockets::Paths
- Sprockets::ProcessedAsset
- Sprockets::ProcessedAsset::DependencyFile
- Sprockets::Processing
- Sprockets::Processor
- Sprockets::SafetyColons
- Sprockets::SassCacheStore
- Sprockets::SassCompressor
- Sprockets::SassFunctions
- Sprockets::SassImporter
- Sprockets::SassTemplate
- Sprockets::ScssTemplate
- Sprockets::Server
- Sprockets::StaticAsset
- Sprockets::UglifierCompressor
- Sprockets::UnserializeError
- Sprockets::Utils
- Sprockets::YUICompressor
- Rake
- Rake::SprocketsTask

No matching classes.

# Sprockets::Paths

### Attributes

trail[R]

### Public Instance Methods

append_path(path) click to toggle source

Append a `path` to the `paths` list.

Paths at the beginning of the `Array` have a higher priority.

    # File lib/sprockets/paths.rb, line 32
    def append_path(path)
      @trail.append_path(path)
    end

clear_paths() click to toggle source

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.

    # File lib/sprockets/paths.rb, line 41
    def clear_paths
      @trail.paths.dup.each { |path| @trail.remove_path(path) }
    end

extensions() click to toggle source

Returns an `Array` of extensions.

These extensions maybe omitted from logical path searches.

    # => [".js", ".css", ".coffee", ".sass", ...]

    # File lib/sprockets/paths.rb, line 51
    def extensions
      @trail.extensions.dup
    end

paths() click to toggle source

Returns an `Array` of path `String`s.

These paths will be used for asset logical path lookups.

Note that a copy of the `Array` is returned so mutating will have no affect on the environment. See `append_path`, `prepend_path`, and `clear_paths`.

    # File lib/sprockets/paths.rb, line 18
    def paths
      @trail.paths.dup
    end

prepend_path(path) click to toggle source

Prepend a `path` to the `paths` list.

Paths at the end of the `Array` have the least priority.

    # File lib/sprockets/paths.rb, line 25
    def prepend_path(path)
      @trail.prepend_path(path)
    end

root() click to toggle source

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`)

    # File lib/sprockets/paths.rb, line 7
    def root
      @trail.root.dup
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.