seven_zip_ruby 1.2.1-x86-mswin32-100 → 1.2.2-x86-mswin32-100

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a2591f2e4d7e5ffae2721a4fd74b3e3b37b5e396
4
- data.tar.gz: 926dbe103501613ac3a842e1d62fef8928f4210b
3
+ metadata.gz: 2c9893ddbe6b4c8c76c56123b4fcca99a1f54274
4
+ data.tar.gz: a63ac8113882ce75b63c42f6ff48b4273fa7eba0
5
5
  SHA512:
6
- metadata.gz: a420230781f066b54d1d95f5a61c46533a9186e2ded940fcdf137d4bb7dc6273fd94de2db88b1b73bae8a841920d446ef164e60e30d1eb7fba8ef020cd5d779d
7
- data.tar.gz: ef32b145deb0ec70aec3fee472f40bc7c57fe2acec41ad1a370f0a1e6cce792c0fe7de25f2be31901c29580d0d57a8f92d349bc3232fe1d9a65f62e0f51d46e8
6
+ metadata.gz: 8e848a152c81f4daa41708286d953022c6227d7bffa5d4e686b0ab3479019a755be286372076b0ead1a1a84f97aa43fee18c94f7e3efc03e1f81831705547918
7
+ data.tar.gz: 990619d42556d066da0498fa66649442cac4e4ac5188d107152242f48d0a354901f5c0f3aa4526835593d17b2d467ce29d86e3ee2d88148100157b62a55461de
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: x86-mswin32-100
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: []
@@ -101,10 +101,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
101
101
  version: '0'
102
102
  requirements: []
103
103
  rubyforge_project:
104
- rubygems_version: 2.0.3
104
+ rubygems_version: 2.0.14
105
105
  signing_key:
106
106
  specification_version: 4
107
- summary: This is a gem library to read and write 7-Zip files.
107
+ summary: This is a ruby gem library to read and write 7zip files.
108
108
  test_files:
109
109
  - spec/seven_zip_ruby_spec.rb
110
110
  - spec/seven_zip_ruby_spec_helper.rb