rbbt-rest 1.7.1 → 1.7.2

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: 8c139ee7ae135774da4d4aa3f19b32c555cc2e31
4
- data.tar.gz: ec59edba9570e29d45712ebac290836885af5bf5
3
+ metadata.gz: 59c0ed2d456a49f6418d29a6264603d9975f739d
4
+ data.tar.gz: 3886dd197d5d6b6ea33f471c3edca6397fc682ae
5
5
  SHA512:
6
- metadata.gz: 86574f5cd8fc1afc2bc10a543335a58b5a68e6017207156d7d14fbcb3a6a20a243ef62990d38bb67cbf01c0326c8d70e04c1c872ce6c553008ce2150ff3335ef
7
- data.tar.gz: 9c99fac76fea29fd8d9bcee055eb8ebc120ca872af6ab34781e532dbddcc22ee8b65a9cd396939016cb2217512b78317c7ec7a39d339a25b51b60d28bdcc922b
6
+ metadata.gz: 58719858ad8424352f9ba49bded0b74e8d466e1d382aba478366e02e646a2fd807e43b2617ac5a4f3d8c4518c0f96841242d82a2d11b45b9d18bc424fe7b058b
7
+ data.tar.gz: 40ba3da4b639c982216228cf61f5286543ceb7d5aa335617154ccc3a9b3b6be145b67f5fcace57971cf866a51c9ecd6d3653082f4f7e9a018a21bebfb4fb539a
@@ -25,6 +25,7 @@ module RbbtRESTHelpers
25
25
 
26
26
  result = render template_file, {:job => job}, layout_file
27
27
 
28
+ content_type :html
28
29
  halt code, result
29
30
  else
30
31
  content_type :text
@@ -195,7 +195,6 @@ module Sinatra
195
195
  raise e unless @format == :html
196
196
 
197
197
  content_type "text"
198
-
199
198
  halt 500, [e.class.to_s, e.message] * " => " << "\n\n" << (e.backtrace * "\n").gsub('`',"'")
200
199
  end
201
200
 
@@ -419,6 +419,5 @@ body
419
419
 
420
420
  td
421
421
  &.true
422
- color: green
423
- &.false
424
- color: red
422
+ font-weight: bold
423
+
@@ -21,4 +21,5 @@
21
21
  - *Numeric comparison*: lower of grater than (e.g. `< 0.1` or `>= 2`)
22
22
  - *Names*: for entities with names, such as genes or pathways; regular expression accepted (e.g. `:name: SF3B1` or `:name: /CDK\d/`)
23
23
  - *Length*: for lists (e.g. `:length: > 2`)
24
+ - *Negation*: Any of the rules above can be negated by prepending the `!` character (e.g. `!:name:/^IG/`)
24
25
 
@@ -1,7 +1,7 @@
1
1
  function fit_content(){
2
2
  var height = window.innerHeight - $('footer').outerHeight(true);
3
3
  var top_offset = $('#content').get()[0].offsetTop
4
- $('#content').css('min-height', height - top_offset)
4
+ $('#content').css('min-height', height - top_offset - 48)
5
5
  $('#top_menu dl.rbbt_menu').css('max-height', height - 100)
6
6
  }
7
7
 
@@ -49,22 +49,22 @@ aes_module.get_list_aesthetics = function(list, rules) {
49
49
  promise = list.property(rule.property, args)
50
50
 
51
51
  if (undefined === extract){
52
- promises.push(promise.then(result[aes]))
52
+ promises.push(promise.then(result[aes], rbbt.exception.report))
53
53
  }else{
54
- promises.push(promise.then(function(v){return v.map(extract)}).then(result[aes]))
54
+ promises.push(promise.then(function(v){return v.map(extract)}).then(result[aes], rbbt.exception.report))
55
55
  }
56
56
  }
57
57
 
58
58
  if (rule.workflow){
59
59
  promise = rbbt.job(rule.workflow, rule.task, args,true)
60
60
  if (undefined === extract){
61
- promises.push(promise.then(result[aes]))
61
+ promises.push(promise.then(result[aes], rbbt.exception.report))
62
62
  }else{
63
63
  promises.push(m.sync([list.get(), promise]).then(function(res){
64
64
  list_info = res[0]
65
65
  data = res[1]
66
66
  return list_info.entities.map(function(e){ return extract.call(null, data, e) })
67
- }).then(result[aes]))
67
+ }).then(result[aes], rbbt.exception.report))
68
68
  }
69
69
  }
70
70
 
@@ -108,7 +108,7 @@ aes_module.get_list_aesthetics = function(list, rules) {
108
108
  mapped_result[aes] = rbbt.aesthetics.map_aesthetic(values(), mapper)
109
109
  })
110
110
  return mapped_result
111
- }).then(function(){ deferred.resolve(mapped_result) })
111
+ }).then(function(){ deferred.resolve(mapped_result) }, rbbt.exception.report)
112
112
 
113
113
  return deferred.promise
114
114
  }
@@ -1,4 +1,3 @@
1
-
2
1
  rbbt.mlog = function(data){
3
2
  console.log(data)
4
3
  }
@@ -12,19 +11,29 @@ rbbt.ajax = function(params){
12
11
  }
13
12
 
