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
solvas-jsduck-6.0.0.30539 lib/jsduck/img/writer.rb
solvas-jsduck-6.0.0.9571 lib/jsduck/img/writer.rb
solvas-jsduck-6.0.0.6154 lib/jsduck/img/writer.rb
solvas-jsduck-6.0.0.4021 lib/jsduck/img/writer.rb
solvas-jsduck-6.0.0.2554 lib/jsduck/img/writer.rb
solvas-jsduck-6.0.0.1891 lib/jsduck/img/writer.rb
solvas-jsduck-6.0.0.beta.1888 lib/jsduck/img/writer.rb
jsduck-troopjs-0.0.10 lib/jsduck/img/writer.rb
jsduck-troopjs-0.0.9 lib/jsduck/img/writer.rb
jsduck-troopjs-0.0.8 lib/jsduck/img/writer.rb
jsduck-troopjs-0.0.7 lib/jsduck/img/writer.rb
jsduck-troopjs-0.0.5 lib/jsduck/img/writer.rb
jsduck-troopjs-0.0.4 lib/jsduck/img/writer.rb
jsduck-troopjs-0.0.3 lib/jsduck/img/writer.rb
jsduck-troopjs-0.0.1 lib/jsduck/img/writer.rb
jsduck-6.0.0beta lib/jsduck/img/writer.rb
jsduck-5.3.4 lib/jsduck/img/writer.rb
jsduck-5.3.3 lib/jsduck/img/writer.rb
jsduck-5.3.2 lib/jsduck/img/writer.rb
jsduck-5.3.1 lib/jsduck/img/writer.rb