hub_client 0.0.5 → 0.0.6
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 -2
- data/spec/hub_client_spec.rb +0 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MjU2NWEzMjliMmM2MTk5MTFmMzdjZTFmMGM2NDNjYzcxMWQ1M2NlMQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZTMyYmNkNDcwMzExMjI3ZWIwZjY3Nzc4ZmFlYzY5NWRlYTAwZmYzYw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZDViZjE0MjJmYmNkZDAxYTJjNjg4ZjA4NWJkZTE2MDZkYzQ4MjhmZjRiMzY0
|
10
|
+
MGVkMWFmOTFlNzJmYzUyMTM2MWQ0MzI4N2Q0YjJjYjc5MGQ3MWZmMTg1NWNh
|
11
|
+
NDQ1OWM3MzU4OWFlYTk5MjRlYjEwMjY3MmRlNmIyZTFjN2FiZDE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NTJkOTVlMjE1MTA1Mzg2MTE1Y2NkMzZhOTMwMWE0NDQyZTcwNjJmNjAyMjcy
|
14
|
+
ZjYxNDE0NjZhZjkwY2E2M2IxYzg3NjhkNDkyOTA4ZWQxNmYyZWRlMTc0NTUx
|
15
|
+
Njk3NjgxMWYyZjNjMjAwZDFmMDU4NWE0ZTc5MmVhZjBmMDA3ZWQ=
|
data/lib/hub_client/version.rb
CHANGED
data/lib/hub_client.rb
CHANGED
@@ -6,9 +6,9 @@ require "rest-client"
|
|
6
6
|
module HubClient
|
7
7
|
def self.publish(type, content)
|
8
8
|
raise ConfigArgumentMissing, "endpoint_url missing" unless HubClient.configuration.endpoint_url
|
9
|
-
raise ConfigArgumentMissing, "env missing" unless HubClient.configuration.env
|
10
9
|
|
11
|
-
payload = { type: type,
|
10
|
+
payload = { type: type, content: content.to_json }
|
11
|
+
payload[:env] = HubClient.configuration.env if HubClient.configuration.env
|
12
12
|
hub_url = build_hub_url(HubClient.configuration.endpoint_url)
|
13
13
|
|
14
14
|
RestClient.post(hub_url, payload, content_type: :json) do |response, request, result|
|
data/spec/hub_client_spec.rb
CHANGED
@@ -10,11 +10,6 @@ describe HubClient do
|
|
10
10
|
HubClient.configure { |config| config.env = "il-qa2" }
|
11
11
|
expect { HubClient.publish("order_created", {}) }.to raise_error(HubClient::ConfigArgumentMissing)
|
12
12
|
end
|
13
|
-
|
14
|
-
it "raises an error when env is not configured" do
|
15
|
-
HubClient.configure { |config| config.endpoint_url = "service-hub.com" }
|
16
|
-
expect { HubClient.publish("order_created", {}) }.to raise_error(HubClient::ConfigArgumentMissing)
|
17
|
-
end
|
18
13
|
end
|
19
14
|
|
20
15
|
context "configured" do
|
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.6
|
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-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|