14
13
  rbbt.post = function(url, data, params){
15
- var formData = new FormData()
14
+ var request_params
15
+ if (typeof url === 'object'){
16
+ request_params = url
17
+ if (data) request_params.data = data
18
+ }else{
19
+
20
+ if (undefined === params) params = {}
21
+ if (undefined === params.url) params.url = url
16
22
 
17
- if (undefined === params) params = {}
18
- if (undefined === params.method) params.method = 'POST'
19
- if (undefined === params.url) params.url = url
20
- if (undefined === params.serialize) params.serialize = function(formData) {return formData}
23
+ request_params = {url: url, method: "POST", data: data, serialize: function(formData){return formData} }
24
+ }
21
25
 
26
+ if (undefined === request_params.method) request_params.method = 'POST'
27
+ if (undefined === request_params.serialize) request_params.serialize = function(formData) {return formData}
22
28
 
23
- forHash(data, function(key,value){
24
- formData.append(key, value)
25
- })
29
+ if (request_params.data){
30
+ var formData = new FormData()
31
+ forHash(request_params.data, function(key,value){
32
+ formData.append(key, value)
33
+ })
34
+ request_params.data = formData
35
+ }
26
36
 
27
- var request_params = {url: url, method: "POST", data: formData, serialize: function(formData){return formData} }
28
37
  return rbbt.ajax(request_params)
29
38
  }
30
39
 
@@ -50,7 +59,7 @@ rbbt.insist_request = function(params, deferred, timeout, missing){
50
59
  if (params.data !== undefined && params.data['_update'] !== undefined) params.data['_update'] = undefined
51
60
  setTimeout(function(){ m.redraw(); rbbt.insist_request(params, deferred,timeout*2.5) }, timeout)
52
61
  }else{
53
- deferred.reject(new Error(xhr.statusText))
62
+ deferred.reject(new Error("Status " + xhr.status + " in '" + params.url + "': " + xhr.statusText))
54
63
  }
55
64
  }
56
65
  )
@@ -8,11 +8,12 @@ var Entity = function(data){
8
8
 
9
9
  this.type = data.type
10
10
  this.format = data.format
11
+
11
12
  if (undefined === data.info)
12
13
  this.info = {}
13
14
  else
14
15
  this.info = data.info
15
- this.info = {}
16
+
16
17
  if (this.format === undefined && this.info !== undefined) this.format = this.info['format']
17
18
 
18
19
  this.full_type = function(){
@@ -29,6 +29,6 @@ rbbt.try = function(func){
29
29
  }
30
30
 
31
31
  rbbt.do_try = function(func){
32
- rbbt.try(func)()
32
+ return rbbt.try(func)()
33
33
  }
34
34
 
@@ -39,7 +39,7 @@ fav_module.toggleFavourite_entity = function(){
39
39
  var entity = rbbt.page.entity();
40
40
 
41
41
  if (fav_module.isFavourite_entity(entity)){
42
- rbbt.post({url: '/remove_favourite_entity/' + entity.type + '/' + clean_element(entity.code)}).then(fav_module.update)
42
+ rbbt.post({url: '/remove_favourite_entity/' + entity.type + '/' + clean_element(entity.code), data: entity.info}).then(fav_module.update)
43
43
  }else{
44
44
  rbbt.post({url: '/add_favourite_entity/' + entity.type + '/' + clean_element(entity.code), data: entity.info}).then(fav_module.update)
45
45
  }
@@ -130,16 +130,16 @@ rbbt.plots.association_network = function(nodes, associations){
130
130
  indices[entity.id] = i
131
131
  }
132
132
 
133
- var edges = []
133
+ var links = []
134
134
  forHash(associations, function(key,value){
135
135
  var source = value[0]
136
136
  var target = value[1]
137
137
  var source_index = indices[source]
138
138
  var target_index = indices[target]
139
- edges.push({source: source_index, target: target_index, id: key})
139
+ links.push({source: source_index, target: target_index, id: key})
140
140
  })
141
141
 
142
- return edges
142
+ return links
143
143
  }
144
144
 
145
145
  //{{{ BASIC RULES
@@ -183,7 +183,7 @@ rbbt.plots.svg_wrapper = function(objs){
183
183
  }
184
184
  }
185
185
 
186
- rbbt.plots.tile_obj = function(aes){
186
+ rbbt.plots.card_obj = function(aes){
187
187
  var class_names = ""
188
188
  var style = jQuery.extend({}, aes);
189
189
 
@@ -211,7 +211,7 @@ rbbt.plots.tile_obj = function(aes){
211
211
  rbbt.plots.svg_obj = function(aes){
212
212
  aes.width = '300px'
213
213
  aes.height = '200px'
214
- var tile = rbbt.plots.tile_obj(aes)
214
+ var tile = rbbt.plots.card_obj(aes)
215
215
 
216
216
  var location = {x: aes.x, y: aes.y}
217
217
  if (undefined === location.x) location.x = Math.random() * 1000
@@ -262,7 +262,7 @@ rbbt.plots.d3js_graph = function(graph, object){
262
262
  var node = svg.selectAll(".node").data(graph.nodes).enter()
263
263
  .append("foreignObject").attr("class", "node")
264
264
  .attr('width',xsize)
265
- .attr('height',ysize).html(function(d){ return mrender(rbbt.plots.tile_obj(d)) })
265
+ .attr('height',ysize).html(function(d){ return mrender(rbbt.plots.card_obj(d)) })
266
266
  .call(force.drag)
267
267
 
268
268
 
@@ -336,7 +336,7 @@ rbbt.plots.d3js_group_graph = function(graph, object){
336
336
  var node = svg.selectAll(".node").data(graph.nodes).enter()
337
337
  .append("foreignObject").attr("class", "node")
338
338
  .attr('width',xsize)
339
- .attr('height',ysize).html(function(d){ return mrender(rbbt.plots.tile_obj(d)) })
339
+ .attr('height',ysize).html(function(d){ return mrender(rbbt.plots.card_obj(d)) })
340
340
  .call(force.drag)
341
341
 
342
342
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbbt-rest
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.1
4
+ version: 1.7.2
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-09-30 00:00:00.000000000 Z
11
+ date: 2015-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake