Class: Raykit::Zip

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

Instance Method Summary collapse

Constructor Details

#initialize(filename) ⇒ Zip

Returns a new instance of Zip.



9
10
11
12
13
14
15
# File 'lib/raykit/zip.rb', line 9

def initialize(filename)
    @filename = filename
    @source_dir = Dir.pwd
    @include_globs=Array::new
    @exclude_globs=Array::new
    self
end

Instance Method Details

#exclude_glob(glob) ⇒ Object



27
28
29
30
# File 'lib/raykit/zip.rb', line 27

def exclude_glob(glob)
    @exclude_globs << glob
    self
end

#include_glob(glob) ⇒ Object



22
23
24
25
# File 'lib/raykit/zip.rb', line 22

def include_glob(glob)
    @include_globs << glob
    self
end

#source_dir(dir) ⇒ Object



17
18
19
20
# File 'lib/raykit/zip.rb', line 17

def source_dir(dir)
    @source_dir=dir
    self
end

#zipObject



32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/raykit/zip.rb', line 32

def zip
    path = File.dirname(@filename)
    if !Dir.exists?(path)
        FileUtils.mkdir_p(path)
    end

    Dir.chdir(@source_dir) do
        include_files=Array::new
        @include_globs.each{|include_glob|

        }
    end
end