scout-gear 10.7.3 → 10.7.5

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.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/.gitmodules +0 -4
  3. data/.vimproject +3 -14
  4. data/Rakefile +1 -4
  5. data/VERSION +1 -1
  6. data/bin/scout +15 -2
  7. data/lib/scout/association/index.rb +1 -1
  8. data/lib/scout/association.rb +5 -2
  9. data/lib/scout/entity/identifiers.rb +5 -2
  10. data/lib/scout/entity/property.rb +2 -3
  11. data/lib/scout/knowledge_base/entity.rb +12 -3
  12. data/lib/scout/knowledge_base/registry.rb +3 -1
  13. data/lib/scout/persist/engine/tokyocabinet.rb +85 -77
  14. data/lib/scout/persist/tsv/adapter/base.rb +8 -22
  15. data/lib/scout/tsv/change_id/translate.rb +8 -2
  16. data/lib/scout/tsv/open.rb +2 -0
  17. data/lib/scout/tsv/parser.rb +10 -0
  18. data/lib/scout/tsv/transformer.rb +12 -0
  19. data/lib/scout/tsv/util/process.rb +2 -2
  20. data/lib/scout/workflow/definition.rb +6 -2
  21. data/lib/scout/workflow/deployment/trace.rb +1 -1
  22. data/lib/scout/workflow/entity.rb +99 -0
  23. data/lib/scout/workflow/export.rb +66 -0
  24. data/lib/scout/workflow/step/dependencies.rb +3 -6
  25. data/lib/scout/workflow/step/file.rb +3 -3
  26. data/lib/scout/workflow/step/info.rb +12 -2
  27. data/lib/scout/workflow/step/provenance.rb +1 -2
  28. data/lib/scout/workflow/step/status.rb +1 -0
  29. data/lib/scout/workflow/step.rb +5 -3
  30. data/lib/scout/workflow/task/info.rb +99 -0
  31. data/lib/scout/workflow/task/inputs.rb +2 -1
  32. data/lib/scout/workflow/task.rb +1 -0
  33. data/lib/scout/workflow.rb +4 -2
  34. data/lib/scout-gear.rb +5 -1
  35. data/scout-gear.gemspec +10 -19
  36. data/scout_commands/doc +3 -3
  37. data/scout_commands/workflow/task +7 -2
  38. data/test/scout/knowledge_base/test_list.rb +4 -4
  39. data/test/scout/knowledge_base/test_registry.rb +19 -0
  40. data/test/scout/persist/test_tsv.rb +1 -0
  41. data/test/scout/test_association.rb +15 -0
  42. data/test/scout/test_tsv.rb +15 -0
  43. data/test/scout/tsv/test_parser.rb +4 -0
  44. data/test/scout/tsv/test_transformer.rb +13 -0
  45. data/test/scout/workflow/step/test_info.rb +11 -0
  46. data/test/scout/workflow/task/test_dependencies.rb +7 -7
  47. data/test/scout/workflow/task/test_info.rb +22 -0
  48. data/test/scout/workflow/test_definition.rb +2 -2
  49. data/test/scout/workflow/test_entity.rb +58 -0
  50. data/test/scout/workflow/test_step.rb +1 -1
  51. metadata +10 -61
  52. data/lib/scout/offsite/exceptions.rb +0 -9
  53. data/lib/scout/offsite/ssh.rb +0 -175
  54. data/lib/scout/offsite/step.rb +0 -100
  55. data/lib/scout/offsite/sync.rb +0 -55
  56. data/lib/scout/offsite.rb +0 -3
  57. data/scout_commands/offsite +0 -30
  58. data/test/scout/offsite/test_ssh.rb +0 -15
  59. data/test/scout/offsite/test_step.rb +0 -32
  60. data/test/scout/offsite/test_sync.rb +0 -36
  61. data/test/scout/offsite/test_task.rb +0 -0
  62. 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,66 @@
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
+
22
+ def all_exports
23
+ asynchronous_exports + synchronous_exports + exec_exports + stream_exports
24
+ end
25
+
26
+ alias task_exports all_exports
27
+
28
+ def unexport(*names)
29
+ names = names.collect{|n| n.to_s} + names.collect{|n| n.to_sym}
30
+ names.uniq!
31
+ exec_exports.replace exec_exports - names if exec_exports
32
+ synchronous_exports.replace synchronous_exports - names if synchronous_exports
33
+ asynchronous_exports.replace asynchronous_exports - names if asynchronous_exports
34
+ stream_exports.replace stream_exports - names if stream_exports
35
+ end
36
+
37
+ def export_exec(*names)
38
+ unexport *names
39
+ exec_exports.concat names
40
+ exec_exports.uniq!
41
+ exec_exports
42
+ end
43
+
44
+ def export_synchronous(*names)
45
+ unexport *names
46
+ synchronous_exports.concat names
47
+ synchronous_exports.uniq!
48
+ synchronous_exports
49
+ end
50
+
51
+ def export_asynchronous(*names)
52
+ unexport *names
53
+ asynchronous_exports.concat names
54
+ asynchronous_exports.uniq!
55
+ asynchronous_exports
56
+ end
57
+
58
+ def export_stream(*names)
59
+ unexport *names
60
+ stream_exports.concat names
61
+ stream_exports.uniq!
62
+ stream_exports
63
+ end
64
+
65
+ alias export export_asynchronous
66
+ end
@@ -1,5 +1,5 @@
1
1
  class Step
