rbbt-rest 1.8.91 → 1.8.92
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '048ae260816f8427d1754ff663cf796eb92d1131'
|
4
|
+
data.tar.gz: 168227880c00885ec5f648674f54c23a90835a9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4f00d35135c9ba95a4b8d63c3054126379e80964c96408f1da33a6c4b05b8da42382dabf602d6676d95f6e19cef6c69a1b25268de68c61a1cadea3319132691
|
7
|
+
data.tar.gz: dc6d1ab5e97a102b4dc51f78db88da8693e80c601028b6260d084b537f8462c46dd351fa6362432f9c72a9905b60cf80625b9b3da47626fe3e6a09d3e6019ee2
|
data/lib/rbbt/rest/helpers.rb
CHANGED
@@ -1,5 +1,26 @@
|
|
1
1
|
module Sinatra
|
2
2
|
module RbbtMiscHelpers
|
3
|
+
def file_mimetype(path)
|
4
|
+
require 'mimemagic'
|
5
|
+
mime = nil
|
6
|
+
Open.open(path) do |io|
|
7
|
+
begin
|
8
|
+
mime = MimeMagic.by_path(io)
|
9
|
+
if mime.nil?
|
10
|
+
io.rewind
|
11
|
+
mime = MimeMagic.by_magic(io)
|
12
|
+
end
|
13
|
+
if mime.nil?
|
14
|
+
io.rewind
|
15
|
+
mime = "text/tab-separated-values" if io.gets =~ /^#/ and io.gets.include? "\t"
|
16
|
+
end
|
17
|
+
rescue Exception
|
18
|
+
Log.exception $!
|
19
|
+
end
|
20
|
+
end
|
21
|
+
mime
|
22
|
+
end
|
23
|
+
|
3
24
|
def OR_matrices(m1, m2)
|
4
25
|
samples = m1.fields
|
5
26
|
new = TSV.setup({}, :key_field => "Ensembl Gene ID", :fields => samples)
|
@@ -144,8 +144,9 @@ module WorkflowRESTHelpers
|
|
144
144
|
content_type "text/tab-separated-values"
|
145
145
|
job.path ? send_file(job.path) : halt(200, job.load.to_s)
|
146
146
|
when :literal, :raw
|
147
|
-
content_type "text/plain"
|
148
147
|
path = job.path
|
148
|
+
mime = file_mimetype path
|
149
|
+
content_type mime || "text/plain"
|
149
150
|
if job.path
|
150
151
|
if Open.remote? job.path
|
151
152
|
Open.open(job.path, :nocache => true)
|
data/lib/rbbt/rest/workflow.rb
CHANGED
@@ -278,24 +278,25 @@ module Sinatra
|
|
278
278
|
|
279
279
|
job = workflow.load_id(File.join(task, job))
|
280
280
|
|
281
|
-
require 'mimemagic'
|
282
281
|
path = job.file(filename)
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
end
|
282
|
+
#require 'mimemagic'
|
283
|
+
#mime = nil
|
284
|
+
#Open.open(path) do |io|
|
285
|
+
# begin
|
286
|
+
# mime = MimeMagic.by_path(io)
|
287
|
+
# if mime.nil?
|
288
|
+
# io.rewind
|
289
|
+
# mime = MimeMagic.by_magic(io)
|
290
|
+
# end
|
291
|
+
# if mime.nil?
|
292
|
+
# io.rewind
|
293
|
+
# mime = "text/tab-separated-values" if io.gets =~ /^#/ and io.gets.include? "\t"
|
294
|
+
# end
|
295
|
+
# rescue Exception
|
296
|
+
# Log.exception $!
|
297
|
+
# end
|
298
|
+
#end
|
299
|
+
mime = file_mimetype(path)
|
299
300
|
content_type mime if mime
|
300
301
|
send_file path
|
301
302
|
end
|
@@ -44,7 +44,8 @@ body
|
|
44
44
|
max-height: calc(100% - 10em)
|
45
45
|
overflow: auto
|
46
46
|
|
47
|
-
|
47
|
+
//@media #{$only-large}
|
48
|
+
@media #{$medium-or-larger}
|
48
49
|
#top_menu > .item.title
|
49
50
|
margin-left: 32px
|
50
51
|
#top_menu > .favourite
|
@@ -186,7 +187,7 @@ table
|
|
186
187
|
width: 100%
|
187
188
|
|
188
189
|
|
189
|
-
@media #{$not-
|
190
|
+
@media #{$not-medium}
|
190
191
|
+small_screen
|
191
192
|
|
192
193
|
#modal
|
@@ -6,9 +6,12 @@ $very-large-screen: 1240px
|
|
6
6
|
|
7
7
|
$not-very-small: "only screen and (min-width: #{$very-small-screen + 1})"
|
8
8
|
$not-small: "only screen and (min-width: #{$small-screen + 1})"
|
9
|
+
$not-medium: "only screen and (max-width: #{$medium-screen - 1})"
|
9
10
|
$not-large: "only screen and (max-width: #{$large-screen - 1})"
|
10
11
|
$not-very-large: "only screen and (max-width: #{$very-large-screen})"
|
11
12
|
|
13
|
+
$medium-or-larger: "only screen and (min-width: #{$medium-screen})"
|
14
|
+
|
12
15
|
$only-very-small: "only screen and (max-width: #{$very-small-screen})"
|
13
16
|
$only-small: "only screen and (max-width: #{$small-screen})"
|
14
17
|
$only-large: "only screen and (min-width: #{$large-screen})"
|
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.
|
4
|
+
version: 1.8.92
|
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-02-
|
11
|
+
date: 2018-02-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|