dhclient 0.1.4 → 0.1.5
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 +4 -4
- data/bin/dhconsole +0 -15
- data/lib/dhclient/datahub.rb +10 -10
- data/lib/dhclient/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 312b6b40c6862a79b05fd010da37b59233430ba3
|
4
|
+
data.tar.gz: 22005c823252e7e0e6dac733041941d9ddda276b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c6e58e3bf60a1a6b7f23ab73884e39e9d6af3fbfc70c7752dfb35981fc05251bfa3db05c1e6b9edeb7faa653e62bf6d0cb98ba6d493b7f46ba53b6715180042
|
7
|
+
data.tar.gz: b936840211c17fcb2e0a076deb7cc4ded8d5585a06dcfe89da9dd676b11cc42765fd78cd8995f44bf93b108d5c1ff014c80c4bee755bbae8d0b1f0aa4c2916e8
|
data/bin/dhconsole
CHANGED
@@ -6,21 +6,6 @@ require "dhclient"
|
|
6
6
|
# You can add fixtures and/or initialization code here to make experimenting
|
7
7
|
# with your gem easier. You can also use a different console, if you like.
|
8
8
|
|
9
|
-
def pretty_print(content, format=:json)
|
10
|
-
if format == :xml
|
11
|
-
require 'rexml/document'
|
12
|
-
formatter = REXML::Formatters::Pretty.new
|
13
|
-
formatter.compact = true
|
14
|
-
xml = REXML::Document.new content
|
15
|
-
formatter.write(xml, out)
|
16
|
-
elsif format == :json
|
17
|
-
out = JSON.parse(content)
|
18
|
-
else
|
19
|
-
out = "Unsupported format #{format}"
|
20
|
-
end
|
21
|
-
return out
|
22
|
-
end
|
23
|
-
|
24
9
|
# (If you use this, don't forget to add pry to your Gemfile!)
|
25
10
|
require "pry"
|
26
11
|
Pry.start
|
data/lib/dhclient/datahub.rb
CHANGED
@@ -18,32 +18,32 @@ module DHClient
|
|
18
18
|
response.body
|
19
19
|
end
|
20
20
|
|
21
|
-
def compositions(pool_name='GLOBAL', opts)
|
22
|
-
response = RestClient.get "#{@datahub_base_url}/pools/#{pool_name}/compositions",
|
21
|
+
def compositions(pool_name='GLOBAL', opts={})
|
22
|
+
response = RestClient.get "#{@datahub_base_url}/pools/#{pool_name}/compositions", accept: opts[:format] ||:json
|
23
23
|
response.body
|
24
24
|
end
|
25
25
|
|
26
|
-
def publications(pool_name='GLOBAL', opts)
|
27
|
-
response = RestClient.get "#{@datahub_base_url}/pools/#{pool_name}/publications",
|
26
|
+
def publications(pool_name='GLOBAL', opts={})
|
27
|
+
response = RestClient.get "#{@datahub_base_url}/pools/#{pool_name}/publications", accept: opts[:format] ||:json
|
28
28
|
response.body
|
29
29
|
end
|
30
30
|
|
31
31
|
#POST
|
32
32
|
|
33
|
-
def load_data(file, feed_name='DEFAULT_FEED', raw_item_name
|
33
|
+
def load_data(file, feed_name='DEFAULT_FEED', raw_item_name)
|
34
34
|
data = File.new(file, 'rb')
|
35
|
-
http_post "#{@datahub_base_url}/data-feeds/#{feed_name}/items/#{raw_item_name}", data, content_type: 'application/octet-stream', accept:
|
35
|
+
http_post "#{@datahub_base_url}/data-feeds/#{feed_name}/items/#{raw_item_name}", data, content_type: 'application/octet-stream', accept: :json
|
36
36
|
end
|
37
37
|
|
38
|
-
def start_composition(pool_name='GLOBAL'
|
39
|
-
http_post "#{@datahub_base_url}/pools/#{pool_name}/compositions", {}, {accept:
|
38
|
+
def start_composition(pool_name='GLOBAL')
|
39
|
+
http_post "#{@datahub_base_url}/pools/#{pool_name}/compositions", {}, {accept: :json}
|
40
40
|
end
|
41
41
|
|
42
|
-
def start_publication(pool_name='GLOBAL', target_system
|
42
|
+
def start_publication(pool_name='GLOBAL', target_system)
|
43
43
|
json_payload = {targetSystemPublications: [
|
44
44
|
{targetSystemName: target_system}
|
45
45
|
]}.to_json
|
46
|
-
http_post "#{@datahub_base_url}/pools/#{pool_name}/publications", json_payload, {content_type: :json, accept:
|
46
|
+
http_post "#{@datahub_base_url}/pools/#{pool_name}/publications", json_payload, {content_type: :json, accept: :json}
|
47
47
|
end
|
48
48
|
|
49
49
|
private
|
data/lib/dhclient/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dhclient
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Quirino Oliveira
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-04-
|
11
|
+
date: 2017-04-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: methadone
|