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
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/sprockets-4.2.1/lib/sprockets/exporters/file_exporter.rb
tinymce-rails-7.1.2 vendor/bundle/ruby/3.3.0/gems/sprockets-4.2.1/lib/sprockets/exporters/file_exporter.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/sprockets-4.1.1/lib/sprockets/exporters/file_exporter.rb
sprockets-4.2.1 lib/sprockets/exporters/file_exporter.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/sprockets-4.1.1/lib/sprockets/exporters/file_exporter.rb
sprockets-4.2.0 lib/sprockets/exporters/file_exporter.rb
sprockets-4.1.1 lib/sprockets/exporters/file_exporter.rb
sprockets-4.1.0 lib/sprockets/exporters/file_exporter.rb
sprockets-4.0.3 lib/sprockets/exporters/file_exporter.rb
date_n_time_picker_activeadmin-0.1.2 vendor/bundle/ruby/2.6.0/gems/sprockets-4.0.2/lib/sprockets/exporters/file_exporter.rb
date_n_time_picker_activeadmin-0.1.1 vendor/bundle/ruby/2.6.0/gems/sprockets-4.0.2/lib/sprockets/exporters/file_exporter.rb
rails_mini_profiler-0.2.0 vendor/bundle/ruby/3.0.0/gems/sprockets-4.0.2/lib/sprockets/exporters/file_exporter.rb
sprockets-4.0.2 lib/sprockets/exporters/file_exporter.rb
sprockets-4.0.1 lib/sprockets/exporters/file_exporter.rb
argon-1.3.1 vendor/bundle/ruby/2.7.0/gems/sprockets-4.0.0/lib/sprockets/exporters/file_exporter.rb
symbolic_enum-1.1.5 vendor/bundle/ruby/2.7.0/gems/sprockets-4.0.0/lib/sprockets/exporters/file_exporter.rb
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/sprockets-4.0.0/lib/sprockets/exporters/file_exporter.rb
zuora_connect_ui-0.9.2 vendor/ruby/2.6.0/gems/sprockets-4.0.0/lib/sprockets/exporters/file_exporter.rb
zuora_connect_ui-0.9.1 vendor/ruby/2.6.0/gems/sprockets-4.0.0/lib/sprockets/exporters/file_exporter.rb
sprockets-4.0.0 lib/sprockets/exporters/file_exporter.rb