data-sink-client 0.1.2 → 0.2.0

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: b539f32ec6079e8993c531486afe88452e10b5c2
4
- data.tar.gz: 9f2259a0f18950ad0ad8846745917a6c3ca0d358
3
+ metadata.gz: a159e46208b12b267d7ee9bd23a658202012478b
4
+ data.tar.gz: c99e16b3e44d76d8dfb7b56ef645db9c2be9ae77
5
5
  SHA512:
6
- metadata.gz: 7444345496e43d4e5ddf6f875e0e5bcc490d693499f9f0850e266b7cf038bad7238c0aaaac6e422c36ccb0bc96dce34540c9e76dc4292f4316d3197b4f6fc1d4
7
- data.tar.gz: 5f51a0fee01d9e0c71a90ef73ffdcbbc701027166b6f73c1c8fe7d9aaa06399dd3ca1145ce16ff90959d3aa0bb2c9c82a31ba3a1d6eb879a33cfdfb79bac661e
6
+ metadata.gz: cf49268829d9ac8a7b71e18a267b5f80b51cb8f63259ab7bb23bb6d7ddc7de30d1bddca4300331cf81d7700b59cb8dc2ef8ef6d695f5063039c0fd420787cb55
7
+ data.tar.gz: 266eacc20cc55141e90e01fa2c7e3684b3dde0ca0744be48d9eb55014b9eeacdba856f4d8079b4c6fa734be38ccf8ade6850c10cf73dacf2661269b6d7c01a0a
data/README.md CHANGED
@@ -42,6 +42,7 @@ retry_backoff_factor: 2
42
42
  adapter: :excon
43
43
  read_timeout: 5
44
44
  open_timeout: 5
45
+ add_newlines: true
45
46
  ```
46
47
 
47
48
  or pass a Faraday client yourself with `client:`.
@@ -1,3 +1,3 @@
1
1
  module DataSinkClient
2
- VERSION = '0.1.2'.freeze
2
+ VERSION = '0.2.0'.freeze
3
3
  end
@@ -11,6 +11,7 @@ module DataSink
11
11
  adapter: :excon,
12
12
  read_timeout: 5,
13
13
  open_timeout: 5,
14
+ add_newlines: true
14
15
  }.freeze
15
16
 
16
17
  attr_reader :client, :options
@@ -23,7 +24,7 @@ module DataSink
23
24
  end
24
25
 
25
26
  def post(stream_id, body)
26
- post_gzipped(stream_id, gzip(body))
27
+ post_gzipped(stream_id, gzip(transform(body)))
27
28
  end
28
29
 
29
30
  def post_gzipped(stream_id, body)
@@ -52,6 +53,14 @@ module DataSink
52
53
  end
53
54
  end
54
55
 
56
+ def transform(body)
57
+ if options[:add_newlines]
58
+ body + "\n"
59
+ else
60
+ body
61
+ end
62
+ end
63
+
55
64
  def gzip(body)
56
65
  wio = StringIO.new("w")
57
66
  w_gz = Zlib::GzipWriter.new(wio)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: data-sink-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Pirlik
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-04-07 00:00:00.000000000 Z
11
+ date: 2018-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday