snappy 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MDhhNWY2MDRkMGE4MGUzYTVmODU4OWU5ZjE1NjFmYzA1OWNlOWI5Mw==
4
+ OWYxZjliN2JhMzUxOGU5ZDI4ZWEwY2Q4ZDFlNTQ1OGY3NjdmNDliOQ==
5
5
  data.tar.gz: !binary |-
6
- Yzg3ZTcyNjIwNjUyMzhhZTk5NjliMDM5NTMzZGExODcwNTNmNTJjMQ==
6
+ NWNlYzI4NmVkODgzZTgzNWM1ZThmNjBiZDJhYmEwOTY5MGUxMTg4MA==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- YTc2MTFkZjQzYmY0ZWY2NzE0OThjNmU2YWUyYjNiNzIxYzhhZDhkYTI4MmFi
10
- YWE1OGE3NWQ2OTI3MmEyNTcyOWU5NWEwM2U1ODJmYmFkODRjZGIwMDMxZGVh
11
- Y2U5OTI4MzI4ODhmMmFlNGQzMmM3MmQwMWZmZWVlYzg5YjRlZjg=
9
+ NGRiMGI5ZjIwZDJhNzMwMGIyN2E5ODQxZDVjZDczNWI1MjA0Y2UyZDk3OGIw
10
+ MDcwN2Y2ZmFlYWNmNzMxYzJjMmIyODMxM2NlNTg3MWVmYzNiYTY4YzEzMjUz
11
+ MTQ3ZTg4NDMzZjljMWNiNzM5MzFiYWIxYzQ2MzI1OWE0MGY1Yzc=
12
12
  data.tar.gz: !binary |-
13
- NTZmOWU3NzRkZjZjYjhkNDc1NmU4YjYxNDMzOGIxOWM4NjNiYjAwODIzM2Q2
14
- YWU1MjllYzdmODdmNDljYzA1Nzk5OGFiMzg2YjE3ZDVhN2FhNDI0NDk0OTll
15
- MTVkNmRlMjgxZGI5YzY0YzY2MWIzM2I2OTRjYTkxODRmNjM3OGY=
13
+ ZWIyMGEwMzgxMjRhYjA2MDE1NDZmZTIxYzUzOGVhYjI2ODY1MTQ4ODI2OGI3
14
+ NDcwNjc4YWUxYjBjMmIwZGRiYmUyMDczYjBiM2RhNDhjMzcwOWJjZDdkOGZj
15
+ NDM2YzE0OWYzNzhhNDc5ZTliMzUyN2ZhMGI4MTM0MTdiYmRlNzI=
@@ -1,3 +1,3 @@
1
1
  module Snappy
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
data/lib/snappy/writer.rb CHANGED
@@ -1,6 +1,10 @@
1
1
  module Snappy
2
2
  class Writer
3
- MAGIC = "\202SNAPPY\000"
3
+ if RUBY_VERSION[0..2] == '1.8'
4
+ MAGIC = "\x82SNAPPY\x0"
5
+ else
6
+ MAGIC = "\x82SNAPPY\x0".force_encoding Encoding::ASCII_8BIT
7
+ end
4
8
  DEFAULT_VERSION = 1
5
9
  MINIMUM_COMPATIBLE_VERSION = 1
6
10
  DEFAULT_BLOCK_SIZE = 32 * 1024
@@ -0,0 +1,12 @@
1
+ require "minitest/spec"
2
+ require "minitest/autorun"
3
+ require "snappy"
4
+
5
+ describe Snappy do
6
+ T = [*"a".."z", *"A".."Z", *"0".."9"]
7
+
8
+ it "well done" do
9
+ s = Array.new(1024){T.sample}.join
10
+ Snappy.inflate(Snappy.deflate s).must_equal(s)
11
+ end
12
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snappy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - miyucy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-03-06 00:00:00.000000000 Z
11
+ date: 2013-03-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -73,6 +73,7 @@ files:
73
73
  - snappy.gemspec
74
74
  - test/test-snappy-reader.rb
75
75
  - test/test-snappy-writer.rb
76
+ - test/test-snappy.rb
76
77
  homepage: http://github.com/miyucy/snappy
77
78
  licenses:
78
79
  - MIT
@@ -93,10 +94,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
93
94
  version: '0'
94
95
  requirements: []
95
96
  rubyforge_project:
96
- rubygems_version: 2.0.0
97
+ rubygems_version: 2.0.3
97
98
  signing_key:
98
99
  specification_version: 4
99
100
  summary: libsnappy binding for Ruby
100
101
  test_files:
101
102
  - test/test-snappy-reader.rb
102
103
  - test/test-snappy-writer.rb
104
+ - test/test-snappy.rb