zipping 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/VERSION +1 -1
- data/lib/zipping/version.rb +1 -1
- data/lib/zipping.rb +6 -5
- data/zipping.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9df3e0d3ed5925494133de2e8a1d113f78cd17ca
|
4
|
+
data.tar.gz: 66d6eb3e9dac4b73ac732879a393dc53eea1f401
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0353b2fc64bcc220fa8be971730e510097d522beaff69de9b45c34ed5cf61d0a3800e437659166e8f7cb44b5768855c35418c059b34570464151318d9a3c49c7
|
7
|
+
data.tar.gz: f865c6fc3ce47ebde3a158f0ed9d844802c47cd770b0ddb00223631339fffd4c96c2ce2f4d98afb806d13027dc82995ff61eee3657d02f0e7b92df8721f5ac91
|
data/README.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
zipping
|
2
2
|
=======
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/zipping.png)](http://badge.fury.io/rb/zipping)
|
3
4
|
|
4
5
|
This gem is for compressing files as a zip and outputting to a stream (or a stream-like interface object). The output to a stream proceeds little by little, as files are compressed.
|
5
6
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.2
|
data/lib/zipping/version.rb
CHANGED
data/lib/zipping.rb
CHANGED
@@ -103,7 +103,8 @@ module Zipping
|
|
103
103
|
return nil unless path.is_a?(String) && File.exists?(path)
|
104
104
|
ret = {
|
105
105
|
:path => path,
|
106
|
-
:name => File.basename(path)
|
106
|
+
:name => File.basename(path),
|
107
|
+
:time => Time.now
|
107
108
|
}
|
108
109
|
end
|
109
110
|
|
@@ -173,7 +174,7 @@ module Zipping
|
|
173
174
|
# Pack file entities and output to stream. Directory entities are not packed but stored.
|
174
175
|
def pack_file_entities(o = @o, files = @f, dir = @current_dir, dirs = @pending_dirs, data_positions = @dp, encoding = @e, file_division_size = @s)
|
175
176
|
files.each do |file|
|
176
|
-
next unless file.is_a?(Hash) && file[:path]
|
177
|
+
next unless file.is_a?(Hash) && file[:path]
|
177
178
|
|
178
179
|
f = file[:path]
|
179
180
|
if File.directory? f
|
@@ -424,11 +425,11 @@ module Zipping
|
|
424
425
|
next
|
425
426
|
end
|
426
427
|
elsif file.is_a? Hash
|
427
|
-
next unless file[:path]
|
428
|
+
next unless file[:path] && file[:path].is_a?(String)
|
428
429
|
entry = file
|
429
430
|
path = entry[:path]
|
430
|
-
entry[:name] = File.basename(path) unless entry[:name]
|
431
|
-
entry[:time] = File.mtime(path) unless entry[:time]
|
431
|
+
entry[:name] = File.basename(path) unless entry[:name] && entry[:name].is_a?(String)
|
432
|
+
entry[:time] = File.mtime(path) unless entry[:time] && entry[:time].is_a?(Time)
|
432
433
|
else
|
433
434
|
next
|
434
435
|
end
|
data/zipping.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ["info@nekojarashi.com.com"]
|
11
11
|
spec.description = "This gem is for compressing files as a zip and outputting to a stream (or a stream-like interface object). The output to a stream proceeds little by little, as files are compressed."
|
12
12
|
spec.summary = "Compress files as a zip and output it to a stream."
|
13
|
-
spec.homepage = "
|
13
|
+
spec.homepage = "https://github.com/nekojarashi/zipping"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files`.split($/)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zipping
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shuntaro Shitasako
|
@@ -88,7 +88,7 @@ files:
|
|
88
88
|
- spec/spec_helper.rb
|
89
89
|
- spec/zipping_spec.rb
|
90
90
|
- zipping.gemspec
|
91
|
-
homepage:
|
91
|
+
homepage: https://github.com/nekojarashi/zipping
|
92
92
|
licenses:
|
93
93
|
- MIT
|
94
94
|
metadata: {}
|