seven_zip_ruby 1.2.1-x64-mingw32 → 1.2.2-x64-mingw32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c7bfc97460839b982620b9d95aa1f26b08924d94
4
- data.tar.gz: ff5be17cb064e3bc71ca92bb9d6abe31c6ec36d9
3
+ metadata.gz: 26a6ffef7c25b1ccb1be654031511ed9ff08171e
4
+ data.tar.gz: 095383a3d74254e5d03a97e951fea5c9ea8120b8
5
5
  SHA512:
6
- metadata.gz: 1450a3b36d11412ce3c06eb44156ee9d55c74d13f7e786f99f915302e246a630d7c47cb47855f2fd247e17b85f891aa9b132caf115f028376c04b79385a88c1f
7
- data.tar.gz: 5a2da147ee99299f721a60785fa4ac427463f5e9c2e3d8492c62ce8b00c9443e2150c9da65078436b7b4edfc6873ef16b23b1ee4c4fe022a801ae33e5109aa34
6
+ metadata.gz: d908846ba37143df7d77079980d523bd6338fcdbd96b521e56f6d2879ae925bf080a7d56d73f394a9ac3d03771677aa29cb1e62ac6fd40286e5ebb63f53f12ed
7
+ data.tar.gz: d0d3c4be26cc2c647c35eaf434ae21848a56b8c3ffabbf56a507c0528661f84241aeded86275404e247a3f47438d8787924c37fd8b74a292ac6c36846590f051
data/.travis.yml CHANGED
@@ -1,7 +1,7 @@
1
1
  language: ruby
2
2
  rvm:
3
3
  - "2.0.0"
4
- - "2.1.0"
4
+ - "2.1.1"
5
5
  - "rbx"
6
6
  - "ruby-head"
7
7
  matrix:
data/README.md CHANGED
@@ -187,6 +187,8 @@ LGPL and unRAR license. Please refer to LICENSE.txt.
187
187
 
188
188
  ## Releases
189
189
 
190
+ * 1.2.*
191
+ Bug fix.
190
192
  * 1.1.0
191
193
  Raise error when wrong password is specified.
192
194
  * 1.0.0
@@ -102,8 +102,12 @@ module SevenZipRuby
102
102
  szr = self.new
103
103
  szr.open(stream, param)
104
104
  if (block)
105
- block.call(szr)
106
- szr.close
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
- block.call(szr)
139
- szr.close
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
- szr = self.open(stream, opt)
204
- ret = szr.verify
205
- szr.close
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
@@ -1,3 +1,3 @@
1
1
  module SevenZipRuby
2
- VERSION = "1.2.1"
2
+ VERSION = "1.2.2"
3
3
  end
@@ -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 7-Zip files.}
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
 
@@ -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 do |t|
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 do |t|
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
- 10.times do
619
+ 20.times do
620
+ kill_time = rand * diff
620
621
  th = Thread.start{ prc.call }
621
- sleep(rand * diff)
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.1
4
+ version: 1.2.2
5
5
  platform: x64-mingw32
6
6
  authors:
7
7
  - Masamitsu MURASE
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-25 00:00:00.000000000 Z
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 7zip archives. This gem
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 7-Zip files.
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