2
- def rec_dependencies(connected = false, seen = [])
2
+ def rec_dependencies(connected = false, seen = Set.new)
3
3
  @rec_dependencies = {}
4
4
  @rec_dependencies[connected] ||= begin
5
5
  direct_deps = []
@@ -8,11 +8,8 @@ class Step
8
8
  next if connected && dep.done? && dep.updated?
9
9
  direct_deps << dep
10
10
  end if dependencies
11
- seen.concat direct_deps.collect{|d| d.path }
12
- seen.uniq!
13
- direct_deps.inject(direct_deps){|acc,d| acc.concat(d.rec_dependencies(connected, seen)); acc }
14
- direct_deps.uniq!
15
- direct_deps
11
+ seen += direct_deps.collect{|d| d.path }
12
+ direct_deps.inject(Set.new(direct_deps)){|acc,d| acc += d.rec_dependencies(connected, seen) }
16
13
  end
17
14
  end
18
15
 
@@ -21,13 +21,13 @@ class Step
21
21
  end
22
22
 
23
23
  def files
24
- Dir.glob(File.join(files_dir, '**', '*')).reject{|path| File.directory? path }.collect do |path|
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, Dir.glob(File.join(files_dir,"**/*"))].flatten.select{|f| Open.exist?(f) }
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,5 +1,6 @@
1
+ require 'scout/config'
1
2
  class Step
2
- SERIALIZER = :marshal
3
+ SERIALIZER = Scout::Config.get(:serializer, :step_info, :info, :step, env: "SCOUT_SERIALIZER", default: :json)
3
4
  def info_file
4
5
  return nil if @path.nil?
5
6
  @info_file ||= begin
@@ -13,7 +14,11 @@ class Step
13
14
  info = begin
14
15
  Persist.load(info_file, SERIALIZER) || {}
15
16
  rescue
16
- {status: :noinfo}
17
+ begin
18
+ Persist.load(info_file, :marshal) || {}
19
+ rescue
20
+ {status: :noinfo}
21
+ end
17
22
  end
18
23
  IndiferentHash.setup(info)
19
24
  end
@@ -69,6 +74,11 @@ class Step
69
74
  issued = info[:issued]
70
75
  start = info[:start]
71
76
  eend = new_info[:end]
77
+
78
+ start = Time.parse start if String === start
79
+ eend = Time.parse eend if String === eend
80
+ issued = Time.parse issued if String === issued
81
+
72
82
  if start && eend
73
83
  time = eend - start
74
84
  total_time = eend - issued
