class Sprockets::Railtie

def self.build_manifest(app)

def self.build_manifest(app)
  config = app.config
  path = File.join(config.paths['public'].first, config.assets.prefix)
  Sprockets::Manifest.new(app.assets, path, config.assets.manifest)
end

def build_environment(app, initialized = nil)

def build_environment(app, initialized = nil)
  initialized = app.initialized? if initialized.nil?
  unless initialized
    ::Rails.logger.warn "Application uninitialized: Try calling YourApp::Application.initialize!"
  end
  env = Sprockets::Environment.new(app.root.to_s)
  config = app.config
  # Run app.assets.configure blocks
  config.assets._blocks.each do |block|
    block.call(env)
  end
  # Set compressors after the configure blocks since they can
  # define new compressors and we only accept existent compressors.
  env.js_compressor  = config.assets.js_compressor
  env.css_compressor = config.assets.css_compressor
  # No more configuration changes at this point.
  # With cache classes on, Sprockets won't check the FS when files
  # change. Preferable in production when the FS only changes on
  # deploys when the app restarts.
  if config.cache_classes
    env = env.cached
  end
  env
end