archive-zip 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 59daa5f87eab1ea370009ef382698306f6e7640d
4
+ data.tar.gz: dc0a201e3f195cd5e4e2cd3ee969a3714b8269b9
5
+ SHA512:
6
+ metadata.gz: 2ce65d15084aa253f08de57da4d766df70aeffcc4f97d093f1ef3ea94b9291c93dd99fc2472216ac601d1341d134a8af43baf0646224cce4a65bcc22fce0617b
7
+ data.tar.gz: 2f9e2aeb4b470d880ecb8e1ade69fd5a9b2ea0eb2cf74cc7dccef5275ba224b1e0cae74b3784c8cec1ce306707fa587226174da0141f8a5bc382d5aee68e18a6
data/NEWS CHANGED
@@ -6,6 +6,25 @@ detailed information is available in the rest of the documentation.
6
6
  <b>NOTE:</b> Date stamps in the following entries are in YYYY/MM/DD format.
7
7
 
8
8
 
9
+ == v0.6.0 (2013/03/24)
10
+
11
+ === Fixes
12
+
13
+ * Only define Zlib constants when they are not already defined.
14
+ * Fixes constant redefinition warnings under MRI 2.0.0-p0.
15
+ * Force Zlib::ZWriter and Zlib::ZReader #checksum methods to return nil for raw
16
+ streams.
17
+ * The behavior of the underlying Zlib::Deflate and Zlib::Inflate classes'
18
+ #adler methods appear inconsistent for raw streams and really aren't
19
+ necessary in this case anyway.
20
+
21
+ === Notes
22
+
23
+ * Broke backward compatibility with the behavior of Zlib::ZWriter#checksum and
24
+ Zlib::ZReader#checksum when working with raw streams.
25
+ * This should not affect direct users of Archive::Zip because the checksum
26
+ methods of those classes are never used.
27
+
9
28
  == v0.5.0 (2012/03/01)
10
29
 
11
30
  === Fixes
@@ -5,17 +5,20 @@ require 'zlib'
5
5
  require 'archive/support/io-like'
6
6
 
7
7
  module Zlib # :nodoc:
8
- if ! const_defined?(:MAX_WBITS) then
9
- MAX_WBITS = Deflate::MAX_WBITS
10
- end
8
+ # The maximum size of the zlib history buffer. Note that zlib allows larger
9
+ # values to enable different inflate modes. See Zlib::Inflate.new for details.
10
+ # Provided here only for Ruby versions that do not provide it.
11
+ MAX_WBITS = Deflate::MAX_WBITS unless const_defined?(:MAX_WBITS)
11
12
 
12
13
  # A deflate strategy which limits match distances to 1, also known as
13
- # run-length encoding.
14
- RLE = 3
14
+ # run-length encoding. Provided here only for Ruby versions that do not
15
+ # provide it.
16
+ RLE = 3 unless const_defined?(:RLE)
15
17
 
16
18
  # A deflate strategy which does not use dynamic Huffman codes, allowing for a
17
- # simpler decoder to be used to inflate.
18
- FIXED = 4
19
+ # simpler decoder to be used to inflate. Provided here only for Ruby versions
20
+ # that do not provide it.
21
+ FIXED = 4 unless const_defined?(:FIXED)
19
22
 
20
23
  # Zlib::ZWriter is a writable, IO-like object (includes IO::Like) which wraps
21
24
  # other writable, IO-like objects in order to facilitate writing data to those
@@ -85,7 +88,7 @@ module Zlib # :nodoc:
85
88
  #
86
89
  # Finally, negating the base value of _window_bits_ indicates that a raw
87
90
  # zlib stream is to be produced without any header or trailer. In this case
88
- # the checksum method of this object will always return <tt>1</tt>. This is
91
+ # the checksum method of this object will always return <tt>nil</tt>. This is
89
92
  # for use with other formats that use the deflate compressed data format
90
93
  # such as zip. Such formats should provide their own check values.
91
94
  #
@@ -161,6 +164,7 @@ module Zlib # :nodoc:
161
164
  # processed, so calling #flush prior to calling this method may be necessary
162
165
  # for an accurate checksum.
163
166
  def checksum
167
+ return nil if @window_bits < 0
164
168
  @deflater.closed? ? @checksum : @deflater.adler
165
169
  end
166
170
 
@@ -312,7 +316,7 @@ module Zlib # :nodoc:
312
316
  #
313
317
  # Finally, negating the base value of _window_bits_ indicates that a raw
314
318
  # zlib stream is expected without any header or trailer. In this case the
315
- # checksum method of this object will always return <tt>1</tt>. This is for
319
+ # checksum method of this object will always return <tt>nil</tt>. This is for
316
320
  # use with other formats that use the deflate compressed data format such as
317
321
  # zip. Such formats should provide their own check values.
318
322
  #
@@ -372,6 +376,7 @@ module Zlib # :nodoc:
372
376
  # processed any time the internal buffer is filled, so this checksum is only
