Class: Sprockets::Environment

### Home Classes Methods

### In Files

- lib/sprockets/environment.rb

### Parent

Sprockets::Base

### Methods

- ::new
- #cached
- #find_all_linked_assets
- #find_asset
- #index
- #load

### Class/Module Index

Quicksearch

- Sprockets
- Sprockets::ArgumentError
- Sprockets::Asset
- Sprockets::Autoload
- Sprockets::Base
- Sprockets::Bower
- Sprockets::Bundle
- Sprockets::Cache
- Sprockets::Cache::FileStore
- Sprockets::Cache::GetWrapper
- Sprockets::Cache::HashWrapper
- Sprockets::Cache::MemoryStore
- Sprockets::Cache::NullStore
- Sprockets::Cache::ReadWriteWrapper
- Sprockets::Cache::Wrapper
- Sprockets::CachedEnvironment
- Sprockets::ClosureCompressor
- Sprockets::CoffeeScriptProcessor
- Sprockets::CoffeeScriptTemplate
- Sprockets::Compressing
- Sprockets::Configuration
- Sprockets::ContentTypeMismatch
- Sprockets::Context
- Sprockets::ConversionError
- Sprockets::Dependencies
- Sprockets::DigestUtils
- Sprockets::DirectiveProcessor
- Sprockets::ERBProcessor
- Sprockets::ERBTemplate
- Sprockets::EcoProcessor
- Sprockets::EcoTemplate
- Sprockets::EjsProcessor
- Sprockets::EjsTemplate
- Sprockets::EncodingUtils
- Sprockets::Engines
- Sprockets::Environment
- Sprockets::Error
- Sprockets::FileNotFound
- Sprockets::FileOutsidePaths
- Sprockets::FileReader
- Sprockets::HTTPUtils
- Sprockets::Index
- Sprockets::JstProcessor
- Sprockets::LegacyProcProcessor
- Sprockets::LegacyTiltProcessor
- Sprockets::Loader
- Sprockets::Manifest
- Sprockets::ManifestUtils
- Sprockets::Mime
- Sprockets::NotFound
- Sprockets::NotImplementedError
- Sprockets::PathDependencyUtils
- Sprockets::PathDigestUtils
- Sprockets::PathUtils
- Sprockets::Paths
- Sprockets::Processing
- Sprockets::ProcessorUtils
- Sprockets::Resolve
- Sprockets::SassCompressor
- Sprockets::SassProcessor
- Sprockets::SassProcessor::CacheStore
- Sprockets::SassProcessor::Functions
- Sprockets::SassTemplate
- Sprockets::ScssProcessor
- Sprockets::ScssTemplate
- Sprockets::Server
- Sprockets::Transformers
- Sprockets::URITar
- Sprockets::URIUtils
- Sprockets::UglifierCompressor
- Sprockets::UnloadedAsset
- Sprockets::Utils
- Sprockets::YUICompressor
- Rake
- Rake::SprocketsTask

No matching classes.

# Sprockets::Environment

### Public Class Methods

new(root = ".") click to toggle source

`Environment` should initialized with your application's root directory. This should be the same as your Rails or Rack root.

    env = Environment.new(Rails.root)

    # File lib/sprockets/environment.rb, line 12
    def initialize(root = ".")
      initialize_configuration(Sprockets)
      self.root = root
      self.cache = Cache::MemoryStore.new
      yield self if block_given?
    end

### Public Instance Methods

cached() click to toggle source

Returns a cached version of the environment.

All its file system calls are cached which makes `cached` much faster. This behavior is ideal in production since the file system only changes between deploys.

    # File lib/sprockets/environment.rb, line 24
    def cached
      CachedEnvironment.new(self)
    end

Also aliased as: index
find_all_linked_assets(*args, &block) click to toggle source

    # File lib/sprockets/environment.rb, line 33
    def find_all_linked_assets(*args, &block)
      cached.find_all_linked_assets(*args, &block)
    end

find_asset(*args) click to toggle source

    # File lib/sprockets/environment.rb, line 29
    def find_asset(*args)
      cached.find_asset(*args)
    end

index() click to toggle source
Alias for: cached
load(*args) click to toggle source

    # File lib/sprockets/environment.rb, line 37
    def load(*args)
      cached.load(*args)
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.