zipit 0.3.1 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +2 -2
- data/VERSION +1 -1
- data/bin/zipit +1 -1
- data/bin/zipit.bat +6 -0
- data/lib/{zipit_helper.rb → zipit.rb} +14 -8
- data/zipit.gemspec +5 -3
- metadata +6 -4
data/Rakefile
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Rakefile for zipit
|
2
2
|
|
3
|
-
require "lib/
|
3
|
+
require "lib/zipit"
|
4
4
|
|
5
5
|
task :default => :zip
|
6
6
|
|
@@ -17,7 +17,7 @@ begin
|
|
17
17
|
gemspec.email = "alexander.shvets@gmail.com"
|
18
18
|
gemspec.homepage = "http://github.com/shvets/zipit"
|
19
19
|
gemspec.authors = ["Alexander Shvets"]
|
20
|
-
gemspec.files = FileList["CHANGES", "zipit.gemspec", "Rakefile", "README", "VERSION", "lib/**/*"]
|
20
|
+
gemspec.files = FileList["CHANGES", "zipit.gemspec", "Rakefile", "init.rb", "README", "VERSION", "lib/**/*", "bin/**/*"]
|
21
21
|
gemspec.add_dependency "rubyzip", ">= 0.9.4"
|
22
22
|
gemspec.executables = ['zipit']
|
23
23
|
gemspec.requirements = ["none"]
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.3
|
data/bin/zipit
CHANGED
data/bin/zipit.bat
ADDED
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'zip/zip'
|
2
2
|
|
3
|
-
class
|
3
|
+
class Zipit
|
4
4
|
def create_zip_file params
|
5
5
|
file_name = params[:file_name]
|
6
6
|
dir = params[:dir]
|
@@ -40,7 +40,7 @@ class ZipitHelper
|
|
40
40
|
|
41
41
|
def match? name, list
|
42
42
|
list.each do |pattern|
|
43
|
-
return true if File.fnmatch(pattern, name)
|
43
|
+
return true if File.fnmatch(pattern, name) or name =~ /^#{pattern}/
|
44
44
|
end
|
45
45
|
|
46
46
|
false
|
@@ -48,17 +48,23 @@ class ZipitHelper
|
|
48
48
|
end
|
49
49
|
|
50
50
|
def zip_cmd_line params
|
51
|
-
zipit =
|
51
|
+
zipit = Zipit.new
|
52
|
+
|
53
|
+
archive = params[0].nil? ? "default.zip" : params[0]
|
54
|
+
dir = params[1].nil? ? "." : params[1]
|
52
55
|
|
53
56
|
zipit.create_zip_file(
|
54
|
-
:file_name =>
|
55
|
-
:global_excludes => ['.svn'], :excludes => [
|
57
|
+
:file_name => archive, :dir => dir,
|
58
|
+
:global_excludes => ['.svn', '.git'], :excludes => [archive])
|
56
59
|
end
|
57
60
|
|
58
61
|
def zip params
|
59
|
-
zipit =
|
62
|
+
zipit = Zipit.new
|
63
|
+
|
64
|
+
archive = params[:archive].nil? ? "default.zip" : params[:archive]
|
65
|
+
dir = params[:dir].nil? ? "." : params[:dir]
|
60
66
|
|
61
67
|
zipit.create_zip_file(
|
62
|
-
:file_name =>
|
63
|
-
:global_excludes => ['.svn'], :excludes => [
|
68
|
+
:file_name => archive, :dir => dir,
|
69
|
+
:global_excludes => ['.svn', '.git'], :excludes => [archive])
|
64
70
|
end
|
data/zipit.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{zipit}
|
8
|
-
s.version = "0.3.
|
8
|
+
s.version = "0.3.3"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Alexander Shvets"]
|
12
|
-
s.date = %q{2010-05-
|
12
|
+
s.date = %q{2010-05-12}
|
13
13
|
s.default_executable = %q{zipit}
|
14
14
|
s.description = %q{Rake helper for zipping/unzipping project files.}
|
15
15
|
s.email = %q{alexander.shvets@gmail.com}
|
@@ -22,7 +22,9 @@ Gem::Specification.new do |s|
|
|
22
22
|
"README",
|
23
23
|
"Rakefile",
|
24
24
|
"VERSION",
|
25
|
-
"
|
25
|
+
"bin/zipit",
|
26
|
+
"bin/zipit.bat",
|
27
|
+
"lib/zipit.rb",
|
26
28
|
"zipit.gemspec"
|
27
29
|
]
|
28
30
|
s.homepage = %q{http://github.com/shvets/zipit}
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 3
|
8
|
-
-
|
9
|
-
version: 0.3.
|
8
|
+
- 3
|
9
|
+
version: 0.3.3
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Alexander Shvets
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-05-
|
17
|
+
date: 2010-05-12 00:00:00 -04:00
|
18
18
|
default_executable: zipit
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -44,7 +44,9 @@ files:
|
|
44
44
|
- README
|
45
45
|
- Rakefile
|
46
46
|
- VERSION
|
47
|
-
-
|
47
|
+
- bin/zipit
|
48
|
+
- bin/zipit.bat
|
49
|
+
- lib/zipit.rb
|
48
50
|
- zipit.gemspec
|
49
51
|
has_rdoc: true
|
50
52
|
homepage: http://github.com/shvets/zipit
|