Sha256: 90caea24d60e3574fb0dce7105bac47b6008ae199e195bf9719b04e853486afa
Contents?: true
Size: 727 Bytes
Versions: 8
Compression:
Stored size: 727 Bytes
Contents
module Trickster class FileCopier < Copier # Shallow copies all files from +from+ with the given extension # # from:: location, relative to @install_root where files are copied from # extension:: extension of files to copy # options:: options to control the copy. Currently recognized keys: # :except:: array of filenames to skip def copy_files(from,extension,options={}) dest_dir = File.join(@destination_root,from) FileUtils.mkdir(dest_dir) unless File.exists?(dest_dir) Dir["#{@install_root}/#{from}/*.#{extension}"].each do |file| next if Array(options[:except]).include?(File.basename(file)) FileUtils.cp file,dest_dir end end end end
Version data entries
8 entries across 8 versions & 1 rubygems