rbbt-rest 1.8.86 → 1.8.87

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: 5f992a5bedb7eb7cb75080e64e7ffc3791e52ef1
4
- data.tar.gz: ebd1c53873f465bb9f0946ef2cdb52c9f358fa50
3
+ metadata.gz: 02bd7ca8389f245e9d2bdb17c6a9a67b10269885
4
+ data.tar.gz: 6cfef4900c5cbecea20d709e1672842d05f3aae4
5
5
  SHA512:
6
- metadata.gz: fb2e226c20511d46c3de45f68c79e391e22cd1a21038e073dd2371f3e0a4b42e427c66589758d08ffee95db35cec7c7285de7990127209f55cb8fa378163f687
7
- data.tar.gz: 0f269712f47d2e2b7d190b334f83327a9e7857a34c56aa866b80fd706a362f32eb4411a73f8c644cdc2fc203c813b348d746de71bc21331f1ae444e42de60c04
6
+ metadata.gz: 92b890911964c494c9fa241d3957a80e9c02e67e1d4441d8541e483aa66d7f6f4d89d8446107dad3167de66550e8b376a26dcb1da3cafc3a2ed9e6924ddce4d1
7
+ data.tar.gz: 3ac8bb868099572754b46268a05b3b696e9c02ac0a923b7354667b25a5b6441470c14e068b9e31d3bfbeff10e1f07334c37102e39bb16226c85f0ddf71778fba
@@ -185,6 +185,26 @@ module RbbtRESTHelpers
185
185
  send_file excel_file, :type => 'application/vnd.ms-excel', :filename => 'table.xls'
186
186
  else
187
187
  content_type "text/html"
188
+
189
+ require 'mimemagic'
190
+ mime = nil
191
+ Open.open(fragment_file) do |io|
192
+ begin
193
+ mime = MimeMagic.by_path(io)
194
+ if mime.nil?
195
+ io.rewind
196
+ mime = MimeMagic.by_magic(io)
197
+ end
198
+ if mime.nil?
199
+ io.rewind
200
+ mime = "text/tab-separated-values" if io.gets =~ /^#/ and io.gets.include? "\t"
201
+ end
202
+ rescue Exception
203
+ Log.exception $!
204
+ end
205
+ end
206
+
207
+ content_type mime if mime
188
208
  send_file fragment_file
189
209
  end
190
210
  elsif Open.exists?(fragment_file + '.error')
@@ -145,7 +145,8 @@ rbbt.plots.graph.view_cytoscapejs = function(graph_model, elem, style, layout, e
145
145
 
146
146
  var cy = cytoscape(cy_params)
147
147
 
148
- cy.layout(default_layout)
148
+ console.log(layout)
149
+ cy.layout(layout)
149
150
 
150
151
  cy.one('layoutready', function(){
151
152
  deferred.resolve(this)
@@ -12,14 +12,19 @@ rbbt.graph_model = function(){
12
12
 
13
13
  prot._collect_values = function(values, codes){
14
14
  var res = [];
15
- forArray(codes, function(code){
16
- if (typeof values === 'function'){
17
- res.push(values(code))
18
- }else{
19
- res.push(values[code])
20
- }
21
- })
22
- return res
15
+
16
+ if (Array.isArray(values)){
17
+ return values
18
+ }else{
19
+ forArray(codes, function(code){
20
+ if (typeof values === 'function'){
21
+ res.push(values(code))
22
+ }else{
23
+ res.push(values[code])
24
+ }
25
+ })
26
+ return res
27
+ }
23
28
  }
24
29
 
25
30
  //{{{ Add elements
@@ -7,6 +7,10 @@
7
7
 
8
8
  - filename += '.png' unless filename =~ /\.png$/i
9
9
  = resource filename, text, :image do |filename|
10
- - data.R "rbbt.png_plot('#{filename}', '#{plot}', width=#{width}, height=#{height})"
10
+ - TmpFile.with_file(plot) do |plot_file|
11
+ - if defined? data
12
+ - data.R "rbbt.require('readr'); plot_str <- read_file('#{ plot_file }'); rbbt.png_plot('#{filename}', plot_str, width=#{width}, height=#{height})"
13
+ - else
14
+ - R.run "rbbt.require('readr'); plot_str <- read_file('#{ plot_file }'); rbbt.png_plot('#{filename}', plot_str, width=#{width}, height=#{height})"
11
15
 
12
16
 
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.8.86
4
+ version: 1.8.87
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-03 00:00:00.000000000 Z
11
+ date: 2018-01-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake