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.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +52 -0
  3. data/README.md +108 -50
  4. data/docs/GUIDE.md +79 -55
  5. data/examples/README.md +10 -29
  6. data/examples/clean_demo.rb +25 -65
  7. data/examples/large_tree_demo.rb +356 -0
  8. data/examples/message_demo.rb +0 -1
  9. data/examples/progress_demo.rb +13 -24
  10. data/examples/reexecution_demo.rb +8 -44
  11. data/lib/taski/execution/execution_facade.rb +150 -0
  12. data/lib/taski/execution/executor.rb +167 -359
  13. data/lib/taski/execution/fiber_protocol.rb +27 -0
  14. data/lib/taski/execution/registry.rb +15 -19
  15. data/lib/taski/execution/scheduler.rb +161 -140
  16. data/lib/taski/execution/task_observer.rb +41 -0
  17. data/lib/taski/execution/task_output_router.rb +41 -58
  18. data/lib/taski/execution/task_wrapper.rb +123 -219
  19. data/lib/taski/execution/worker_pool.rb +279 -64
  20. data/lib/taski/logging.rb +105 -0
  21. data/lib/taski/progress/layout/base.rb +600 -0
  22. data/lib/taski/progress/layout/filters.rb +126 -0
  23. data/lib/taski/progress/layout/log.rb +27 -0
  24. data/lib/taski/progress/layout/simple.rb +166 -0
  25. data/lib/taski/progress/layout/tags.rb +76 -0
  26. data/lib/taski/progress/layout/theme_drop.rb +84 -0
  27. data/lib/taski/progress/layout/tree.rb +300 -0
  28. data/lib/taski/progress/theme/base.rb +224 -0
  29. data/lib/taski/progress/theme/compact.rb +58 -0
  30. data/lib/taski/progress/theme/default.rb +25 -0
  31. data/lib/taski/progress/theme/detail.rb +48 -0
  32. data/lib/taski/progress/theme/plain.rb +40 -0
  33. data/lib/taski/static_analysis/analyzer.rb +5 -17
  34. data/lib/taski/static_analysis/dependency_graph.rb +19 -1
  35. data/lib/taski/static_analysis/start_dep_analyzer.rb +400 -0
  36. data/lib/taski/static_analysis/visitor.rb +1 -39
  37. data/lib/taski/task.rb +49 -58
  38. data/lib/taski/task_proxy.rb +59 -0
  39. data/lib/taski/test_helper/errors.rb +1 -1
  40. data/lib/taski/test_helper.rb +22 -36
  41. data/lib/taski/version.rb +1 -1
  42. data/lib/taski.rb +62 -61
  43. data/sig/taski.rbs +194 -203
  44. metadata +34 -8
  45. data/examples/section_demo.rb +0 -195
  46. data/lib/taski/execution/base_progress_display.rb +0 -393
  47. data/lib/taski/execution/execution_context.rb +0 -390
  48. data/lib/taski/execution/plain_progress_display.rb +0 -76
  49. data/lib/taski/execution/simple_progress_display.rb +0 -247
  50. data/lib/taski/execution/tree_progress_display.rb +0 -643
  51. 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