@@ -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 = "remote" if Open.remote?(path) || Open.ssh?(path)
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 ||= {}
@@ -42,6 +42,7 @@ class Step
42
42
  @result = nil
43
43
  @info = nil
44
44
  @info_load_time = nil
45
+ @done = nil
45
46
  Open.rm path if Open.exist_or_link?(path)
46
47
  Open.rm tmp_path if Open.exist_or_link?(tmp_path)
47
48
  Open.rm info_file if Open.exist_or_link?(info_file)
@@ -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(/(.*?)(?:_[a-z0-9]{32})?(?:\..*)?/)
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? && File.exist?(self.tmp_path) && ! File.exist?(self.path)
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?
@@ -0,0 +1,99 @@
1
+ require_relative 'inputs'
2
+ module Workflow
3
+
4
+ def rec_inputs(task_name)
5
+ tasks[task_name].recursive_inputs.collect{|name, _| name }
6
+ end
7
+
8
+ def rec_input_types(task_name)
9
+ tasks[task_name].recursive_inputs.inject({}) do |acc,l|
10
+ name, type, desc, default, options = l
11
+ acc.merge!(name => type) unless acc.include?(name)
12
+ acc
13
+ end
14
+ end
15
+
16
+
17
+ def rec_input_descriptions(task_name)
18
+ tasks[task_name].recursive_inputs.inject({}) do |acc,l|
19
+ name, type, desc, default, options = l
20
+ acc.merge!(name => desc) unless desc.nil? || acc.include?(name)
21
+ acc
22
+ end
23
+ end
24
+
25
+ def rec_input_defaults(task_name)
26
+ tasks[task_name].recursive_inputs.inject({}) do |acc,l|
27
+ name, type, desc, default, options = l
28
+ acc.merge!(name => default) unless default.nil? || acc.include?(name)
29
+ acc
30
+ end
31
+ end
32
+
33
+ def rec_input_options(task_name)
34
+ tasks[task_name].recursive_inputs.inject({}) do |acc,l|
35
+ name, type, desc, default, options = l
36
+ acc.merge!(name => options) unless options.nil? unless acc.include?(name)
37
+ acc
38
+ end
39
+ end
40
+
41
+
42
+ def rec_input_use(task_name)
43
+ input_use = {}
44
+ task = self.tasks[task_name]
45
+ task.inputs.each do |name,_|
46
+ input_use[name] ||= {}
47
+ input_use[name][self] ||= []
48
+ input_use[name][self] << task_name
49
+ end
50
+
51
+ task.deps.inject(input_use) do |acc,p|
52
+ workflow, task_name = p
53
+ next if task_name.nil?
54
+ workflow.rec_input_use(task_name).each do |name,uses|
55
+ acc[name] ||= {}
56
+ uses.each do |workflow, task_names|
57
+ acc[name][workflow] ||= []
58
+ acc[name][workflow].concat(task_names)
59
+ end
60
+ end
61
+ acc
62
+ end if task.deps
63
+
64
+ input_use
65
+ end
66
+ def task_info(name)
67
+ name = name.to_sym
68
+ task = tasks[name]
69
+ raise "No '#{name}' task in '#{self.name}' Workflow" if task.nil?
70
+ id = File.join(self.name, name.to_s)
71
+ @task_info ||= {}
72
+ @task_info[id] ||= begin
73
+ description = task.description
74
+ returns = task.returns
75
+
76
+ inputs = rec_inputs(name).uniq
77
+ input_types = rec_input_types(name)
78
+ input_descriptions = rec_input_descriptions(name)
79
+ input_use = rec_input_use(name)
80
+ input_defaults = rec_input_defaults(name)
81
+ input_options = rec_input_options(name)
82
+ extension = task.extension
83
+
84
+ dependencies = tasks[name].deps
85
+ { :id => id,
86
+ :description => description,
87
+ :inputs => inputs,
88
+ :input_types => input_types,
89
+ :input_descriptions => input_descriptions,
90
+ :input_defaults => input_defaults,
91
+ :input_options => input_options,
92
+ :input_use => input_use,
93
+ :returns => returns,
94
+ :dependencies => dependencies,
95
+ :extension => extension
96
+ }
97
+ end
98
+ end
99
+ end
@@ -186,7 +186,8 @@ module Task
186
186
  seen << name
