hub_client 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/lib/hub_client/version.rb +1 -1
- data/lib/hub_client.rb +2 -6
- data/spec/hub_client_spec.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
OWRlZmRiZDgzOGU1NDM4MGQ0ZDM4NjBkYzhkNWMzMWVhMTFhNzI3Ng==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MzQzNzU4NTZjNDZjNTc2ZjQ1YTJiNGQzYzAwZjQ3MDZhZjFjOWFhMg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MzM4NTU1ODhlOTFkOWU2NTQ0OGU4ZDA3MTUzMDdhYzk3ZWM4ZjhlMjJiOTFm
|
10
|
+
NTU1Y2Q0NzVmN2VlM2UwMzc4NTQ4MzI4ODc2ODQ2ZDJhNmFhZWY4ZDcwZWFk
|
11
|
+
NGRjNWU1NjM0Yjg0YTJlMjFmMDBhYTU2MTZmOWI4MTRmNTVjNjc=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MGI3NzNiNGU2OWJkYWQ1MzQ5NjMwZTE4N2NlYjI1NWVmOGRkNzUxZWUzY2Mx
|
14
|
+
NzhmOTM4N2VlNGY0ZjBlMDNkMDAyZTM4NTM4NGEzY2EwNjlkY2Q1YWI3N2I0
|
15
|
+
NGU4NzVlODIwNDJmNDNhZDMxZTZiMTBiN2M2NWExMzNhM2RiZWE=
|
data/lib/hub_client/version.rb
CHANGED
data/lib/hub_client.rb
CHANGED
@@ -8,13 +8,9 @@ module HubClient
|
|
8
8
|
raise ConfigArgumentMissing, "endpoint_url missing" unless HubClient.configuration.endpoint_url
|
9
9
|
raise ConfigArgumentMissing, "env missing" unless HubClient.configuration.env
|
10
10
|
|
11
|
-
|
12
|
-
opts = HubClient.configuration.http_auth.slice(:user, :password)
|
13
|
-
end
|
11
|
+
payload = { type: type, env: HubClient.configuration.env, content: content.to_json }
|
14
12
|
|
15
|
-
|
16
|
-
payload = { type: type, env: HubClient.configuration.env, content: content }
|
17
|
-
rest_resource.post(payload) do |response, request, result|
|
13
|
+
RestClient.post(HubClient.configuration.endpoint_url, payload, content_type: :json) do |response, request, result|
|
18
14
|
handle_response(response, request, result)
|
19
15
|
end
|
20
16
|
end
|
data/spec/hub_client_spec.rb
CHANGED
@@ -27,7 +27,7 @@ describe HubClient do
|
|
27
27
|
|
28
28
|
it "publishes a message to hub" do
|
29
29
|
stub_request(:post, HubClient.configuration.endpoint_url).
|
30
|
-
with(body: { env: "il-qa2", type: "order_created", content: { some: "content" } }).
|
30
|
+
with(body: { env: "il-qa2", type: "order_created", content: { some: "content" }.to_json }).
|
31
31
|
to_return(status: 204)
|
32
32
|
|
33
33
|
HubClient.publish(:order_created, { some: "content" })
|
@@ -36,7 +36,7 @@ describe HubClient do
|
|
36
36
|
|
37
37
|
it "logs the request when hub didn't return success code" do
|
38
38
|
stub_request(:post, HubClient.configuration.endpoint_url).
|
39
|
-
with(body: { env: "il-qa2", type: "order_created", content: { some: "content" } }).
|
39
|
+
with(body: { env: "il-qa2", type: "order_created", content: { some: "content" }.to_json }).
|
40
40
|
to_return(status: 500)
|
41
41
|
|
42
42
|
expect(HubClient.logger).to receive(:info)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hub_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yarin Goldman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|