seven_zip_ruby 1.2.1-x86-mingw32 → 1.2.2-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/README.md +2 -0
- data/lib/seven_zip_ruby/seven_zip_reader.rb +25 -8
- data/lib/seven_zip_ruby/version.rb +1 -1
- data/seven_zip_ruby.gemspec +2 -2
- data/spec/seven_zip_ruby_spec.rb +10 -10
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b64f9c95fecda653f1723d3a985d7d6489a8f9a0
|
4
|
+
data.tar.gz: 3c1977f8570c6c419d68795aaaafba425fe1e111
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f9ee360171b74879927d9fca5e9bf81774283dfe92c643b5ba9e47d6868801f0d2ec2bb8f067cc07ba9ee3e1bf8751c7a85ba5108ae44429084076f30409111
|
7
|
+
data.tar.gz: c5ae97cec4a7b1cbb4d59b57484919f4673eafddd1d8ece82a355d975f6b74c79594160b2ea57bf988b53de41cb3580b37e44426427c62bfe887e8a6f4dcbf82
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -102,8 +102,12 @@ module SevenZipRuby
|
|
102
102
|
szr = self.new
|
103
103
|
szr.open(stream, param)
|
104
104
|
if (block)
|
105
|
-
|
106
|
-
|
105
|
+
begin
|
106
|
+
block.call(szr)
|
107
|
+
szr.close
|
108
|
+
ensure
|
109
|
+
szr.close_file
|
110
|
+
end
|
107
111
|
else
|
108
112
|
szr
|
109
113
|
end
|
@@ -135,8 +139,12 @@ module SevenZipRuby
|
|
135
139
|
szr = self.new
|
136
140
|
szr.open_file(filename, param)
|
137
141
|
if (block)
|
138
|
-
|
139
|
-
|
142
|
+
begin
|
143
|
+
block.call(szr)
|
144
|
+
szr.close
|
145
|
+
ensure
|
146
|
+
szr.close_file
|
147
|
+
end
|
140
148
|
else
|
141
149
|
szr
|
142
150
|
end
|
@@ -200,9 +208,14 @@ module SevenZipRuby
|
|
200
208
|
# # => true/false
|
201
209
|
# end
|
202
210
|
def verify(stream, opt = {})
|
203
|
-
|
204
|
-
|
205
|
-
|
211
|
+
ret = false
|
212
|
+
begin
|
213
|
+
self.open(stream, opt) do |szr|
|
214
|
+
ret = szr.verify
|
215
|
+
end
|
216
|
+
rescue
|
217
|
+
ret = false
|
218
|
+
end
|
206
219
|
return ret
|
207
220
|
end
|
208
221
|
end
|
@@ -248,8 +261,12 @@ module SevenZipRuby
|
|
248
261
|
|
249
262
|
def close
|
250
263
|
close_impl
|
264
|
+
close_file
|
265
|
+
end
|
266
|
+
|
267
|
+
def close_file # :nodoc:
|
251
268
|
if (@stream)
|
252
|
-
@stream.close
|
269
|
+
@stream.close rescue nil
|
253
270
|
@stream = nil
|
254
271
|
end
|
255
272
|
end
|
data/seven_zip_ruby.gemspec
CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = SevenZipRuby::VERSION
|
9
9
|
spec.authors = ["Masamitsu MURASE"]
|
10
10
|
spec.email = ["masamitsu.murase@gmail.com"]
|
11
|
-
spec.description = %q{SevenZipRuby is a gem library to read and write 7zip archives. This gem library calls official 7z.dll internally.}
|
12
|
-
spec.summary = %q{This is a gem library to read and write
|
11
|
+
spec.description = %q{SevenZipRuby (seven_zip_ruby) is a ruby gem library to read and write 7zip archives. This gem library calls official 7z.dll internally.}
|
12
|
+
spec.summary = %q{This is a ruby gem library to read and write 7zip files.}
|
13
13
|
spec.homepage = "https://github.com/masamitsu-murase/seven_zip_ruby"
|
14
14
|
spec.license = "LGPL + unRAR"
|
15
15
|
|
data/spec/seven_zip_ruby_spec.rb
CHANGED
@@ -139,6 +139,11 @@ describe SevenZipRuby do
|
|
139
139
|
|
140
140
|
expect(SevenZipRuby::SevenZipReader.verify(StringIO.new(data))).to eq true
|
141
141
|
|
142
|
+
data_org = data[-1]
|
143
|
+
data[-1] = 0x01.chr # This highly dependes on the current test binary.
|
144
|
+
expect(SevenZipRuby::SevenZipReader.verify(StringIO.new(data))).to eq false
|
145
|
+
data[-1] = data_org
|
146
|
+
|
142
147
|
data[0x27] = 0xEB.chr # This highly dependes on the current test binary.
|
143
148
|
expected = [ :DataError, :DataError, :DataError, :DataError, :DataError, :DataError, :DataError, true, true, true, true, true ]
|
144
149
|
SevenZipRuby::SevenZipReader.open(StringIO.new(data)) do |szr|
|
@@ -179,9 +184,7 @@ describe SevenZipRuby do
|
|
179
184
|
end
|
180
185
|
th_list.push(th)
|
181
186
|
end
|
182
|
-
th_list.each
|
183
|
-
t.join
|
184
|
-
end
|
187
|
+
th_list.each(&:join)
|
185
188
|
end
|
186
189
|
|
187
190
|
|
@@ -512,7 +515,6 @@ describe SevenZipRuby do
|
|
512
515
|
|
513
516
|
example "run in multi threads" do
|
514
517
|
th_list = []
|
515
|
-
mutex = Mutex.new
|
516
518
|
100.times do
|
517
519
|
th = Thread.new do
|
518
520
|
stream = StringIO.new
|
@@ -523,9 +525,7 @@ describe SevenZipRuby do
|
|
523
525
|
end
|
524
526
|
th_list.push(th)
|
525
527
|
end
|
526
|
-
th_list.each
|
527
|
-
t.join
|
528
|
-
end
|
528
|
+
th_list.each(&:join)
|
529
529
|
end
|
530
530
|
|
531
531
|
if (SevenZipRubySpecHelper.processor_count && SevenZipRubySpecHelper.processor_count > 1)
|
@@ -616,11 +616,11 @@ describe SevenZipRuby do
|
|
616
616
|
th.join
|
617
617
|
diff = Time.now - start
|
618
618
|
|
619
|
-
|
619
|
+
20.times do
|
620
|
+
kill_time = rand * diff
|
620
621
|
th = Thread.start{ prc.call }
|
621
|
-
sleep(
|
622
|
+
sleep(kill_time)
|
622
623
|
expect{ th.kill }.not_to raise_error # Thread can be killed.
|
623
|
-
sleep diff*2 # Workaround. When some threads of SZR are running and killed, SEGV sometimes occurs...
|
624
624
|
end
|
625
625
|
end
|
626
626
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: seven_zip_ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: x86-mingw32
|
6
6
|
authors:
|
7
7
|
- Masamitsu MURASE
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-04-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -52,8 +52,8 @@ dependencies:
|
|
52
52
|
- - '>='
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
-
description: SevenZipRuby is a gem library to read and write
|
56
|
-
library calls official 7z.dll internally.
|
55
|
+
description: SevenZipRuby (seven_zip_ruby) is a ruby gem library to read and write
|
56
|
+
7zip archives. This gem library calls official 7z.dll internally.
|
57
57
|
email:
|
58
58
|
- masamitsu.murase@gmail.com
|
59
59
|
executables: []
|
@@ -103,7 +103,7 @@ rubyforge_project:
|
|
103
103
|
rubygems_version: 2.0.14
|
104
104
|
signing_key:
|
105
105
|
specification_version: 4
|
106
|
-
summary: This is a gem library to read and write
|
106
|
+
summary: This is a ruby gem library to read and write 7zip files.
|
107
107
|
test_files:
|
108
108
|
- spec/seven_zip_ruby_spec.rb
|
109
109
|
- spec/seven_zip_ruby_spec_helper.rb
|