Sha256: d0e4e7a7d86fcc7470c02d0b8cedc2e79f6df63194d6f2105a46740df9fde667
Contents?: true
Size: 1.04 KB
Versions: 1
Compression:
Stored size: 1.04 KB
Contents
require 'bundler' Bundler.require require 'fileutils' class ModularisAssets 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://modularis.themepile.com/docs/assets"}).render assets = ModularisAssets.new assets.compile
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
modularis-0.0.1 | docs/compile.rb |