rbbt-util 5.19.32 → 5.19.34

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: 6b50fdcad01b0985afcfa246e404b061b78f3780
4
- data.tar.gz: cf020e8c4f0769534aa863d6643190f45cc2f9b6
3
+ metadata.gz: 891d8471ba86780e53a5363adac579490a665f05
4
+ data.tar.gz: f80a9947a157c9aaa5b8de42f2119004afe391b1
5
5
  SHA512:
6
- metadata.gz: 4814fa2681aec355019a329abe37fcb2d432f7a771b6634248cf1e364d67b574e1b33cc780cdd2645332904aa591b7262107f5930fe694de0e8ba30996db3aab
7
- data.tar.gz: 68a7b1d97553fa0f4635a90d2fadd2e98fa3e61b402306c1c7c9a3e0a49af83fcc0f0a5818ecd71a5955da2caa8932419a86cf25bb640b913fd4053e5780e136
6
+ metadata.gz: 330ec02481ecae70a0748a0d33f6478576b185a8db7aac15624a2df5473f4762263c320c244f30e80977e377c1daaf82943cb387930e34ee10807107d8a4fbbd
7
+ data.tar.gz: e49d24357ed693a1cedfe88ae3b9c43d92f28080de7cacf627bc6c5aa2bd3d0c072c07c74a30b9a10f7e7c7f6a46b88771f1e3e40d3967cbe5ce2a25f3c7938a
@@ -1,11 +1,3 @@
1
-
2
- #{{{ Require files
3
- Rbbt.etc.requires.read.split("\n").each do |file|
4
- next if file.empty?
5
- Log.debug("requiring #{ file }")
6
- require file
7
- end if Rbbt.etc.requires.exists?
8
-
9
1
  Entity.entity_list_cache = Rbbt.var.sinatra.find.entity_lists
10
2
  Entity.entity_map_cache = Rbbt.var.sinatra.find.entity_maps
11
3
  Entity.entity_property_cache = Rbbt.var.sinatra.find.entity_properties
@@ -0,0 +1,7 @@
1
+ #{{{ Require files
2
+ Rbbt.etc.requires.read.split("\n").each do |file|
3
+ next if file.empty?
4
+ Log.debug("requiring #{ file }")
5
+ require file
6
+ end if Rbbt.etc.requires.exists?
7
+
@@ -108,8 +108,17 @@ module AssociationItem
108
108
  fields = [self.source_type, self.target_type].concat info_fields
109
109
  type = [self.source_type, self.target_type] * "~"
110
110
  tsv = TSV.setup({}, :key_field => type, :fields => fields, :type => :list, :namespace => self.namespace)
111
- self.each do |match|
112
- tsv[match] = [match.source, match.target].concat match.info.values_at(*info_fields)
111
+ index = index(database)
112
+ index.with_unnamed do
113
+ index.chunked_values_at(self).each_with_index do |v,i|
114
+ p = self[i]
115
+ source, _sep, target = p.partition("~")
116
+ if info_fields.empty?
117
+ tsv[p] = [source, target]
118
+ else
119
+ tsv[p] = [source, target].concat v
120
+ end
121
+ end
113
122
  end
114
123
  tsv.entity_options = {:organism => namespace}
115
124
  knowledge_base.entity_options.each do |type,options|
@@ -119,8 +128,8 @@ module AssociationItem
119
128
  end
120
129
 
121
130
  property :filter => :array do |*args,&block|
122
- keys = tsv.select(*args,&block).keys
123
- keys = self.annotate Annotated.purge(keys)
131
+ keys = tsv.with_unnamed do tsv.select(*args,&block).keys end
132
+ keys = self.annotate keys
124
133
  keys
125
134
  end
126
135
 
@@ -359,7 +359,7 @@ module TSV
359
359
  new.entity_options = entity_options
360
360
  new.entity_templates = entity_templates
361
361
 
362
- case
362
+ case
363
363
  when (method.nil? and block_given?)
364
364
  through do |key, values|
365
365
  new[key] = values if invert ^ (yield key, values)
@@ -36,7 +36,8 @@ module TSV
36
36
  end
37
37
 
38
38
  def self.load(string)
39
- return [] if string.nil?
39
+ return nil if string.nil? or string == 'nil'
40
+ return [] if string.empty?
40
41
  string.split("\t", -1)
41
42
  end
42
43
  end
data/share/config.ru CHANGED
@@ -43,6 +43,9 @@ load_file Rbbt.etc['app.d/resources.rb'].find
43
43
  #{{{ KNOWLEDGEBASE
44
44
  load_file Rbbt.etc['app.d/knowledge_bases.rb'].find
45
45
 
46
+ #{{{ REQUIRES
47
+ load_file Rbbt.etc['app.d/requires.rb'].find
48
+
46
49
  #{{{ ENTITIES
47
50
  load_file Rbbt.etc['app.d/entities.rb'].find
48
51
 
@@ -10,7 +10,7 @@ Access workflow knowledge_base
10
10
 
11
11
  $ rbbt workflow knowledge_base <workflow> [<database>] [<action>] [<options>]
12
12
 
13
- Access workflow knowledge base
13
+ Access workflow knowledge base. Allowed actions are: list_databases, summary, and subset
14
14
 
15
15
  -h--help Show this help:
16
16
  -s--source_entities* Source entities
@@ -78,4 +78,6 @@ when :subset
78
78
  end
79
79
  end
80
80
  end
81
+ else
82
+ raise ParameterException, "Action not understood: #{ action }"
81
83
  end
@@ -14,8 +14,6 @@ require 'rbbt/rest/knowledge_base'
14
14
  require 'rbbt/rest/helpers'
15
15
  require 'rbbt/rest/web_tool'
16
16
 
17
- #options = SOPT.get "-e--environment*:-p--port*:-s--server*:-b--bind*:-e--environment*:-R--RServe_session*:--finder:--views*:-w--workflows*"
18
-
19
17
  options = SOPT.setup <<EOF
20
18
  Start an rbbt app
21
19
 
@@ -69,6 +67,10 @@ app.use Rack::Deflater
69
67
 
70
68
  load Rbbt.etc['app.d/resources.rb'].find
71
69
 
70
+ load Rbbt.etc['app.d/requires.rb'].find
71
+
72
+ load Rbbt.etc['app.d/entities.rb'].find
73
+
72
74
  app.class_eval do
73
75
  eval Rbbt.etc['app.d/finder.rb'].read
74
76
  end
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.19.32
4
+ version: 5.19.34
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-15 00:00:00.000000000 Z
11
+ date: 2016-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -163,6 +163,7 @@ files:
163
163
  - etc/app.d/grid_system.rb
164
164
  - etc/app.d/init.rb
165
165
  - etc/app.d/knowledge_bases.rb
166
+ - etc/app.d/requires.rb
166
167
  - etc/app.d/resources.rb
167
168
  - etc/app.d/workflows.rb
168
169
  - lib/rbbt-util.rb