taski 0.8.3 → 0.9.1
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/CHANGELOG.md +52 -0
- data/README.md +108 -50
- data/docs/GUIDE.md +79 -55
- data/examples/README.md +10 -29
- data/examples/clean_demo.rb +25 -65
- data/examples/large_tree_demo.rb +356 -0
- data/examples/message_demo.rb +0 -1
- data/examples/progress_demo.rb +13 -24
- data/examples/reexecution_demo.rb +8 -44
- data/lib/taski/execution/execution_facade.rb +150 -0
- data/lib/taski/execution/executor.rb +167 -359
- data/lib/taski/execution/fiber_protocol.rb +27 -0
- data/lib/taski/execution/registry.rb +15 -19
- data/lib/taski/execution/scheduler.rb +161 -140
- data/lib/taski/execution/task_observer.rb +41 -0
- data/lib/taski/execution/task_output_router.rb +41 -58
- data/lib/taski/execution/task_wrapper.rb +123 -219
- data/lib/taski/execution/worker_pool.rb +279 -64
- data/lib/taski/logging.rb +105 -0
- data/lib/taski/progress/layout/base.rb +600 -0
- data/lib/taski/progress/layout/filters.rb +126 -0
- data/lib/taski/progress/layout/log.rb +27 -0
- data/lib/taski/progress/layout/simple.rb +166 -0
- data/lib/taski/progress/layout/tags.rb +76 -0
- data/lib/taski/progress/layout/theme_drop.rb +84 -0
- data/lib/taski/progress/layout/tree.rb +300 -0
- data/lib/taski/progress/theme/base.rb +224 -0
- data/lib/taski/progress/theme/compact.rb +58 -0
- data/lib/taski/progress/theme/default.rb +25 -0
- data/lib/taski/progress/theme/detail.rb +48 -0
- data/lib/taski/progress/theme/plain.rb +40 -0
- data/lib/taski/static_analysis/analyzer.rb +5 -17
- data/lib/taski/static_analysis/dependency_graph.rb +19 -1
- data/lib/taski/static_analysis/start_dep_analyzer.rb +400 -0
- data/lib/taski/static_analysis/visitor.rb +1 -39
- data/lib/taski/task.rb +49 -58
- data/lib/taski/task_proxy.rb +59 -0
- data/lib/taski/test_helper/errors.rb +1 -1
- data/lib/taski/test_helper.rb +22 -36
- data/lib/taski/version.rb +1 -1
- data/lib/taski.rb +62 -61
- data/sig/taski.rbs +194 -203
- metadata +34 -8
- data/examples/section_demo.rb +0 -195
- data/lib/taski/execution/base_progress_display.rb +0 -393
- data/lib/taski/execution/execution_context.rb +0 -390
- data/lib/taski/execution/plain_progress_display.rb +0 -76
- data/lib/taski/execution/simple_progress_display.rb +0 -247
- data/lib/taski/execution/tree_progress_display.rb +0 -643
- data/lib/taski/section.rb +0 -74
data/lib/taski/section.rb
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require_relative "task"
|
|
4
|
-
|
|
5
|
-
module Taski
|
|
6
|
-
class Section < Task
|
|
7
|
-
class << self
|
|
8
|
-
# @param interface_methods [Array<Symbol>] Names of interface methods
|
|
9
|
-
def interfaces(*interface_methods)
|
|
10
|
-
exports(*interface_methods)
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
# Section does not have static dependencies for execution.
|
|
14
|
-
# The impl method is called at runtime to determine the actual implementation.
|
|
15
|
-
# Static dependencies (impl candidates) are only used for tree display and circular detection.
|
|
16
|
-
def cached_dependencies
|
|
17
|
-
Set.new
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
def run
|
|
22
|
-
implementation_class = impl
|
|
23
|
-
unless implementation_class
|
|
24
|
-
raise "Section #{self.class} does not have an implementation. Override 'impl' method."
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
# Register runtime dependency for clean phase (before register_impl_selection)
|
|
28
|
-
register_runtime_dependency(implementation_class)
|
|
29
|
-
|
|
30
|
-
# Register selected impl for progress display
|
|
31
|
-
register_impl_selection(implementation_class)
|
|
32
|
-
|
|
33
|
-
apply_interface_to_implementation(implementation_class)
|
|
34
|
-
|
|
35
|
-
self.class.exported_methods.each do |method|
|
|
36
|
-
value = implementation_class.public_send(method)
|
|
37
|
-
instance_variable_set("@#{method}", value)
|
|
38
|
-
end
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
# @return [Class] The implementation task class
|
|
42
|
-
# @raise [NotImplementedError] If not implemented by subclass
|
|
43
|
-
def impl
|
|
44
|
-
raise NotImplementedError, "Subclasses must implement the impl method to return implementation class"
|
|
45
|
-
end
|
|
46
|
-
|
|
47
|
-
private
|
|
48
|
-
|
|
49
|
-
# Register the selected implementation as a runtime dependency.
|
|
50
|
-
# This allows the clean phase to include the dynamically selected impl.
|
|
51
|
-
# Handles nil ExecutionContext gracefully.
|
|
52
|
-
#
|
|
53
|
-
# @param impl_class [Class] The selected implementation class
|
|
54
|
-
def register_runtime_dependency(impl_class)
|
|
55
|
-
context = Execution::ExecutionContext.current
|
|
56
|
-
context&.register_runtime_dependency(self.class, impl_class)
|
|
57
|
-
end
|
|
58
|
-
|
|
59
|
-
def register_impl_selection(implementation_class)
|
|
60
|
-
context = Execution::ExecutionContext.current
|
|
61
|
-
return unless context
|
|
62
|
-
|
|
63
|
-
context.notify_section_impl_selected(self.class, implementation_class)
|
|
64
|
-
end
|
|
65
|
-
|
|
66
|
-
# @param implementation_class [Class] The implementation task class
|
|
67
|
-
def apply_interface_to_implementation(implementation_class)
|
|
68
|
-
interface_methods = self.class.exported_methods
|
|
69
|
-
return if interface_methods.empty?
|
|
70
|
-
|
|
71
|
-
implementation_class.exports(*interface_methods)
|
|
72
|
-
end
|
|
73
|
-
end
|
|
74
|
-
end
|