feedx 0.10.0 → 0.10.1

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
  SHA256:
3
- metadata.gz: ac561a2e9f403ede565104432d51ac3848c59fc8147e063e1fbdbba9486a1c34
4
- data.tar.gz: ccf838177c08ac2d1247f61323561a3d06d43084466c34f214993f59743d646d
3
+ metadata.gz: d84be642c90e028ccba4dabbe561e8305126f0b66cc008204ab961645a9309b4
4
+ data.tar.gz: 9a63d2736d1ca689f1596d60294c90d6ed1c869b42192803712b32d347e034b5
5
5
  SHA512:
6
- metadata.gz: 2de3eb9b314c84d556201d9cca545ea2c0b255c2dba0f0aba6e40e76a34092975f6ab8c8332028c22263cec358c7000e2fb188833dc45b9ba26bdb111ccda9c7
7
- data.tar.gz: 2caa4db04fc18f4ad12b05171e1a6fd7afc9e8f52514100480e4d5762f8b7c4d1328643da9c2e39d08f005f22feefdfe5b976685729b6df2ea8c03572a694bc9
6
+ metadata.gz: 7c7baa1af8c07105c8330da14000a5883954787989c675bc483d87fb8d11dc0c5423d541162646452252443dcdbb6fdff51ea7f53aad5b8f8a1812db89e3dbb6
7
+ data.tar.gz: e48503c89d01a15ea309b002a2713413d8a635ea89e5667a11bfd4c90df0aabfb4ca6bb44341aadbe30d8fd846b9911e3d1f5eb8cfe3a5ef43a286044997b575
data/.gitignore CHANGED
@@ -1,2 +1,3 @@
1
1
  .rubocop-*
2
2
  pkg/
3
+ *~
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- feedx (0.10.0)
4
+ feedx (0.10.1)
5
5
  bfs (>= 0.5.0)
6
6
 
7
7
  GEM
@@ -15,7 +15,7 @@ GEM
15
15
  parallel (1.19.1)
16
16
  parser (2.7.0.2)
17
17
  ast (~> 2.4.0)
18
- pbio (0.2.0)
18
+ pbio (0.2.1)
19
19
  google-protobuf
20
20
  rainbow (3.0.0)
21
21
  rake (13.0.1)
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'feedx'
3
- s.version = '0.10.0'
3
+ s.version = '0.10.1'
4
4
  s.authors = ['Black Square Media Ltd']
5
5
  s.email = ['info@blacksquaremedia.com']
6
6
  s.summary = %(Exchange data between components via feeds)
@@ -1,11 +1,25 @@
1
1
  require 'zlib'
2
2
 
3
3
  class Feedx::Compression::Gzip < Feedx::Compression::Abstract
4
- def self.reader(io, &block)
5
- Zlib::GzipReader.wrap(io, &block)
6
- end
4
+ class << self
5
+ def reader(io, &block)
6
+ force_binmode(io)
7
+ Zlib::GzipReader.wrap(io, &block)
8
+ end
9
+
10
+ def writer(io, &block)
11
+ force_binmode(io)
12
+ Zlib::GzipWriter.wrap(io, &block)
13
+ end
14
+
15
+ private
7
16
 
8
- def self.writer(io, &block)
9
- Zlib::GzipWriter.wrap(io, &block)
17
+ def force_binmode(io)
18
+ if io.respond_to?(:binmode)
19
+ io.binmode
20
+ elsif io.respond_to?(:set_encoding)
21
+ io.set_encoding(Encoding::BINARY)
22
+ end
23
+ end
10
24
  end
11
25
  end
@@ -5,11 +5,13 @@ RSpec.describe Feedx::Compression::Gzip do
5
5
  wio = StringIO.new
6
6
  described_class.writer(wio) {|w| w.write 'xyz' * 1000 }
7
7
  expect(wio.size).to be_within(20).of(40)
8
+ expect(wio.string.encoding).to eq(Encoding::BINARY)
8
9
 
9
10
  data = ''
10
11
  StringIO.open(wio.string) do |rio|
11
12
  described_class.reader(rio) {|z| data = z.read }
12
13
  end
13
14
  expect(data.size).to eq(3000)
15
+ expect(data.encoding).to eq(Encoding.default_external)
14
16
  end
15
17
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: feedx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Black Square Media Ltd
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-20 00:00:00.000000000 Z
11
+ date: 2020-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bfs
@@ -191,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
191
191
  - !ruby/object:Gem::Version
192
192
  version: '0'
193
193
  requirements: []
194
- rubygems_version: 3.0.6
194
+ rubygems_version: 3.0.3
195
195
  signing_key:
196
196
  specification_version: 4
197
197
  summary: Exchange data between components via feeds