187
187
  end
188
188
 
189
- Dir.glob(File.join(directory, "*#*")).each do |file|
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)
@@ -3,6 +3,7 @@ require 'scout/named_array'
3
3
  require_relative 'step'
4
4
  require_relative 'task/inputs'
5
5
  require_relative 'task/dependencies'
6
+ require_relative 'task/info'
6
7
 
7
8
  module Task
8
9
  extend Annotation
@@ -7,6 +7,8 @@ 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'
10
12
 
11
13
  require 'scout/resource'
12
14
  require 'scout/resource/scout'
@@ -50,7 +52,7 @@ module Workflow
50
52
 
51
53
  end
52
54
 
53
- attr_accessor :libdir
55
+ attr_accessor :libdir, :knowledge_base
54
56
 
55
57
  def self.extended(base)
56
58
  self.workflows << base
@@ -70,7 +72,7 @@ module Workflow
70
72
 
71
73
  def self.install_workflow(workflow, base_repo_url = nil)
72
74
  case
73
- when File.exist?(workflow)
75
+ when Open.exist?(workflow)
74
76
  update_workflow_dir(workflow)
75
77
  else
76
78
  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.3 ruby lib
5
+ # stub: scout-gear 10.7.5 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "scout-gear".freeze
9
- s.version = "10.7.3".freeze
9
+ s.version = "10.7.5".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-01-17"
15
- s.description = "Temporary files, logs, path, resources, persistence, workflows, TSV, etc.".freeze
14
+ s.date = "2025-03-19"
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 = [
@@ -51,11 +51,6 @@ Gem::Specification.new do |s|
51
51
  "lib/scout/knowledge_base/query.rb",
52
52
  "lib/scout/knowledge_base/registry.rb",
53
53
  "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
54
  "lib/scout/persist/engine.rb",
60
55
  "lib/scout/persist/engine/fix_width_table.rb",
61
56
  "lib/scout/persist/engine/packed_index.rb",
@@ -105,7 +100,9 @@ Gem::Specification.new do |s|
105
100
  "lib/scout/workflow/deployment/orchestrator.rb",
106
101
  "lib/scout/workflow/deployment/trace.rb",
107
102
  "lib/scout/workflow/documentation.rb",
103
+ "lib/scout/workflow/entity.rb",
108
104
  "lib/scout/workflow/exceptions.rb",
105
+ "lib/scout/workflow/export.rb",
109
106
  "lib/scout/workflow/path.rb",
110
107
  "lib/scout/workflow/step.rb",
111
108
  "lib/scout/workflow/step/archive.rb",
@@ -121,6 +118,7 @@ Gem::Specification.new do |s|
121
118
  "lib/scout/workflow/step/status.rb",
122
119
  "lib/scout/workflow/task.rb",
123
120
  "lib/scout/workflow/task/dependencies.rb",
121
+ "lib/scout/workflow/task/info.rb",
124
122
  "lib/scout/workflow/task/inputs.rb",
125
123
  "lib/scout/workflow/usage.rb",
126
124
  "lib/scout/workflow/util.rb",
@@ -140,7 +138,6 @@ Gem::Specification.new do |s|
140
138
  "scout_commands/kb/show",
141
139
  "scout_commands/kb/traverse",
142
140
  "scout_commands/log",
143
- "scout_commands/offsite",
144
141
  "scout_commands/rbbt",
145
142
  "scout_commands/resource/produce",
146
143
  "scout_commands/template",
@@ -175,10 +172,6 @@ Gem::Specification.new do |s|
175
172
  "test/scout/knowledge_base/test_query.rb",
176
173
  "test/scout/knowledge_base/test_registry.rb",
177
174
  "test/scout/knowledge_base/test_traverse.rb",
178
- "test/scout/offsite/test_ssh.rb",
179
- "test/scout/offsite/test_step.rb",
180
- "test/scout/offsite/test_sync.rb",
181
- "test/scout/offsite/test_task.rb",
182
175
  "test/scout/persist/engine/test_fix_width_table.rb",
183
176
  "test/scout/persist/engine/test_packed_index.rb",
184
177
  "test/scout/persist/engine/test_sharder.rb",
@@ -196,7 +189,6 @@ Gem::Specification.new do |s|
196
189
  "test/scout/test_association.rb",
197
190
  "test/scout/test_entity.rb",
198
191
  "test/scout/test_knowledge_base.rb",
199
- "test/scout/test_offsite.rb",
200
192
  "test/scout/test_semaphore.rb",
201
193
  "test/scout/test_tsv.rb",
202
194
  "test/scout/test_work_queue.rb",
@@ -235,9 +227,11 @@ Gem::Specification.new do |s|
235
227
  "test/scout/workflow/step/test_provenance.rb",
236
228
  "test/scout/workflow/step/test_status.rb",
237
229
  "test/scout/workflow/task/test_dependencies.rb",
230
+ "test/scout/workflow/task/test_info.rb",
238
231
  "test/scout/workflow/task/test_inputs.rb",
239
232
  "test/scout/workflow/test_definition.rb",
240
233
  "test/scout/workflow/test_documentation.rb",
234
+ "test/scout/workflow/test_entity.rb",
241
235
  "test/scout/workflow/test_path.rb",
242
236
  "test/scout/workflow/test_step.rb",
243
237
  "test/scout/workflow/test_task.rb",
@@ -249,7 +243,7 @@ Gem::Specification.new do |s|
249
243
  ]
250
244
  s.homepage = "http://github.com/mikisvaz/scout-gear".freeze
251
245
  s.licenses = ["MIT".freeze]
252
- s.rubygems_version = "3.5.23".freeze
246
+ s.rubygems_version = "3.6.5".freeze
253
247
  s.summary = "basic gear for scouts".freeze
254
248
 
255
249
  s.specification_version = 4
@@ -258,9 +252,6 @@ Gem::Specification.new do |s|
258
252
  s.add_runtime_dependency(%q<net-ssh>.freeze, [">= 0".freeze])
259
253
  s.add_runtime_dependency(%q<matrix>.freeze, [">= 0".freeze])
260
254
  s.add_runtime_dependency(%q<RubyInline>.freeze, [">= 0".freeze])
261
- s.add_development_dependency(%q<rdoc>.freeze, ["~> 3.12".freeze])
262
- s.add_development_dependency(%q<bundler>.freeze, ["~> 1.0".freeze])
263
255
  s.add_development_dependency(%q<juwelier>.freeze, ["~> 2.1.0".freeze])
264
- s.add_development_dependency(%q<simplecov>.freeze, [">= 0".freeze])
265
256
  end
266
257
 
data/scout_commands/doc CHANGED
@@ -26,12 +26,12 @@ end
26
26
 
27
27
  module_name = ARGV.first
28
28
  if module_name.nil?
29
- puts Rbbt.doc.lib.scout.glob("**/*.md").collect{|f| File.basename(f.unset_extension) } * "\n"
29
+ puts Scout.doc.lib.scout.glob("**/*.md").collect{|f| File.basename(f.unset_extension) } * "\n"
30
30
  else
31
31
  begin
32
- puts Rbbt.doc.lib.scout[module_name].find_with_extension('md', :lib).read
32
+ puts Scout.doc.lib.scout[module_name].find_with_extension('md', :lib).read
33
33
  rescue
34
- puts Rbbt.doc.lib.scout.glob("**/*.md").select{|f| File.basename(f.unset_extension) == module_name }.first.read
34
+ puts Scout.doc.lib.scout.glob("**/*.md").select{|f| File.basename(f.unset_extension) == module_name }.first.read
35
35
  end
36
36
  end
37
37
 
@@ -19,6 +19,7 @@ $ #{$0} [<options>] <workflow> <task>
19
19
  --nostream Disable job streaming
