Sha256: 25f876c3d21e093409595c92fe726aaf581b88d3c02489b85073bb79d8d52601

Contents?: true

Size: 1.01 KB

Versions: 1

Compression:

Stored size: 1.01 KB

Contents

require 'bundler'
Bundler.require
require 'fileutils'

class AbstractioAssets

    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://abstractio.themepile.co.uk/docs/assets"}).render
assets = AbstractioAssets.new
assets.compile

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
themepile-abstractio-4.1.7 docs/compile.rb