Sha256: 9091fdb4fbaacf2cfe24381b28ae411dc60e996fa7f4b6e46aa7e6e82a7aa4d8

Contents?: true

Size: 603 Bytes

Versions: 40

Compression:

Stored size: 603 Bytes

Contents

require "jsduck/logger"
require "fileutils"

module JsDuck
  module Img

    # Copies images to destination directory.
    class Writer
      # Takes an array of image records retrieved from
      # Img::Dir#all_used or Img::DirSet#all_used and copies all of
      # them to given output directory.
      def self.copy(images, output_dir)
        images.each do |img|
          dest = File.join(output_dir, img[:filename])
          Logger.log("Copying image", dest)
          FileUtils.makedirs(File.dirname(dest))
          FileUtils.cp(img[:full_path], dest)
        end
      end
    end

  end
end

Version data entries

40 entries across 40 versions & 3 rubygems

Version Path
jsduck-5.3.0 lib/jsduck/img/writer.rb
jsduck-5.2.0 lib/jsduck/img/writer.rb
jsduck-5.1.0 lib/jsduck/img/writer.rb
jsduck-5.0.1 lib/jsduck/img/writer.rb
jsduck-5.0.0 lib/jsduck/img/writer.rb
jsduck-5.0.0.beta5 lib/jsduck/img/writer.rb
jsduck-5.0.0.beta4 lib/jsduck/img/writer.rb
jsduck-4.10.4 lib/jsduck/img/writer.rb
jsduck-5.0.0.beta3 lib/jsduck/img/writer.rb
jsduck-4.10.3 lib/jsduck/img/writer.rb
jsduck-4.10.2 lib/jsduck/img/writer.rb
jsduck-4.10.1 lib/jsduck/img/writer.rb
jsduck-4.10.0 lib/jsduck/img/writer.rb
jsduck-4.9.0 lib/jsduck/img/writer.rb
jsduck-4.8.0 lib/jsduck/img/writer.rb
jsduck-5.0.0.beta2 lib/jsduck/img/writer.rb
jsduck-4.7.1 lib/jsduck/img/writer.rb
jsduck-4.7.0 lib/jsduck/img/writer.rb
jsduck-5.0.0.beta01 lib/jsduck/img/writer.rb
jsduck-4.6.2 lib/jsduck/img/writer.rb