Sha256: 5e19cfb6aded7ddb61d6831436dacbdbc920c430f82e3330b5553de113af84fa

Contents?: true

Size: 502 Bytes

Versions: 27

Compression:

Stored size: 502 Bytes

Contents

require 'sprockets/exporters/base'

module Sprockets
  module Exporters
    # Writes a an asset file to disk
    class FileExporter < Exporters::Base
      def skip?(logger)
        if ::File.exist?(target)
          logger.debug "Skipping #{ target }, already exists"
          true
        else
          logger.info "Writing #{ target }"
          false
        end
      end

      def call
        write(target) do |file|
          file.write(asset.source)
        end
      end
    end
  end
end

Version data entries

27 entries across 27 versions & 9 rubygems

Version Path
sprockets-4.0.0.beta10 lib/sprockets/exporters/file_exporter.rb
sprockets-4.0.0.beta9 lib/sprockets/exporters/file_exporter.rb
sprockets-4.0.0.beta8 lib/sprockets/exporters/file_exporter.rb
sprockets-4.0.0.beta7 lib/sprockets/exporters/file_exporter.rb
sprockets-4.0.0.beta6 lib/sprockets/exporters/file_exporter.rb
sprockets-4.0.0.beta5 lib/sprockets/exporters/file_exporter.rb
sprockets-4.0.0.beta4 lib/sprockets/exporters/file_exporter.rb