Sha256: 06d24e6089791c60f4013a3602f2786aecf4fae858a89aa71f9f6bb6712115ca
Contents?: true
Size: 936 Bytes
Versions: 3
Compression:
Stored size: 936 Bytes
Contents
require 'sprockets/base' require 'sprockets/cache/memory_store' require 'sprockets/cached_environment' module Sprockets class Environment < Base # `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) # def initialize(root = ".") initialize_configuration(Sprockets) @root = File.expand_path(root) self.cache = Cache::MemoryStore.new yield self if block_given? end # 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. def cached CachedEnvironment.new(self) end alias_method :index, :cached def find_asset(*args) cached.find_asset(*args) end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
sprockets-3.0.0.beta.6 | lib/sprockets/environment.rb |
sprockets-3.0.0.beta.5 | lib/sprockets/environment.rb |
sprockets-3.0.0.beta.4 | lib/sprockets/environment.rb |