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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # Rakefile for zipit
2
2
 
3
- require "lib/zipit_helper"
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
1
+ 0.3.3
data/bin/zipit CHANGED
@@ -6,7 +6,7 @@ require 'rubygems' unless RUBY_VERSION =~ /1.9.*/
6
6
 
7
7
  $:.unshift(File::join(File::dirname(File::dirname(__FILE__)), "lib"))
8
8
 
9
- require 'zipit_helper'
9
+ require 'zipit'
10
10
 
11
11
  zip_cmd_line ARGV
12
12
 
data/bin/zipit.bat ADDED
@@ -0,0 +1,6 @@
1
+ @ECHO OFF
2
+ IF NOT "%~f0" == "~f0" GOTO :WinNT
3
+ @"ruby.exe" "C:/Ruby/ruby-1.9.1/bin/zipit" %1 %2 %3 %4 %5 %6 %7 %8 %9
4
+ GOTO :EOF
5
+ :WinNT
6
+ @"ruby.exe" "%~dpn0" %*
@@ -1,6 +1,6 @@
1
1
  require 'zip/zip'
2
2
 
3
- class ZipitHelper
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 = ZipitHelper.new
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 => params[0], :dir => params[1],
55
- :global_excludes => ['.svn'], :excludes => ["*.zip"])
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 = ZipitHelper.new
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 => params[:archive], :dir => params[:dir],
63
- :global_excludes => ['.svn'], :excludes => ["*.zip"])
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.1"
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-11}
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
- "lib/zipit_helper.rb",
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
- - 1
9
- version: 0.3.1
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-11 00:00:00 -04:00
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
- - lib/zipit_helper.rb
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