Module: WarningShot::Resolver::InstanceMethods Private
- Defined in:
- lib/warningshot/resolver.rb
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Instance Method Summary collapse
-
#failed ⇒ Array<Objects>
private
list of failed dependencies.
-
#initialize(config, *deps) ⇒ Object
setups up a resolver with config and dependencies.
-
#passed ⇒ Array<Objects>
private
list of successful dependencies.
-
#resolve! ⇒ Object
private
Loops through dependencies and runs applicable resolutions until one passes.
-
#resolved ⇒ Array<Objects>
private
list of resolved dependencies.
-
#test! ⇒ Object
private
Loops through each dependency and runs applicable tests until one passes.
-
#unresolved ⇒ Array<Objects>
private
list of unresolved dependencies.
Instance Method Details
#failed ⇒ Array<Objects>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
list of failed dependencies
480 481 482 483 484 |
# File 'lib/warningshot/resolver.rb', line 480 def failed dependencies.inject([]){ |list,dep| dep.met ? (list) : (list << dep) } end |
#initialize(config, *deps) ⇒ Object
setups up a resolver with config and dependencies
524 525 526 527 528 529 530 531 532 533 534 535 |
# File 'lib/warningshot/resolver.rb', line 524 def initialize(config,*deps) @config = config @dependencies = Set.new deps.each do |dep| # Cast YAML data as described in resolver. dep = self.class.yaml_to_object(dep) dep.instance_eval { self.class.send(:attr_accessor, :met, :resolved) } @dependencies.add dep end end |
#passed ⇒ Array<Objects>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
list of successful dependencies
491 492 493 494 495 |
# File 'lib/warningshot/resolver.rb', line 491 def passed dependencies.inject([]){ |list,dep| dep.met ? (list << dep) : (list) } end |
#resolve! ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Loops through dependencies and runs applicable resolutions until one passes
451 452 453 454 455 456 457 458 459 460 |
# File 'lib/warningshot/resolver.rb', line 451 def resolve! dependencies.each do |dep| unless dep.met self.class.resolutions.each{ || dep.resolved = process_block :resolution, dep, break if dep.resolved } end end end |
#resolved ⇒ Array<Objects>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
list of resolved dependencies
503 504 505 506 507 |
# File 'lib/warningshot/resolver.rb', line 503 def resolved dependencies.inject([]){ |list,dep| (!dep.met && dep.resolved) ? (list << dep) : (list) } end |
#test! ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Loops through each dependency and runs applicable tests until one passes
439 440 441 442 443 444 445 446 |
# File 'lib/warningshot/resolver.rb', line 439 def test! dependencies.each do |dep| self.class.tests.each{ || dep.met = process_block :test, dep, break if dep.met } end end |
#unresolved ⇒ Array<Objects>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
list of unresolved dependencies
468 469 470 471 472 |
# File 'lib/warningshot/resolver.rb', line 468 def unresolved dependencies.inject([]){ |list,dep| (!dep.met && !dep.resolved) ? (list << dep) : (list) } end |