lens 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +1 -1
- data/lens.gemspec +2 -0
- data/lib/lens/compression.rb +22 -0
- data/lib/lens/configuration.rb +1 -1
- data/lib/lens/version.rb +1 -1
- data/spec/lens/lens_spec.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f53e7ccbbdcf3542df1c431b9b2828a0b0cddf0f
|
4
|
+
data.tar.gz: 4db30bce59f39de4ec90c001a1fd5d2daa440600
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d976fb595a8841b07e831ec104f6996e6a2bba697e8c5eb35f776b2b4df0f6519110235313d6283a4c8496e16a37509f45b8f2868c853505043b21a97d233ad
|
7
|
+
data.tar.gz: 16e632fe26c3bff34d85bb0bfd03722e1e4a38c8aef76e931fef8a4ea6ef48d2cf2054ffd9894cbe06e712caeecf5b2769fc38a0a1b648a1077562062666c1b7
|
data/.gitignore
CHANGED
data/README.md
CHANGED
data/lens.gemspec
CHANGED
@@ -17,6 +17,8 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
18
|
spec.require_paths = ['lib']
|
19
19
|
|
20
|
+
spec.add_runtime_dependency 'lz4-ruby'
|
21
|
+
|
20
22
|
spec.add_development_dependency 'bundler', '~> 1.6'
|
21
23
|
spec.add_development_dependency 'rails', '>= 3.0'
|
22
24
|
spec.add_development_dependency 'rake', '~> 0'
|
data/lib/lens/compression.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'lz4-ruby'
|
2
|
+
|
1
3
|
module Lens
|
2
4
|
module Compression
|
3
5
|
module Gzip
|
@@ -9,5 +11,25 @@ module Lens
|
|
9
11
|
{ 'Content-Type' => 'gzip/json' }
|
10
12
|
end
|
11
13
|
end
|
14
|
+
|
15
|
+
module LZ4
|
16
|
+
def self.compress(data)
|
17
|
+
::LZ4::compress(data)
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.headers
|
21
|
+
{ 'Content-Type' => 'lz4/json' }
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
module LZ4HC
|
26
|
+
def self.compress(data)
|
27
|
+
::LZ4::compressHC(data)
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.headers
|
31
|
+
{ 'Content-Type' => 'lz4hc/json' }
|
32
|
+
end
|
33
|
+
end
|
12
34
|
end
|
13
35
|
end
|
data/lib/lens/configuration.rb
CHANGED
data/lib/lens/version.rb
CHANGED
data/spec/lens/lens_spec.rb
CHANGED
@@ -26,7 +26,7 @@ describe Lens do
|
|
26
26
|
subject { described_class.configuration.compressor }
|
27
27
|
|
28
28
|
it { is_expected.to respond_to :compress }
|
29
|
-
it { is_expected.to be Lens::Compression::
|
29
|
+
it { is_expected.to be Lens::Compression::LZ4 }
|
30
30
|
end
|
31
31
|
|
32
32
|
describe 'configuration' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lens
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kgorin
|
@@ -10,8 +10,22 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2015-11-
|
13
|
+
date: 2015-11-19 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: lz4-ruby
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
18
|
+
requirements:
|
19
|
+
- - '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
requirements:
|
26
|
+
- - '>='
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
version: '0'
|
15
29
|
- !ruby/object:Gem::Dependency
|
16
30
|
name: bundler
|
17
31
|
requirement: !ruby/object:Gem::Requirement
|