20
20
  --update Update jobs with newer dependencies
21
21
  --deploy* Deploy mode: serial, local, or SLURM (default 'serial')
22
+ --fork Fork and return path
22
23
  -jn--jobname* Name to use as job identifier
23
24
  -li--load_inputs* Directory with inputs files to load
24
25
  -pf--printpath Print the file path
@@ -39,8 +40,8 @@ task = workflow.tasks[task_name.to_sym] if task_name
39
40
 
40
41
  options[:help] = true if task.nil?
41
42
 
42
- help, provenance, clean, recursive_clean, clean_task, load_inputs, jobname, printpath, deploy, override_deps = IndiferentHash.process_options options,
43
- :help, :provenance, :clean, :recursive_clean, :clean_task, :load_inputs, :jobname, :printpath, :deploy, :override_deps,
43
+ help, provenance, clean, recursive_clean, clean_task, load_inputs, jobname, printpath, deploy, override_deps, do_fork = IndiferentHash.process_options options,
44
+ :help, :provenance, :clean, :recursive_clean, :clean_task, :load_inputs, :jobname, :printpath, :deploy, :override_deps, :fork,
44
45
  :deploy => 'serial'
45
46
 
46
47
  if help
@@ -92,6 +93,10 @@ end
92
93
 
93
94
  if provenance
94
95
  puts Step.prov_report(job)
96
+ elsif do_fork
97
+ job.fork
98
+ puts job.path
99
+ exit 0
95
100
  else
96
101
  case deploy
97
102
  when "serial"
@@ -14,10 +14,10 @@ class TestKnowledgeBaseQuery < Test::Unit::TestCase
14
14
  kb.save_list("bro_and_sis", list)
15
15
  assert_equal list, kb.load_list("bro_and_sis")
16
16
 
17
- assert_include kb.list_files["Person"], "bro_and_sis"
17
+ assert_include kb.lists["Person"], "bro_and_sis"
18
18
  kb.delete_list("bro_and_sis")
19
19
 
20
- refute kb.list_files["simple"]
20
+ refute kb.lists["simple"]
21
21
  end
22
22
  end
23
23
 
@@ -30,11 +30,11 @@ class TestKnowledgeBaseQuery < Test::Unit::TestCase
30
30
 
31
31
  assert_equal list, kb.load_list("bro_and_sis")
32
32
 
33
- assert_include kb.list_files["simple"], "bro_and_sis"
33
+ assert_include kb.lists["simple"], "bro_and_sis"
34
34
 
35
35
  kb.delete_list("bro_and_sis")
36
36
 
37
- refute kb.list_files["simple"]
37
+ refute kb.lists["simple"].any?
38
38
  end
39
39
  end
40
40
  end
@@ -12,5 +12,24 @@ class TestKnowlegeBase < Test::Unit::TestCase
12
12
  assert_include kb.all_databases, :brothers
13
13
  end
14
14
  end
15
+
16
+ def test_registry_identifiers
17
+ identifier =<<-EOF
18
+ #Alias,Initials
19
+ Clei,CC
20
+ Miki,MV
21
+ Guille,GC
22
+ Isa,IV
23
+ EOF
24
+ TmpFile.with_dir do |dir|
25
+ TmpFile.with_file(identifier) do |identifier_file|
26
+ identifiers = TSV.open(identifier_file, sep: ",", type: :single)
27
+ brothers = datafile_test(:person).brothers
28
+ kb = KnowledgeBase.new dir
29
+ kb.register :brothers, brothers, identifiers: identifiers
30
+ assert_include kb.get_index(:brothers, source: "=>Initials"), "CC~Guille"
31
+ end
32
+ end
33
+ end
15
34
  end
16
35
 
@@ -74,6 +74,7 @@ row2 a a id3
74
74
  assert_include tsv.keys, 'row1'
75
75
  assert_include tsv.keys, 'row2'
76
76
 
77
+ tsv.close
77
78
  assert_nothing_raised do
78
79
  tsv = Persist.persist("TEST Persist TSV", :HDB) do
79
80
  raise