lib/rbbt/rest/client.rb in rbbt-rest-1.1.4 vs lib/rbbt/rest/client.rb in rbbt-rest-1.1.5

- old
+ new

@@ -34,12 +34,16 @@ end def self.get_json(url, params = {}) Log.debug("RestClient get_json #{}: #{ url } - #{params.inspect}") params = params.merge({ :_format => 'json' }) - res = RestClient.get(url, :params => params) begin + res = RestClient.get(url, :params => params) + rescue => e + raise JSON.parse(e.response)["message"] + end + begin JSON.parse(res) rescue res end end @@ -173,10 +177,14 @@ def to_s name end + def workflow_description + WorkflowRESTClient.get_raw(File.join(url, 'description')) + end + def task_info(task) @task_info ||= {} @task_info[task] if @task_info[task].nil? @@ -299,14 +307,5 @@ task.doc(dependencies) end end end - -if __FILE__ == $0 - client = WorkflowRESTClient.new("http://darthcaedus:9292/Sequence", "Sequence") - - job = client.job(:genes_at_genomic_positions, "1", :organism => "Hsa", :positions => ["2:198266834:R"]).clean.fork - puts job.join.load.to_s - -end -