Sha256: 4acb7849bfb95a4c31cb3b672810e1a95618c9463147dbdf3113f9ebc7649ed2

Contents?: true

Size: 444 Bytes

Versions: 28

Compression:

Stored size: 444 Bytes

Contents

module Sinatra
  module AssetPack
    # The base class for all CSS/JS compression engines.
    class Engine
      # Helper for system files.
      # Usage: sys('css', string, "sqwish %f")
      # Returns stdout.
      def sys(type, str, cmd)
        t = Tempfile.new ['', ".#{type}"]
        t.write(str)
        t.close

        output = `#{cmd.gsub('%f', t.path)}`
        FileUtils.rm t

        [output, t.path]
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 3 rubygems

Version Path
sinatra-assetpack-0.1.2 lib/sinatra/assetpack/engine.rb
sinatra-assetpack-0.1.1 lib/sinatra/assetpack/engine.rb
sinatra-assetpack-0.1.0 lib/sinatra/assetpack/engine.rb
sinatra-assetpack-flexible-compression-0.0.1 lib/sinatra/assetpack/engine.rb
sundawg-sinatra-assetpack-fork-0.0.12.pre1 lib/sinatra/assetpack/engine.rb
sinatra-assetpack-0.0.12.pre1 lib/sinatra/assetpack/engine.rb
sinatra-assetpack-0.0.11 lib/sinatra/assetpack/engine.rb
sinatra-assetpack-0.0.10 lib/sinatra/assetpack/engine.rb