Class: Raykit::FileSystem

Inherits:
Object
  • Object
show all
Defined in:
lib/raykit/filesystem.rb

Class Method Summary collapse

Class Method Details

.copy_files(source_dir, target_dir, glob_pattern) ⇒ Object



3
4
5
6
7
8
9
10
11
12
# File 'lib/raykit/filesystem.rb', line 3

def self.copy_files(source_dir, target_dir, glob_pattern)
  FileUtils.mkdir_p(target_dir) if !Dir.exist?(target_dir)
  Dir.chdir(source_dir) do
    Dir.glob("*.{exe,dll}").each { |f|
      dest = "#{target_dir}/#{f}"
      puts "  copying #{f} to #{dest}"
      FileUtils.cp(f, dest)
    }
  end
end