rbbt-util 5.27.13 → 5.28.0

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
  SHA256:
3
- metadata.gz: 99b1ad9e8d9403c7f77e22b16497456324c340b08122b765033530f713e35c3c
4
- data.tar.gz: 2d33590e395b9ca715e1c16d509d0a62a1ebeab2315b700ff4377a08803c89af
3
+ metadata.gz: fae2c7a6c6a64059a77fd43d0edf3c6b3a5835cea870b58ddf07a8e24deec18c
4
+ data.tar.gz: d92b6fbda894fd77dd5e69b391a1087e3401864f20a7422f92443fd01cc6b03b
5
5
  SHA512:
6
- metadata.gz: '097ce6c8c16c17441f5a8748ba4ab33afecf6d22d4d54c7ce53475cd642407ae5013346ba482f7fa9375176ab6790febfe030e9f7959ba7b928b5d3762382237'
7
- data.tar.gz: 2fb616d7d66fc2eb979c9911921faecf163f51dd3323ac127265bcaefd0e8a4e3aab9ef41cc9bdf8bd351d44d4ef2cc388c692d5dc9a2d1b811155f21e3f0889
6
+ metadata.gz: 1d3e95466731e2b8f1af738d6d689b81145d462a3b2cc6b755533f1b7bccd413bc76e2af80f053e8685afe527a582905271b2661f132b271a53491b60f024005
7
+ data.tar.gz: ca684d7817e67d324ae6767c8b802e2065855915cc541db5f65b070ef47d7862e98b0acc4e991cef38bd65e97ac1224bdcd03e1e4cc1211e937023bd1757e4a8
@@ -74,7 +74,7 @@ module Annotated
74
74
 
75
75
  object = case
76
76
  when literal_pos
77
- values[literal_pos]
77
+ values[literal_pos].tap{|o| o.force_encoding(Encoding.default_external)}
78
78
  else
79
79
  id.dup
80
80
  end
@@ -119,7 +119,7 @@ module Annotated
119
119
  fields = AnnotatedArray === annotations ? annotations.annotations : annotations.compact.first.annotations
120
120
  fields << :annotation_types
121
121
 
122
- when (fields == [:literal] and not annotations.compact.empty?)
122
+ when (fields == [:literal] and ! annotations.compact.empty?)
123
123
  fields << :literal
124
124
 
125
125
  when (fields == [:all] && Annotated === annotations)
@@ -13,7 +13,7 @@ module Path
13
13
  string.resource = resource
14
14
  string.search_paths = search_paths
15
15
  string.search_order = search_order
16
- string.libdir = libdir || Path.caller_lib_dir
16
+ string.libdir = libdir || Path.caller_lib_dir
17
17
  string
18
18
  end
19
19
 
@@ -52,11 +52,11 @@ module Path
52
52
  def join(name)
53
53
  raise "Invalid path: #{ self }" if self.nil?
54
54
  new = if self.empty?
55
- self.annotate name.to_s.dup
55
+ self.annotate name.to_s.dup.chomp
56
56
  else
57
- self.annotate File.join(self, name.to_s)
57
+ self.annotate File.join(self, name.to_s.chomp)
58
58
  end
59
- new.original = File.join(self.original, name.to_s) if self.original
59
+ new.original = File.join(self.original, name.to_s.chomp) if self.original
60
60
  new
61
61
  end
62
62
 
@@ -1,6 +1,6 @@
1
1
  module Path
2
2
 
3
- def self.caller_lib_dir(file = nil, relative_to = 'lib')
3
+ def self.caller_lib_dir(file = nil, relative_to = ['lib', 'bin'])
4
4
  file = caller.reject{|l|
5
5
  l =~ /rbbt\/(?:resource\.rb|workflow\.rb)/ or
6
6
  l =~ /rbbt\/resource\/path\.rb/ or
@@ -9,13 +9,14 @@ module Path
9
9
  l =~ /progress-monitor\.rb/
10
10
  }.first.sub(/\.rb[^\w].*/,'.rb') if file.nil?
11
11
 
12
+ relative_to = [relative_to] unless Array === relative_to
12
13
  file = File.expand_path(file)
13
- return Path.setup(file) if File.exist? File.join(file, relative_to)
14
+ return Path.setup(file) if relative_to.select{|d| File.exist? File.join(file, d)}.any?
14
15
 
15
16
  while file != '/'
16
17
  dir = File.dirname file
17
18
 
18
- return dir if File.exist? File.join(dir, relative_to)
19
+ return dir if relative_to.select{|d| File.exist? File.join(dir, d)}.any?
19
20
 
20
21
  file = File.dirname file
21
22
  end
@@ -43,7 +43,11 @@ etc_dir = Rbbt.etc
43
43
  load_file etc_dir['app.d/pre.rb'].find
44
44
 
45
45
  app.get '/' do
46
- redirect to(File.join('/', wf.to_s))
46
+ begin
47
+ template_render('main', params, 'main', :cache_type => :asynchronous)
48
+ rescue TemplateMissing
49
+ redirect to(File.join('/', wf.to_s))
50
+ end
47
51
  end
48
52
 
49
53
  #{{{ BASE
@@ -69,11 +69,11 @@ class TestTSV < Test::Unit::TestCase
69
69
  end
70
70
 
71
71
  def test_libdir
72
- assert File.exist? TestResource[].share.Rlib["util.R"].find :lib
73
- assert File.exist? TestResource[].share.Rlib["util.R"].find
72
+ assert File.exist?(TestResource[].share.Rlib["util.R"].find(:lib))
73
+ assert File.exist?(TestResource[].share.Rlib["util.R"].find)
74
74
  end
75
75
 
76
- def test_server
76
+ def __test_server
77
77
  require 'rbbt/sources/organism'
78
78
  TmpFile.with_file :extension => 'gz' do |tmp|
79
79
  Organism.get_from_server("Hsa/b37/known_sites/dbsnp_138.vcf.gz", tmp, 'http://rbbt.bsc.es')
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.27.13
4
+ version: 5.28.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-16 00:00:00.000000000 Z
11
+ date: 2020-07-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake