Class: Knapsack::Allocator
- Inherits:
-
Object
- Object
- Knapsack::Allocator
- Defined in:
- lib/knapsack/allocator.rb
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ Allocator
constructor
A new instance of Allocator.
- #leftover_node_tests ⇒ Object
- #node_tests ⇒ Object
- #report_node_tests ⇒ Object
- #stringify_node_tests ⇒ Object
- #test_dir ⇒ Object
Constructor Details
#initialize(args = {}) ⇒ Allocator
Returns a new instance of Allocator.
3 4 5 6 |
# File 'lib/knapsack/allocator.rb', line 3 def initialize(args={}) @report_distributor = Knapsack::Distributors::ReportDistributor.new(args) @leftover_distributor = Knapsack::Distributors::LeftoverDistributor.new(args) end |
Instance Method Details
#leftover_node_tests ⇒ Object
12 13 14 |
# File 'lib/knapsack/allocator.rb', line 12 def leftover_node_tests @leftover_node_tests ||= @leftover_distributor.tests_for_current_node end |
#node_tests ⇒ Object
16 17 18 |
# File 'lib/knapsack/allocator.rb', line 16 def node_tests @node_tests ||= report_node_tests + leftover_node_tests end |
#report_node_tests ⇒ Object
8 9 10 |
# File 'lib/knapsack/allocator.rb', line 8 def report_node_tests @report_node_tests ||= @report_distributor.tests_for_current_node end |
#stringify_node_tests ⇒ Object
20 21 22 23 24 25 |
# File 'lib/knapsack/allocator.rb', line 20 def stringify_node_tests node_tests .map do |test_file| %{"#{test_file}"} end.join(' ') end |