rbbt-util 5.17.82 → 5.17.83

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rbbt/rest/client/get.rb +28 -10
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 06179bbff3dd8c45a91bd877fe23adef43e2299b
4
- data.tar.gz: 5bf1cd04f279300d4c4bf2ce91f831f1d675c123
3
+ metadata.gz: 5d9941ceb075fca31914c99419af60f20419dfdb
4
+ data.tar.gz: 8dd78c630139e2c8c04662acdaf0c42f30fd4848
5
5
  SHA512:
6
- metadata.gz: 1042bfebbe214dd1a9ef60c704bfc1bdc209e300fe46c759ee766b7a40c71049e545a7b229a490c1207890c16ce73d890f2cef722f8cfa3a6e0c0c1d434bce3a
7
- data.tar.gz: 51734367f0342e5ba6dc2e3432b0892ec99f01951704d65b2c6a8201413f21e9fb5e853f32233134d69d7123b2bf9b9afe8c711d1418eae0b90dddc2348ba819
6
+ metadata.gz: 1e912d125ad9571c9303e30a1fd90d5a1a22fe9b05660bec75afbd87435b05b367d6020d6190d24521f659866563b02fcb6e510e3019101f9b5afda5fb0f0a91
7
+ data.tar.gz: 39555786a67c6ca0ef4b034c3a2acda8f653cdb9bac0a828cc19f24d1752da60d4084efec171fc52ba9ff18f25da2cadf242f427ee8620d35a85cbec69b56b0f
@@ -41,9 +41,22 @@ class WorkflowRESTClient
41
41
  end
42
42
  end
43
43
 
44
+ def self.fix_params(params)
45
+ new_params = {}
46
+ params.each do |k,v|
47
+ if Array === v and v.empty?
48
+ new_params[k] = "EMPTY_ARRAY"
49
+ else
50
+ new_params[k] = v
51
+ end
52
+ end
53
+ new_params
54
+ end
55
+
44
56
  def self.get_raw(url, params = {})
45
57
  Log.debug{ "RestClient get_raw: #{ url } - #{Misc.fingerprint params}" }
46
58
  params = params.merge({ :_format => 'raw' })
59
+ params = fix_params params
47
60
  capture_exception do
48
61
  Misc.insist(2, 0.5) do
49
62
  RestClient.get(URI.encode(url), :params => params)
@@ -51,21 +64,15 @@ class WorkflowRESTClient
51
64
  end
52
65
  end
53
66
 
54
- def self.post_jobname(url, params = {})
55
- Log.debug{ "RestClient post_jobname: #{ url } - #{Misc.fingerprint params}" }
56
- params = params.merge({ :_format => 'jobname' })
57
-
58
- capture_exception do
59
- RestClient.post(URI.encode(url), params)
60
- end
61
- end
62
-
63
67
  def self.get_json(url, params = {})
64
68
  Log.debug{ "RestClient get_json: #{ url } - #{Misc.fingerprint params }" }
65
69
  params = params.merge({ :_format => 'json' })
70
+ params = fix_params params
66
71
 
67
72
  res = capture_exception do
68
- RestClient.get(URI.encode(url), :params => params)
73
+ Misc.insist(2, 0.5) do
74
+ RestClient.get(URI.encode(url), :params => params)
75
+ end
69
76
  end
70
77
 
71
78
  begin
@@ -75,11 +82,22 @@ class WorkflowRESTClient
75
82
  end
76
83
  end
77
84
 
85
+ def self.post_jobname(url, params = {})
86
+ Log.debug{ "RestClient post_jobname: #{ url } - #{Misc.fingerprint params}" }
87
+ params = params.merge({ :_format => 'jobname' })
88
+ params = fix_params params
89
+
90
+ capture_exception do
91
+ RestClient.post(URI.encode(url), params)
92
+ end
93
+ end
94
+
78
95
  def self.post_json(url, params = {})
79
96
  if url =~ /_cache_type=:exec/
80
97
  JSON.parse(Open.open(url, :nocache => true))
81
98
  else
82
99
  params = params.merge({ :_format => 'json' })
100
+ params = fix_params params
83
101
 
84
102
  res = capture_exception do
85
103
  RestClient.post(URI.encode(url), params)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbbt-util
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.17.82
4
+ version: 5.17.83
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-26 00:00:00.000000000 Z
11
+ date: 2015-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake