hub_client 0.0.1 → 0.0.2
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/hub_client.gemspec +1 -0
- data/lib/hub_client/configuration.rb +1 -1
- data/lib/hub_client/logger.rb +1 -1
- data/lib/hub_client/version.rb +1 -1
- data/lib/hub_client.rb +9 -5
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YjZkNGYyZjVkYThhMjllMTY3NDA5MWMyNjNjYjU2ZjU5OTUyMzg1OA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZjUwZjUyYTVkZWVhZmRlODI4MjU4Y2Y3NjZiMjUxNzQwZWU0NTRlZA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
Y2MxOWZiMGMxMGE2NWNmY2Q4NjU1ZjkwN2RmNTliZGRjYTliZDk0YTg2OGNi
|
10
|
+
NjUxNjQzN2JlNTdmYmUwMDBmMTM1NjhhZjNkNWI5YzFmNmY2NDk0YTg5ODdk
|
11
|
+
YjkyNDFkZDgwZmRiYTQ0MjM3NjFlNDA0NmEwNmY4NmFlMDc2ZjY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZDE3NThkM2M5OTkzNTk3NWNiZGUwZDE5YzNlNTgwMjdmOGMxMTMyNjdmNjMx
|
14
|
+
MWI4OTFjMDhhM2EzMTIwZGI1MDgwYjA4ZjE3YjE4MzNhMWRhOGI4MWRlZDA1
|
15
|
+
Y2JiZDk2NmUzZjJlYWFlOGY4ODdlNDY1ZGZjNTgwMDIwNzcyZjk=
|
data/hub_client.gemspec
CHANGED
@@ -19,6 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
21
|
spec.add_runtime_dependency "rest-client"
|
22
|
+
spec.add_runtime_dependency "activesupport"
|
22
23
|
spec.add_development_dependency "bundler", "~> 1.5"
|
23
24
|
spec.add_development_dependency "rake"
|
24
25
|
spec.add_development_dependency "rspec"
|
data/lib/hub_client/logger.rb
CHANGED
data/lib/hub_client/version.rb
CHANGED
data/lib/hub_client.rb
CHANGED
@@ -8,19 +8,23 @@ 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
|
-
|
11
|
+
if HubClient.configuration.http_auth.present?
|
12
|
+
opts = HubClient.configuration.http_auth.slice(:user, :password)
|
13
|
+
end
|
12
14
|
|
13
|
-
RestClient.
|
14
|
-
|
15
|
+
rest_resource = RestClient::Resource.new(HubClient.configuration.endpoint_url, opts)
|
16
|
+
payload = { type: type, env: HubClient.configuration.env, content: content }
|
17
|
+
rest_resource.post(payload) do |response, request, result|
|
18
|
+
handle_response(response, request, result)
|
15
19
|
end
|
16
20
|
end
|
17
21
|
|
18
22
|
private
|
19
23
|
|
20
|
-
def self.handle_response(
|
24
|
+
def self.handle_response(response, request, result)
|
21
25
|
# When request didn't succeed we log it
|
22
26
|
unless result.code.start_with?("2")
|
23
|
-
HubClient.logger.info(request.args)
|
27
|
+
HubClient.logger.info("Code: #{result.code} Response: #{response} Request: #{request.args}")
|
24
28
|
end
|
25
29
|
end
|
26
30
|
|
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.2
|
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-
|
11
|
+
date: 2014-07-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - ! '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: activesupport
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ! '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ! '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: bundler
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|