Take the tour ×  I'm trying to utilize Sprockets on a non-
Rails/Rack project and I came across a how-to guide by Simone
Carletti  I have my project setup like so:    source
"http://rubygems.org"  gem 'sass' gem 'sprockets'   require
'rubygems' require 'bundler' require 'pathname' require 'logger'
require 'fileutils'   ROOT        =
Pathname(File.dirname(__FILE__)) LOGGER      =
Logger.new(STDOUT) BUNDLES     = %w( all.css all.js ) BUILD_DIR
= ROOT.join("build") SOURCE_DIR  = ROOT.join("src")  task
:compile => :cleanup do   sprockets =
Sprockets::Environment.new(ROOT) do |env|     env.logger =
LOGGER     BUNDLES.each do |bundle|     assets =
sprockets.find_asset(bundle)     prefix, basename =
assets.pathname.to_s.split('/')[-2..-1]     FileUtils.mkpath
BUILD_DIR.join(prefix)
assets.write_to(BUILD_DIR.join(prefix, basename))
assets.to_a.each do |asset|       # strip
filename.css.foo.bar.css multiple extensions       realname =
asset.pathname.basename.to_s.split(".")[0..1].join(".")
asset.write_