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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 91f7b44889e262c53f68a16bff9ca709503fd8a3
4
- data.tar.gz: 0bdca3000310e5f74b3322aa49d6a5fea1e6acf6
3
+ metadata.gz: b64f9c95fecda653f1723d3a985d7d6489a8f9a0
4
+ data.tar.gz: 3c1977f8570c6c419d68795aaaafba425fe1e111
5
5
  SHA512:
6
- metadata.gz: 689ffdae9d3e90ffa4bee9790c8db0a710fdd96eb9d2b834e934e4d4456804d923923e3eded0f6c67493b0bbfe7698feaf13c8910b0942810f78f9c7d84fcaab
7
- data.tar.gz: 05026822e8d1d3d25a9181f2c47351494b3c6e046ccc01afb0b3e75fca91df9dc9a1d8843d30c09a85cd2fcb76de6266f7b8f49e280f19351719a6c8a9150875
6
+ metadata.gz: 1f9ee360171b74879927d9fca5e9bf81774283dfe92c643b5ba9e47d6868801f0d2ec2bb8f067cc07ba9ee3e1bf8751c7a85ba5108ae44429084076f30409111
7
+ data.tar.gz: c5ae97cec4a7b1cbb4d59b57484919f4673eafddd1d8ece82a355d975f6b74c79594160b2ea57bf988b53de41cb3580b37e44426427c62bfe887e8a6f4dcbf82
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-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