Sha256: 20395e9cd6469bd6b292598ddc42c7b3fbddbd8a4841aa368fabcce704d309bf

Contents?: true

Size: 790 Bytes

Versions: 2

Compression:

Stored size: 790 Bytes

Contents

module Gap
    class Copy
        def initialize(sam = Gap::Main)
            @sam = sam
        end

        def copy(dir, basedir, pattern)
            Dir.glob(basedir + "/" + pattern) do |all|
                next if !FileTest.file?(all)
                file = dir + all[basedir.length..-1]
                if @sam.need_update_file?(file, all)
                    @sam.genfile file do 
                        open(all, "rb") do |f|
                            f.read
                        end
                    end
                end
                yield if block_given?
            end
        end

        DEFAULT_COPY = Copy.new
        def self.copy(dir, basedir, pattern)
            DEFAULT_COPY.copy(dir, basedir, pattern)
        end
    end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gap50-0.1.1 lib/gap50/gap/copy.rb
gap50-0.1.0 lib/gap50/gap/copy.rb