require 'rubygems' require 'bundler' require 'pathname' require 'logger' require 'fileutils' Bundler.require ROOT = Rails.root LOGGER = Logger.new(STDOUT) BUNDLES = %w( revelry/client.js revelry.css ) BUILD_DIR = ROOT.join("../../build") SOURCE_DIR = ROOT.join("app", "assets") task :standalone => :environment do BUNDLES.each do |bundle| assets = Rails.application.assets.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)) end end