scout-gear 10.7.4 → 10.7.6
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 +4 -4
- data/.gitmodules +0 -4
- data/.vimproject +9 -14
- data/Rakefile +1 -4
- data/VERSION +1 -1
- data/lib/scout/association/index.rb +3 -3
- data/lib/scout/entity/identifiers.rb +5 -2
- data/lib/scout/entity/property.rb +1 -1
- data/lib/scout/knowledge_base/description.rb +108 -0
- data/lib/scout/knowledge_base/entity.rb +6 -1
- data/lib/scout/knowledge_base/registry.rb +43 -15
- data/lib/scout/knowledge_base.rb +3 -2
- data/lib/scout/tsv/change_id/translate.rb +9 -2
- data/lib/scout/tsv/open.rb +10 -0
- data/lib/scout/tsv/parser.rb +14 -3
- data/lib/scout/workflow/deployment/orchestrator.rb +9 -1
- data/lib/scout/workflow/deployment/queue.rb +26 -0
- data/lib/scout/workflow/entity.rb +99 -0
- data/lib/scout/workflow/export.rb +72 -0
- data/lib/scout/workflow/persist.rb +6 -0
- data/lib/scout/workflow/step/file.rb +3 -3
- data/lib/scout/workflow/step/info.rb +6 -0
- data/lib/scout/workflow/step/inputs.rb +11 -1
- data/lib/scout/workflow/step/provenance.rb +1 -2
- data/lib/scout/workflow/step/status.rb +1 -0
- data/lib/scout/workflow/step.rb +5 -3
- data/lib/scout/workflow/task/inputs.rb +2 -1
- data/lib/scout/workflow/task.rb +2 -1
- data/lib/scout/workflow.rb +11 -3
- data/lib/scout-gear.rb +5 -1
- data/scout-gear.gemspec +14 -18
- data/scout_commands/kb/config +3 -0
- data/scout_commands/kb/list +1 -0
- data/scout_commands/kb/query +2 -1
- data/scout_commands/kb/register +3 -1
- data/scout_commands/kb/show +4 -2
- data/scout_commands/workflow/cmd +116 -0
- data/scout_commands/workflow/process +82 -0
- data/scout_commands/workflow/task +15 -3
- data/test/data/person/README.md +17 -0
- data/test/scout/knowledge_base/test_description.rb +59 -0
- data/test/scout/workflow/task/test_dependencies.rb +7 -7
- data/test/scout/workflow/test_definition.rb +2 -2
- data/test/scout/workflow/test_entity.rb +58 -0
- data/test/scout/workflow/test_step.rb +1 -1
- metadata +14 -57
- data/lib/scout/offsite/exceptions.rb +0 -9
- data/lib/scout/offsite/ssh.rb +0 -175
- data/lib/scout/offsite/step.rb +0 -100
- data/lib/scout/offsite/sync.rb +0 -55
- data/lib/scout/offsite.rb +0 -3
- data/scout_commands/offsite +0 -30
- data/test/scout/offsite/test_ssh.rb +0 -15
- data/test/scout/offsite/test_step.rb +0 -32
- data/test/scout/offsite/test_sync.rb +0 -36
- data/test/scout/offsite/test_task.rb +0 -0
- data/test/scout/test_offsite.rb +0 -0
@@ -0,0 +1,99 @@
|
|
1
|
+
require 'scout/entity'
|
2
|
+
require 'scout/workflow'
|
3
|
+
|
4
|
+
module EntityWorkflow
|
5
|
+
|
6
|
+
def self.extended(base)
|
7
|
+
base.extend Workflow
|
8
|
+
base.extend Entity
|
9
|
+
|
10
|
+
base.instance_variable_set(:@annotation_inputs, IndiferentHash.setup({})) unless base.instance_variables.include?(:@annotation_inputs)
|
11
|
+
class << base
|
12
|
+
def annotation_input(name, type=nil, desc=nil, default=nil, options = {})
|
13
|
+
annotation name
|
14
|
+
annotation_inputs = self.instance_variable_get("@annotation_inputs")
|
15
|
+
annotation_inputs[name] = [type, desc, default, options]
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
base.helper :entity do
|
20
|
+
base.setup(clean_name.dup, inputs.to_hash)
|
21
|
+
end
|
22
|
+
|
23
|
+
base.helper :entity_list do
|
24
|
+
list = inputs.last
|
25
|
+
list = list.load if Step === list
|
26
|
+
base.setup(list, inputs.to_hash)
|
27
|
+
end
|
28
|
+
|
29
|
+
base.property job: :both do |task_name,options={}|
|
30
|
+
if Array === self && AnnotatedArray === self
|
31
|
+
base.job(task_name, "Default", options.merge(list: self))
|
32
|
+
else
|
33
|
+
base.job(task_name, self, options)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def property_task(task_name, property_type=:single, *args, &block)
|
39
|
+
task_name, result_type = task_name.keys.first, task_name.values.first if Hash === task_name
|
40
|
+
|
41
|
+
annotation_inputs = self.instance_variable_get("@annotation_inputs")
|
42
|
+
self.annotations.each do |annotation|
|
43
|
+
if annotation_inputs[annotation]
|
44
|
+
input annotation, *annotation_inputs[annotation]
|
45
|
+
else
|
46
|
+
input annotation
|
47
|
+
end
|
48
|
+
end
|
49
|
+
case property_type
|
50
|
+
when :single, :single2array
|
51
|
+
input :entity, :string, "#{self.to_s} identifier", nil, jobname: true
|
52
|
+
task(task_name => result_type, &block)
|
53
|
+
when :both
|
54
|
+
input :entity, :string, "#{self.to_s} identifier", nil, jobname: true
|
55
|
+
input :list, :array, "#{self.to_s} identifier list"
|
56
|
+
task(task_name => result_type, &block)
|
57
|
+
else
|
58
|
+
input :list, :array, "#{self.to_s} identifier list"
|
59
|
+
task(task_name => result_type, &block)
|
60
|
+
end
|
61
|
+
|
62
|
+
property task_name => property_type do |*args|
|
63
|
+
job = job(task_name, *args)
|
64
|
+
Array === job ? job.collect(&:run) : job.run
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
def entity_task(task_name, *args, &block)
|
69
|
+
property_task(task_name, :single, *args, &block)
|
70
|
+
end
|
71
|
+
|
72
|
+
def list_task(task_name, *args, &block)
|
73
|
+
property_task(task_name, :array, *args, &block)
|
74
|
+
end
|
75
|
+
|
76
|
+
def multiple_task(task_name, *args, &block)
|
77
|
+
property_task(task_name, :multiple, *args, &block)
|
78
|
+
end
|
79
|
+
|
80
|
+
def property_task_alias(task_name, property_type=:single, *args)
|
81
|
+
task_alias task_name, *args
|
82
|
+
property task_name => property_type do |*args|
|
83
|
+
job = job(task_name, *args)
|
84
|
+
Array === job ? job.collect(&:run) : job.run
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
def entity_task_alias(task_name, *args)
|
89
|
+
property_task_alias(task_name, :single, *args)
|
90
|
+
end
|
91
|
+
|
92
|
+
def list_task_alias(task_name, *args)
|
93
|
+
property_task_alias(task_name, :array, *args)
|
94
|
+
end
|
95
|
+
|
96
|
+
def multiple_task_alias(task_name, *args)
|
97
|
+
property_task_alias(task_name, :multiple, *args)
|
98
|
+
end
|
99
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
module Workflow
|
2
|
+
|
3
|
+
annotation :asynchronous_exports, :synchronous_exports, :exec_exports, :stream_exports
|
4
|
+
|
5
|
+
def asynchronous_exports
|
6
|
+
@asynchronous_exports ||= []
|
7
|
+
end
|
8
|
+
|
9
|
+
def synchronous_exports
|
10
|
+
@synchronous_exports ||= []
|
11
|
+
end
|
12
|
+
|
13
|
+
def exec_exports
|
14
|
+
@exec_exports ||= []
|
15
|
+
end
|
16
|
+
|
17
|
+
def stream_exports
|
18
|
+
@exec_exports ||= []
|
19
|
+
end
|
20
|
+
|
21
|
+
def clear_exports
|
22
|
+
asynchronous_exports.clear
|
23
|
+
synchronous_exports.clear
|
24
|
+
exec_exports.clear
|
25
|
+
stream_exports.clear
|
26
|
+
end
|
27
|
+
|
28
|
+
def all_exports
|
29
|
+
asynchronous_exports + synchronous_exports + exec_exports + stream_exports
|
30
|
+
end
|
31
|
+
|
32
|
+
alias task_exports all_exports
|
33
|
+
|
34
|
+
def unexport(*names)
|
35
|
+
names = names.collect{|n| n.to_s} + names.collect{|n| n.to_sym}
|
36
|
+
names.uniq!
|
37
|
+
exec_exports.replace exec_exports - names if exec_exports
|
38
|
+
synchronous_exports.replace synchronous_exports - names if synchronous_exports
|
39
|
+
asynchronous_exports.replace asynchronous_exports - names if asynchronous_exports
|
40
|
+
stream_exports.replace stream_exports - names if stream_exports
|
41
|
+
end
|
42
|
+
|
43
|
+
def export_exec(*names)
|
44
|
+
unexport *names
|
45
|
+
exec_exports.concat names
|
46
|
+
exec_exports.uniq!
|
47
|
+
exec_exports
|
48
|
+
end
|
49
|
+
|
50
|
+
def export_synchronous(*names)
|
51
|
+
unexport *names
|
52
|
+
synchronous_exports.concat names
|
53
|
+
synchronous_exports.uniq!
|
54
|
+
synchronous_exports
|
55
|
+
end
|
56
|
+
|
57
|
+
def export_asynchronous(*names)
|
58
|
+
unexport *names
|
59
|
+
asynchronous_exports.concat names
|
60
|
+
asynchronous_exports.uniq!
|
61
|
+
asynchronous_exports
|
62
|
+
end
|
63
|
+
|
64
|
+
def export_stream(*names)
|
65
|
+
unexport *names
|
66
|
+
stream_exports.concat names
|
67
|
+
stream_exports.uniq!
|
68
|
+
stream_exports
|
69
|
+
end
|
70
|
+
|
71
|
+
alias export export_asynchronous
|
72
|
+
end
|
@@ -21,13 +21,13 @@ class Step
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def files
|
24
|
-
|
25
|
-
Misc.path_relative_to(files_dir, path)
|
24
|
+
files_dir.glob("**/*").reject{|path| File.directory? path }.collect do |path|
|
25
|
+
Misc.path_relative_to(files_dir, path)
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
29
|
def bundle_files
|
30
|
-
[path, info_file,
|
30
|
+
[path, info_file, files_dir.glob("**/*")].flatten.select{|f| Open.exist?(f) }
|
31
31
|
end
|
32
32
|
|
33
33
|
def copy_linked_files_dir
|
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'time'
|
1
2
|
require 'scout/config'
|
2
3
|
class Step
|
3
4
|
SERIALIZER = Scout::Config.get(:serializer, :step_info, :info, :step, env: "SCOUT_SERIALIZER", default: :json)
|
@@ -74,6 +75,11 @@ class Step
|
|
74
75
|
issued = info[:issued]
|
75
76
|
start = info[:start]
|
76
77
|
eend = new_info[:end]
|
78
|
+
|
79
|
+
start = Time.parse start if String === start
|
80
|
+
eend = Time.parse eend if String === eend
|
81
|
+
issued = Time.parse issued if String === issued
|
82
|
+
|
77
83
|
if start && eend
|
78
84
|
time = eend - start
|
79
85
|
total_time = eend - issued
|
@@ -1,5 +1,15 @@
|
|
1
1
|
class Step
|
2
2
|
def save_inputs(inputs_dir)
|
3
|
-
|
3
|
+
if clean_name != name
|
4
|
+
hash = name[clean_name.length..-1]
|
5
|
+
inputs_dir += hash
|
6
|
+
Log.medium "Saving job inputs to: #{Log.fingerprint inputs_dir}"
|
7
|
+
self.task.save_inputs(inputs_dir, provided_inputs)
|
8
|
+
inputs_dir
|
9
|
+
else
|
10
|
+
Log.medium "Saving no input job: #{Log.fingerprint inputs_dir}"
|
11
|
+
Open.touch(inputs_dir)
|
12
|
+
inputs_dir
|
13
|
+
end
|
4
14
|
end
|
5
15
|
end
|
@@ -108,12 +108,11 @@ class Step
|
|
108
108
|
status = info[:status] || :missing
|
109
109
|
status = status.to_sym if String === status
|
110
110
|
status = :noinfo if status == :missing && Open.exist?(path)
|
111
|
-
status =
|
111
|
+
status = :remote if Open.remote?(path) || Open.ssh?(path)
|
112
112
|
name = info[:name] || File.basename(path)
|
113
113
|
status = :unsync if status == :done and not Open.exist?(path)
|
114
114
|
status = :notfound if status == :noinfo and not Open.exist?(path)
|
115
115
|
|
116
|
-
|
117
116
|
this_step_msg = prov_report_msg(status, name, path, info, input)
|
118
117
|
|
119
118
|
input_dependencies ||= {}
|
data/lib/scout/workflow/step.rb
CHANGED
@@ -75,19 +75,21 @@ class Step
|
|
75
75
|
def clean_name
|
76
76
|
return @id if @id
|
77
77
|
return info[:clean_name] if info.include? :clean_name
|
78
|
-
if m = name.match(/(
|
78
|
+
if m = name.match(/(.+?)(?:_[a-z0-9]{32})?(?:\..*)?$/)
|
79
79
|
return m[1]
|
80
80
|
end
|
81
81
|
return name.split(".").first
|
82
82
|
end
|
83
83
|
|
84
84
|
def task_name
|
85
|
+
return @task_name if @task_name
|
85
86
|
@task_name ||= @task.name if @task.respond_to?(:name)
|
86
87
|
@task_name ||= info[:task_name] if Open.exist?(info_file)
|
87
88
|
@task_name ||= path.split("/")[-2]
|
88
89
|
end
|
89
90
|
|
90
91
|
def workflow
|
92
|
+
return @workflow if @workflow
|
91
93
|
@workflow ||= @task.workflow if Task === @task
|
92
94
|
@workflow ||= info[:workflow] if info_file && Open.exist?(info_file)
|
93
95
|
@workflow ||= path.split("/")[-3]
|
@@ -181,7 +183,7 @@ class Step
|
|
181
183
|
log :start
|
182
184
|
@exec_result = exec
|
183
185
|
|
184
|
-
if @exec_result.nil? &&
|
186
|
+
if @exec_result.nil? && Open.exist?(self.tmp_path) && ! Open.exist?(self.path)
|
185
187
|
Open.mv self.tmp_path, self.path
|
186
188
|
else
|
187
189
|
@exec_result = @exec_result.stream if @exec_result.respond_to?(:stream) && ! (TSV === @exec_result)
|
@@ -263,7 +265,7 @@ class Step
|
|
263
265
|
end
|
264
266
|
|
265
267
|
def done?
|
266
|
-
Open.exist?(path)
|
268
|
+
@done ||= Open.exist?(path)
|
267
269
|
end
|
268
270
|
|
269
271
|
def streaming?
|
@@ -186,7 +186,8 @@ module Task
|
|
186
186
|
seen << name
|
187
187
|
end
|
188
188
|
|
189
|
-
|
189
|
+
directory = Path.setup(directory.dup) unless Path === directory
|
190
|
+
directory.glob("*#*").each do |file|
|
190
191
|
override_dep, _, extension = File.basename(file).partition(".")
|
191
192
|
|
192
193
|
inputs[override_dep] = Task.load_input_from_file(file, :file)
|
data/lib/scout/workflow/task.rb
CHANGED
@@ -34,6 +34,7 @@ module Task
|
|
34
34
|
def job(id = nil, provided_inputs = nil)
|
35
35
|
|
36
36
|
if Hash === provided_inputs
|
37
|
+
IndiferentHash.setup provided_inputs
|
37
38
|
memory_inputs = provided_inputs.values_at *self.recursive_inputs.collect{|t| t.first }.uniq
|
38
39
|
memory_inputs += provided_inputs.select{|k,v| k.to_s.include?("#") }.collect{|p| p * "=" }
|
39
40
|
memory_inputs << provided_inputs[:load_inputs]
|
@@ -41,7 +42,7 @@ module Task
|
|
41
42
|
memory_inputs = provided_inputs
|
42
43
|
end
|
43
44
|
|
44
|
-
Persist.memory("Task job #{self.name}
|
45
|
+
Persist.memory("Task job #{self.name}", repo: Workflow.job_cache, other: {task: self.name, id: id, provided_inputs: memory_inputs}) do
|
45
46
|
provided_inputs, id = id, nil if (provided_inputs.nil? || provided_inputs.empty?) && (Hash === id || Array === id)
|
46
47
|
provided_inputs = {} if provided_inputs.nil?
|
47
48
|
IndiferentHash.setup(provided_inputs)
|
data/lib/scout/workflow.rb
CHANGED
@@ -7,13 +7,21 @@ require_relative 'workflow/usage'
|
|
7
7
|
require_relative 'workflow/deployment'
|
8
8
|
require_relative 'workflow/exceptions'
|
9
9
|
require_relative 'workflow/path'
|
10
|
+
require_relative 'workflow/entity'
|
11
|
+
require_relative 'workflow/export'
|
12
|
+
require_relative 'workflow/persist'
|
10
13
|
|
11
14
|
require 'scout/resource'
|
12
15
|
require 'scout/resource/scout'
|
13
16
|
|
14
17
|
module Workflow
|
15
18
|
class << self
|
16
|
-
attr_accessor :workflows, :main, :workflow_dir, :autoinstall, :workflow_repo
|
19
|
+
attr_accessor :workflows, :main, :workflow_dir, :autoinstall, :workflow_repo, :job_cache
|
20
|
+
|
21
|
+
def job_cache
|
22
|
+
@job_cache ||={}
|
23
|
+
end
|
24
|
+
|
17
25
|
def workflows
|
18
26
|
@workflows ||= []
|
19
27
|
end
|
@@ -50,7 +58,7 @@ module Workflow
|
|
50
58
|
|
51
59
|
end
|
52
60
|
|
53
|
-
attr_accessor :libdir
|
61
|
+
attr_accessor :libdir, :knowledge_base
|
54
62
|
|
55
63
|
def self.extended(base)
|
56
64
|
self.workflows << base
|
@@ -70,7 +78,7 @@ module Workflow
|
|
70
78
|
|
71
79
|
def self.install_workflow(workflow, base_repo_url = nil)
|
72
80
|
case
|
73
|
-
when
|
81
|
+
when Open.exist?(workflow)
|
74
82
|
update_workflow_dir(workflow)
|
75
83
|
else
|
76
84
|
Misc.in_dir(self.workflow_dir) do
|
data/lib/scout-gear.rb
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
require 'scout-essentials'
|
2
2
|
require_relative 'scout/tsv'
|
3
|
-
require_relative 'scout/offsite'
|
4
3
|
|
5
4
|
Path.path_maps[:scout_gear] = File.join(Path.caller_lib_dir(__FILE__), "{TOPLEVEL}/{SUBPATH}")
|
5
|
+
|
6
|
+
Persist.cache_dir = Scout.var.cache.persistence
|
7
|
+
TmpFile.tmpdir = Scout.tmp.find :user
|
8
|
+
Resource.default_resource = Scout
|
9
|
+
|
data/scout-gear.gemspec
CHANGED
@@ -2,17 +2,17 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: scout-gear 10.7.
|
5
|
+
# stub: scout-gear 10.7.6 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "scout-gear".freeze
|
9
|
-
s.version = "10.7.
|
9
|
+
s.version = "10.7.6".freeze
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib".freeze]
|
13
13
|
s.authors = ["Miguel Vazquez".freeze]
|
14
|
-
s.date = "2025-
|
15
|
-
s.description = "
|
14
|
+
s.date = "2025-04-08"
|
15
|
+
s.description = "Scout gear: workflow, TSVs, persistence, entities, associations, and knowledge_bases.".freeze
|
16
16
|
s.email = "mikisvaz@gmail.com".freeze
|
17
17
|
s.executables = ["scout".freeze]
|
18
18
|
s.extra_rdoc_files = [
|
@@ -45,17 +45,13 @@ Gem::Specification.new do |s|
|
|
45
45
|
"lib/scout/entity/object.rb",
|
46
46
|
"lib/scout/entity/property.rb",
|
47
47
|
"lib/scout/knowledge_base.rb",
|
48
|
+
"lib/scout/knowledge_base/description.rb",
|
48
49
|
"lib/scout/knowledge_base/enrichment.rb",
|
49
50
|
"lib/scout/knowledge_base/entity.rb",
|
50
51
|
"lib/scout/knowledge_base/list.rb",
|
51
52
|
"lib/scout/knowledge_base/query.rb",
|
52
53
|
"lib/scout/knowledge_base/registry.rb",
|
53
54
|
"lib/scout/knowledge_base/traverse.rb",
|
54
|
-
"lib/scout/offsite.rb",
|
55
|
-
"lib/scout/offsite/exceptions.rb",
|
56
|
-
"lib/scout/offsite/ssh.rb",
|
57
|
-
"lib/scout/offsite/step.rb",
|
58
|
-
"lib/scout/offsite/sync.rb",
|
59
55
|
"lib/scout/persist/engine.rb",
|
60
56
|
"lib/scout/persist/engine/fix_width_table.rb",
|
61
57
|
"lib/scout/persist/engine/packed_index.rb",
|
@@ -103,10 +99,14 @@ Gem::Specification.new do |s|
|
|
103
99
|
"lib/scout/workflow/definition.rb",
|
104
100
|
"lib/scout/workflow/deployment.rb",
|
105
101
|
"lib/scout/workflow/deployment/orchestrator.rb",
|
102
|
+
"lib/scout/workflow/deployment/queue.rb",
|
106
103
|
"lib/scout/workflow/deployment/trace.rb",
|
107
104
|
"lib/scout/workflow/documentation.rb",
|
105
|
+
"lib/scout/workflow/entity.rb",
|
108
106
|
"lib/scout/workflow/exceptions.rb",
|
107
|
+
"lib/scout/workflow/export.rb",
|
109
108
|
"lib/scout/workflow/path.rb",
|
109
|
+
"lib/scout/workflow/persist.rb",
|
110
110
|
"lib/scout/workflow/step.rb",
|
111
111
|
"lib/scout/workflow/step/archive.rb",
|
112
112
|
"lib/scout/workflow/step/children.rb",
|
@@ -141,14 +141,15 @@ Gem::Specification.new do |s|
|
|
141
141
|
"scout_commands/kb/show",
|
142
142
|
"scout_commands/kb/traverse",
|
143
143
|
"scout_commands/log",
|
144
|
-
"scout_commands/offsite",
|
145
144
|
"scout_commands/rbbt",
|
146
145
|
"scout_commands/resource/produce",
|
147
146
|
"scout_commands/template",
|
148
147
|
"scout_commands/update",
|
148
|
+
"scout_commands/workflow/cmd",
|
149
149
|
"scout_commands/workflow/info",
|
150
150
|
"scout_commands/workflow/install",
|
151
151
|
"scout_commands/workflow/list",
|
152
|
+
"scout_commands/workflow/process",
|
152
153
|
"scout_commands/workflow/prov",
|
153
154
|
"scout_commands/workflow/task",
|
154
155
|
"scout_commands/workflow/trace",
|
@@ -158,6 +159,7 @@ Gem::Specification.new do |s|
|
|
158
159
|
"share/software/install_helpers",
|
159
160
|
"share/templates/command",
|
160
161
|
"share/templates/workflow.rb",
|
162
|
+
"test/data/person/README.md",
|
161
163
|
"test/data/person/brothers",
|
162
164
|
"test/data/person/identifiers",
|
163
165
|
"test/data/person/marriages",
|
@@ -170,16 +172,13 @@ Gem::Specification.new do |s|
|
|
170
172
|
"test/scout/entity/test_named_array.rb",
|
171
173
|
"test/scout/entity/test_object.rb",
|
172
174
|
"test/scout/entity/test_property.rb",
|
175
|
+
"test/scout/knowledge_base/test_description.rb",
|
173
176
|
"test/scout/knowledge_base/test_enrichment.rb",
|
174
177
|
"test/scout/knowledge_base/test_entity.rb",
|
175
178
|
"test/scout/knowledge_base/test_list.rb",
|
176
179
|
"test/scout/knowledge_base/test_query.rb",
|
177
180
|
"test/scout/knowledge_base/test_registry.rb",
|
178
181
|
"test/scout/knowledge_base/test_traverse.rb",
|
179
|
-
"test/scout/offsite/test_ssh.rb",
|
180
|
-
"test/scout/offsite/test_step.rb",
|
181
|
-
"test/scout/offsite/test_sync.rb",
|
182
|
-
"test/scout/offsite/test_task.rb",
|
183
182
|
"test/scout/persist/engine/test_fix_width_table.rb",
|
184
183
|
"test/scout/persist/engine/test_packed_index.rb",
|
185
184
|
"test/scout/persist/engine/test_sharder.rb",
|
@@ -197,7 +196,6 @@ Gem::Specification.new do |s|
|
|
197
196
|
"test/scout/test_association.rb",
|
198
197
|
"test/scout/test_entity.rb",
|
199
198
|
"test/scout/test_knowledge_base.rb",
|
200
|
-
"test/scout/test_offsite.rb",
|
201
199
|
"test/scout/test_semaphore.rb",
|
202
200
|
"test/scout/test_tsv.rb",
|
203
201
|
"test/scout/test_work_queue.rb",
|
@@ -240,6 +238,7 @@ Gem::Specification.new do |s|
|
|
240
238
|
"test/scout/workflow/task/test_inputs.rb",
|
241
239
|
"test/scout/workflow/test_definition.rb",
|
242
240
|
"test/scout/workflow/test_documentation.rb",
|
241
|
+
"test/scout/workflow/test_entity.rb",
|
243
242
|
"test/scout/workflow/test_path.rb",
|
244
243
|
"test/scout/workflow/test_step.rb",
|
245
244
|
"test/scout/workflow/test_task.rb",
|
@@ -260,9 +259,6 @@ Gem::Specification.new do |s|
|
|
260
259
|
s.add_runtime_dependency(%q<net-ssh>.freeze, [">= 0".freeze])
|
261
260
|
s.add_runtime_dependency(%q<matrix>.freeze, [">= 0".freeze])
|
262
261
|
s.add_runtime_dependency(%q<RubyInline>.freeze, [">= 0".freeze])
|
263
|
-
s.add_development_dependency(%q<rdoc>.freeze, ["~> 3.12".freeze])
|
264
|
-
s.add_development_dependency(%q<bundler>.freeze, ["~> 1.0".freeze])
|
265
262
|
s.add_development_dependency(%q<juwelier>.freeze, ["~> 2.1.0".freeze])
|
266
|
-
s.add_development_dependency(%q<simplecov>.freeze, [">= 0".freeze])
|
267
263
|
end
|
268
264
|
|
data/scout_commands/kb/config
CHANGED
@@ -12,6 +12,7 @@ Configure a knowlege base
|
|
12
12
|
$ #{$0} [<options>] <name> [knowledge_base]
|
13
13
|
|
14
14
|
-h--help Print this help
|
15
|
+
-kb--knowledge_base* Knowlege base name (or :default)
|
15
16
|
-i--identifier_files* Identifier files separated by ','
|
16
17
|
-n--namespace* Namespace
|
17
18
|
EOF
|
@@ -26,8 +27,10 @@ end
|
|
26
27
|
|
27
28
|
knowledge_base_name = ARGV.first
|
28
29
|
|
30
|
+
knowledge_base_name ||= options[:knowledge_base] || :default
|
29
31
|
knowledge_base = KnowledgeBase.load knowledge_base_name || :default
|
30
32
|
|
31
33
|
knowledge_base.namespace = options[:namespace] if options.include? :namespace
|
32
34
|
knowledge_base.identifier_files += options[:identifier_files].split(",") if options.include? :identifier_files
|
35
|
+
knowledge_base.identifier_files.uniq!
|
33
36
|
knowledge_base.save
|
data/scout_commands/kb/list
CHANGED
data/scout_commands/kb/query
CHANGED
@@ -34,7 +34,8 @@ raise MissingParameterException, :name if name.nil?
|
|
34
34
|
raise MissingParameterException, :entity if entity.nil?
|
35
35
|
|
36
36
|
|
37
|
-
knowledge_base =
|
37
|
+
knowledge_base = IndiferentHash.process_options options, :knowledge_base
|
38
|
+
knowledge_base = KnowledgeBase.load knowledge_base || :default
|
38
39
|
|
39
40
|
list = IndiferentHash.process_options options, :list
|
40
41
|
|
data/scout_commands/kb/register
CHANGED
@@ -19,6 +19,7 @@ $ #{$0} [<options>] <name> <filename>
|
|
19
19
|
-n--namespace* Namespace
|
20
20
|
-i--identifiers* Identifiers
|
21
21
|
-u--undirected
|
22
|
+
-d--description* Database description
|
22
23
|
EOF
|
23
24
|
if options.delete :help
|
24
25
|
if defined? scout_usage
|
@@ -35,7 +36,8 @@ name, file = ARGV
|
|
35
36
|
raise MissingParameterException, :name if name.nil?
|
36
37
|
raise MissingParameterException, :file if file.nil?
|
37
38
|
|
38
|
-
knowledge_base =
|
39
|
+
knowledge_base = IndiferentHash.process_options options, :knowledge_base
|
40
|
+
knowledge_base = KnowledgeBase.load knowledge_base || :default
|
39
41
|
|
40
42
|
options[:fields] = options[:fields].split(/,\s*/) if options[:fields]
|
41
43
|
file = Scout.identify(File.expand_path(file))
|
data/scout_commands/kb/show
CHANGED
@@ -23,7 +23,8 @@ if options[:help]
|
|
23
23
|
exit 0
|
24
24
|
end
|
25
25
|
|
26
|
-
knowledge_base =
|
26
|
+
knowledge_base = IndiferentHash.process_options options, :knowledge_base
|
27
|
+
knowledge_base = KnowledgeBase.load knowledge_base || :default
|
27
28
|
|
28
29
|
name = ARGV.first
|
29
30
|
|
@@ -31,7 +32,8 @@ if name.nil?
|
|
31
32
|
puts knowledge_base.all_databases * "\n"
|
32
33
|
else
|
33
34
|
|
34
|
-
raise ParameterException "Database #{name} not found Options: #{Log.fingerprint knowledge_base.all_databases}" unless knowledge_base.include? name
|
35
|
+
raise ParameterException, "Database #{name} not found Options: #{Log.fingerprint knowledge_base.all_databases}" unless knowledge_base.include? name
|
35
36
|
|
37
|
+
puts knowledge_base.markdown(name)
|
36
38
|
Log.tsv knowledge_base.get_database(name, options)
|
37
39
|
end
|