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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZmQ1ODYzMzA0ZDczOThmNjgyOTE1MzdmNTM5NTBlYTg1NDg4ZGJmNw==
4
+ MjU2NWEzMjliMmM2MTk5MTFmMzdjZTFmMGM2NDNjYzcxMWQ1M2NlMQ==
5
5
  data.tar.gz: !binary |-
6
- YmU4YzdmNWIxNGU5N2MwN2E4ZmYwOTQ0NWY5MjdjYWM3ODJiNzU3Ng==
6
+ ZTMyYmNkNDcwMzExMjI3ZWIwZjY3Nzc4ZmFlYzY5NWRlYTAwZmYzYw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZjZhNDMyMmJkYjg5ZDZmODFhYmZhZDNkZjA0N2I3NDI5NjI0YWQ2MDZhNTY4
10
- NTM0ZThmMmRjNzZjMjYwMzExMDFlZmQ4MGYyNTkzMzRiMWFjMjFjZDM2NDk0
11
- NTg5MjY3NDMwNDgzMWEyYWNkMTQzMjBkYWU2ZGM1ZGUzYWY5MTk=
9
+ ZDViZjE0MjJmYmNkZDAxYTJjNjg4ZjA4NWJkZTE2MDZkYzQ4MjhmZjRiMzY0
10
+ MGVkMWFmOTFlNzJmYzUyMTM2MWQ0MzI4N2Q0YjJjYjc5MGQ3MWZmMTg1NWNh
11
+ NDQ1OWM3MzU4OWFlYTk5MjRlYjEwMjY3MmRlNmIyZTFjN2FiZDE=
12
12
  data.tar.gz: !binary |-
13
- MjljMjUyMzU5MDMxYzFjZWZhNWZjZjgxZmM1OGIzYzFiZmRhMmRiZmYxNmVj
14
- OGRjMjllMzg2MDY0ZjRjODE0OTliMjE2MDg5YmIzNzdjZDc0MmVkZDdhYmYx
15
- YzQwZDNmODliNDY2Yjk1ZWExOGVjNjcwOTIwNDBlNTJlMjQ2ODM=
13
+ NTJkOTVlMjE1MTA1Mzg2MTE1Y2NkMzZhOTMwMWE0NDQyZTcwNjJmNjAyMjcy
14
+ ZjYxNDE0NjZhZjkwY2E2M2IxYzg3NjhkNDkyOTA4ZWQxNmYyZWRlMTc0NTUx
15
+ Njk3NjgxMWYyZjNjMjAwZDFmMDU4NWE0ZTc5MmVhZjBmMDA3ZWQ=
@@ -1,4 +1,4 @@
1
1
  module HubClient
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  HUB_VERSION = "v1"
4
4
  end
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, env: HubClient.configuration.env, content: content.to_json }
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|
@@ -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.5
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-13 00:00:00.000000000 Z
11
+ date: 2014-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client