373
377
  # accurate if all data has been read out of this object.
374
378
  def checksum
379
+ return nil if @window_bits < 0
375
380
  @inflater.closed? ? @checksum : @inflater.adler
376
381
  end
377
382
 
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Archive; class Zip
4
4
  # The current version of this gem.
5
- VERSION = "0.5.0"
5
+ VERSION = "0.6.0"
6
6
  end; end
@@ -31,10 +31,10 @@ describe "Zlib::ZReader#checksum" do
31
31
  closed_zr = ZlibSpecs.compressed_data_raw do |f|
32
32
  Zlib::ZReader.open(f, -15) do |zr|
33
33
  zr.read
34
- zr.checksum.should == 1
34
+ zr.checksum.should == nil
35
35
  zr
36
36
  end
37
37
  end
38
- closed_zr.checksum.should == 1
38
+ closed_zr.checksum.should == nil
39
39
  end
40
40
  end
@@ -33,9 +33,9 @@ describe "Zlib::ZWriter#checksum" do
33
33
  closed_zw = Zlib::ZWriter.open(compressed_data, nil, -15) do |zw|
34
34
  zw.write(ZlibSpecs.test_data)
35
35
  zw.flush
36
- zw.checksum.should == 1
36
+ zw.checksum.should == nil
37
37
  zw
38
38
  end
39
- closed_zw.checksum.should == 1
39
+ closed_zw.checksum.should == nil
40
40
  end
41
41
  end
metadata CHANGED
@@ -1,59 +1,62 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: archive-zip
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
5
- prerelease:
4
+ version: 0.6.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Jeremy Bopp
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-03-03 00:00:00.000000000Z
11
+ date: 2013-03-25 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: io-like
16
- requirement: &12753840 !ruby/object:Gem::Requirement
17
- none: false
15
+ requirement: !ruby/object:Gem::Requirement
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: 0.3.0
22
20
  type: :runtime
23
21
  prerelease: false
24
- version_requirements: *12753840
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: 0.3.0
25
27
  - !ruby/object:Gem::Dependency
26
28
  name: rake
27
- requirement: &12752440 !ruby/object:Gem::Requirement
28
- none: false
29
+ requirement: !ruby/object:Gem::Requirement
29
30
  requirements:
30
- - - ! '>='
31
+ - - '>='
31
32
  - !ruby/object:Gem::Version
32
33
  version: 0.9.0
33
34
  type: :development
34
35
  prerelease: false
35
- version_requirements: *12752440
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: 0.9.0
36
41
  - !ruby/object:Gem::Dependency
37
42
  name: mspec
38
- requirement: &12750780 !ruby/object:Gem::Requirement
39
- none: false
43
+ requirement: !ruby/object:Gem::Requirement
40
44
  requirements:
41
- - - ! '>='
45
+ - - '>='
42
46
  - !ruby/object:Gem::Version
43
47
  version: 1.5.12
44
48
  type: :development
45
49
  prerelease: false
46
- version_requirements: *12750780
47
- description: ! 'Archive::Zip provides a simple Ruby-esque interface to creating, extracting,
48
- and
49
-
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: 1.5.12
55
+ description: |
56
+ Archive::Zip provides a simple Ruby-esque interface to creating, extracting, and
50
57
  updating ZIP archives. This implementation is 100% Ruby and loosely modeled on
51
-
52
- the archive creation and extraction capabilities of InfoZip''s zip and unzip
53
-
58
+ the archive creation and extraction capabilities of InfoZip's zip and unzip
54
59
  tools.
55
-
56
- '
57
60
  email:
58
61
  - jeremy@bopp.net
59
62
  executables: []
@@ -194,27 +197,26 @@ files:
194
197
  - spec/archive/zip/codec/traditional_encryption/decrypt/seek_spec.rb
195
198
  homepage: http://github.com/javanthropus/archive-zip
196
199
  licenses: []
200
+ metadata: {}
197
201
  post_install_message:
198
202
  rdoc_options: []
199
203
  require_paths:
200
204
  - lib
201
205
  required_ruby_version: !ruby/object:Gem::Requirement
202
- none: false
203
206
  requirements:
204
- - - ! '>='
207
+ - - '>='
205
208
  - !ruby/object:Gem::Version
206
209
  version: '0'
207
210
  required_rubygems_version: !ruby/object:Gem::Requirement
208
- none: false
209
211
  requirements:
210
- - - ! '>='
212
+ - - '>='
211
213
  - !ruby/object:Gem::Version
212
214
  version: '0'
213
215
  requirements: []
214
216
  rubyforge_project: archive-zip
215
- rubygems_version: 1.8.10
217
+ rubygems_version: 2.0.0.rc.2
216
218
  signing_key:
217
- specification_version: 3
219
+ specification_version: 4
218
220
  summary: Simple, extensible, pure Ruby ZIP archive support.
219
221
  test_files:
220
222
  - default.mspec