data-sink-client 0.2.0 → 0.2.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
  SHA1:
3
- metadata.gz: a159e46208b12b267d7ee9bd23a658202012478b
4
- data.tar.gz: c99e16b3e44d76d8dfb7b56ef645db9c2be9ae77
3
+ metadata.gz: '038ce898845f096bc7561080ee847792d1fcf6d4'
4
+ data.tar.gz: 6dde7436089f5283f2acc13952c4f482763fa874
5
5
  SHA512:
6
- metadata.gz: cf49268829d9ac8a7b71e18a267b5f80b51cb8f63259ab7bb23bb6d7ddc7de30d1bddca4300331cf81d7700b59cb8dc2ef8ef6d695f5063039c0fd420787cb55
7
- data.tar.gz: 266eacc20cc55141e90e01fa2c7e3684b3dde0ca0744be48d9eb55014b9eeacdba856f4d8079b4c6fa734be38ccf8ade6850c10cf73dacf2661269b6d7c01a0a
6
+ metadata.gz: 79e69f46de1930be5e03a2e66876896173f38891865f00aa3b2c2ca2bad5621f3773f57bd428b8e8cc2c51e53838595a6698c7d5a8a836145fda6fb42a155289
7
+ data.tar.gz: 70ae71df3c54fb747575c526711b1b4a289297cf7bd634679fc9a28da5a1f2359c7d8b9a7b3923a3cc958d0efd3bd8b80a2b9d2bfbb3fcbd29e324b5b0bb71ba
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- data-sink-client (0.1.2)
4
+ data-sink-client (0.2.1)
5
5
  excon (~> 0.55.0)
6
6
  faraday (> 0.10.0)
7
7
 
@@ -14,7 +14,7 @@ GEM
14
14
  safe_yaml (~> 1.0.0)
15
15
  diff-lcs (1.3)
16
16
  excon (0.55.0)
17
- faraday (0.11.0)
17
+ faraday (0.15.0)
18
18
  multipart-post (>= 1.2, < 3)
19
19
  hashdiff (0.3.0)
20
20
  multipart-post (2.0.0)
@@ -50,4 +50,4 @@ DEPENDENCIES
50
50
  webmock (~> 2.1)
51
51
 
52
52
  BUNDLED WITH
53
- 1.13.2
53
+ 1.16.1
@@ -1,3 +1,3 @@
1
1
  module DataSinkClient
2
- VERSION = '0.2.0'.freeze
2
+ VERSION = '0.2.1'.freeze
3
3
  end
@@ -23,21 +23,22 @@ module DataSink
23
23
  @client = options[:client] || create_client(user, pass)
24
24
  end
25
25
 
26
- def post(stream_id, body)
27
- post_gzipped(stream_id, gzip(transform(body)))
26
+ def post(stream_id, body, partition_key: nil)
27
+ post_gzipped(stream_id, gzip(transform(body)), partition_key: partition_key)
28
28
  end
29
29
 
30
- def post_gzipped(stream_id, body)
30
+ def post_gzipped(stream_id, body, partition_key: nil)
31
31
  client.post do |req|
32
- req.url endpoint(stream_id)
32
+ req.url endpoint(stream_id, partition_key)
33
33
  req.body = body
34
34
  end
35
35
  end
36
36
 
37
37
  private
38
38
 
39
- def endpoint(stream_id)
40
- [options[:endpoint], stream_id].join('/')
39
+ def endpoint(stream_id, partition_key)
40
+ path = [options[:endpoint], stream_id].join('/')
41
+ partition_key.nil? ? path : "#{path}?partition_key=#{partition_key}"
41
42
  end
42
43
 
43
44
  def create_client(user, pass)
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.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Pirlik
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-01-31 00:00:00.000000000 Z
11
+ date: 2018-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -133,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
133
133
  version: '0'
134
134
  requirements: []
135
135
  rubyforge_project:
136
- rubygems_version: 2.4.5.1
136
+ rubygems_version: 2.6.14
137
137
  signing_key:
138
138
  specification_version: 4
139
139
  summary: Client for the data-sink service