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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ed13f6ec8264555cb6fbfeabb85abc204f097964
4
- data.tar.gz: a157200eb7a44427f872652332864cd721487b36
3
+ metadata.gz: 312b6b40c6862a79b05fd010da37b59233430ba3
4
+ data.tar.gz: 22005c823252e7e0e6dac733041941d9ddda276b
5
5
  SHA512:
6
- metadata.gz: bb1295b9808b685145819886e69b48d21afde00c18d7f7fc8b17263fa50370d04ca5795969ad169e919271cf505efe328aac8ce02ad8668dcc5d7c9e396774f3
7
- data.tar.gz: 8b80e19482459bf6c37bb4487d08d2369b074dc7536fdcf23f57c8984f8eff5b6c3ef89d3ff76c0c4a3740d994db8a82d49a2d9f01e08c3f9d1d0e0a3ba489cf
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
@@ -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", {}, accept: opts[:format] ||:json
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", {}, accept: opts[:format] ||:json
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, opts)
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: opts[:format] ||:json
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', opts)
39
- http_post "#{@datahub_base_url}/pools/#{pool_name}/compositions", {}, {accept: opts[:format]||:json}
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, opts)
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: opts[:format]||:json}
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
@@ -1,3 +1,3 @@
1
1
  module DHClient
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
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
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-13 00:00:00.000000000 Z
11
+ date: 2017-04-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: methadone