Sha256: 5631e0535d57f571ae8eb026d32c8f3f5606ecc53ee7f454aa5fd0873f5e0029
Contents?: true
Size: 1.01 KB
Versions: 14
Compression:
Stored size: 1.01 KB
Contents
require 'bundler' Bundler.require require 'fileutils' class FoundationAssets BUNDLES = [ "vendor/custom.modernizr.js", "vendor/zepto.js", "vendor/jquery.js", "docs.js", "docs.css", "normalize.css" ] def initialize @env = Sprockets::Environment.new @env.append_path File.expand_path('../../scss', __FILE__) @env.append_path File.expand_path('../css', __FILE__) @env.append_path File.expand_path('../../js', __FILE__) @env.append_path File.expand_path('../js', __FILE__) end def compile assets_path = "public/assets" FileUtils.mkdir_p("#{assets_path}/vendor") BUNDLES.each do |bundle| pth = "#{assets_path}/#{bundle}" File.delete(pth) if File.exists?(pth) code = @env[bundle].to_s File.open(pth, "w") {|f| f.puts code} end end end Stasis.new(File.expand_path('.'), File.expand_path('./public'), {:asset_path => "http://foundation.zurb.com/docs/assets"}).render assets = FoundationAssets.new assets.compile
Version data entries
14 entries across 14 versions & 1 rubygems