rbbt-util 5.20.15 → 5.20.16

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: 8acdb68bc077ef40aa93cc0bd822e2a03e634d7f
4
- data.tar.gz: 5aeb1004ef167478f65659794dbc2c93d294cd10
3
+ metadata.gz: f8ff80d80e35fa0ba2bbdc6fb626a00ae0097973
4
+ data.tar.gz: eae7437a6901578f908d32bdadf109c339be8794
5
5
  SHA512:
6
- metadata.gz: c5bb2dc2c484251bc7d41b88d3869eeea5d179724bf4ff46403fdd7e3c84be1c28bb31c8bd5d4412f51027221e3fd41139acd1b444fbb1829adcd8baa49560e6
7
- data.tar.gz: 1c82abfa22a27807250e030c22f03a586327d10cee8baea5bc70644275e71ad7f69cff72c4327df9ff4f6f0f05b8e788a5c1ff28b949bdae1ab9d5791f519672
6
+ metadata.gz: caf52df7da1aac95ec53d5883c1a49f26170bdb95f09b039321e435078b74969abdcbecb594b12e736d9a9640aebf0eb73d902a308242fc734dd537c650a0a42
7
+ data.tar.gz: 76592f03fe4bcfe0881a8c8e0e2e943829cda0ae03116b8c4410ee350119c9499dd829c6f407a6d2d461d33e921d650bed2b5eb68129d7784deaf54583410f39
@@ -90,6 +90,7 @@ class WorkflowRESTClient
90
90
  params = params.merge({ :_format => 'jobname' })
91
91
  params = fix_params params
92
92
 
93
+ params = WorkflowRESTClient.__prepare_inputs_for_restclient(params)
93
94
  name = capture_exception do
94
95
  RestClient.post(URI.encode(url), params)
95
96
  end
@@ -1,4 +1,27 @@
1
1
  class WorkflowRESTClient
2
+
3
+ def self.__prepare_inputs_for_restclient(inputs)
4
+
5
+ new = IndiferentHash.setup({})
6
+ inputs.each do |k,v|
7
+ if v.respond_to? :path and not v.respond_to? :original_filename
8
+ class << v
9
+ def original_filename
10
+ File.expand_path(path)
11
+ end
12
+ end
13
+ end
14
+
15
+ if Array === v and v.empty?
16
+ new[k] = "EMPTY_ARRAY"
17
+ else
18
+ new[k] = v
19
+ end
20
+ end
21
+
22
+ new
23
+ end
24
+
2
25
  class RemoteStep < Step
3
26
 
4
27
  attr_accessor :url, :base_url, :task, :base_name, :inputs, :result_type, :result_description, :is_exec, :stream_input
@@ -89,7 +112,6 @@ class WorkflowRESTClient
89
112
  end
90
113
 
91
114
  def status
92
- return nil unless url or started?
93
115
  return :done if @done
94
116
  return :streaming if @streaming
95
117
  begin
@@ -181,7 +203,9 @@ class WorkflowRESTClient
181
203
  end
182
204
  sleep 0.2 unless self.done?
183
205
  sleep 1 unless self.done?
184
- sleep 3 while not self.done?
206
+ while not self.done?
207
+ sleep 3
208
+ end
185
209
  self
186
210
  end
187
211
 
@@ -231,11 +255,12 @@ class WorkflowRESTClient
231
255
  params = {}
232
256
  load_res get
233
257
  end
234
-
258
+
235
259
  def _run_job(cache_type = :async)
236
260
  get_streams
237
261
  if cache_type == :stream or cache_type == :exec and stream_input and inputs[stream_input]
238
262
  task_url = URI.encode(File.join(base_url, task.to_s))
263
+ inputs = WorkflowRESTClient.__prepare_inputs_for_restclient(inputs)
239
264
  task_params = inputs.merge(:_cache_type => cache_type, :jobname => base_name, :_format => [:string, :boolean, :tsv, :annotations].include?(result_type) ? :raw : :json)
240
265
  @streaming = true
241
266
  io = WorkflowRESTClient.stream_job(task_url, task_params, stream_input, cache_type)
@@ -256,19 +281,6 @@ class WorkflowRESTClient
256
281
 
257
282
  WorkflowRESTClient.capture_exception do
258
283
  @url = URI.encode(File.join(base_url, task.to_s))
259
- inputs.each do |k,v|
260
- if v.respond_to? :path
261
- class << v
262
- def original_filename
263
- File.expand_path(path)
264
- end
265
- end
266
- end
267
-
268
- if Array === v and v.empty?
269
- inputs[k] = "EMPTY_ARRAY"
270
- end
271
- end
272
284
  task_params = inputs.merge(:_cache_type => cache_type, :jobname => base_name, :_format => [:string, :boolean, :tsv, :annotations].include?(result_type) ? :raw : :json)
273
285
 
274
286
  sout, sin = Misc.pipe
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.20.15
4
+ version: 5.20.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-20 00:00:00.000000000 Z
11
+ date: 2016-06-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake