Sha256: cede5fe8e4d52f4440a0af33dd79323e67e105a9f3e2921ad9dc3a3ef2bcb159

Contents?: true

Size: 425 Bytes

Versions: 4

Compression:

Stored size: 425 Bytes

Contents

module Pieces
  class StyleCompiler
    attr_reader :path

    def initialize(config = {})
      @path = config[:path] || Dir.pwd
    end

    def compile(files)
      files.merge('compiled.css' => { contents: '', type: 'css' }).tap do |files|
        Dir["#{path}/app/views/*/*.{css,scss,sass,less}"].each do |file|
          files['compiled.css'][:contents] << Tilt.new(file).render
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
pieces-0.3.3 lib/pieces/compilers/style_compiler.rb
pieces-0.3.2 lib/pieces/compilers/style_compiler.rb
pieces-0.3.1 lib/pieces/compilers/style_compiler.rb
pieces-0.3.0 lib/pieces/compilers/style_compiler.rb