Module: Igniter::Extensions::Contracts::DifferentialPack
- Defined in:
- lib/igniter/extensions/contracts/differential_pack.rb
Class Method Summary collapse
- .compare(inputs:, primary_environment: nil, primary_compiled_graph: nil, primary_result: nil, candidate_environment: nil, candidate_compiled_graph: nil, candidate_result: nil, tolerance: nil, primary_name: "primary", candidate_name: "candidate") ⇒ Object
- .install_into(kernel) ⇒ Object
- .manifest ⇒ Object
- .shadow(**arguments) ⇒ Object
Class Method Details
.compare(inputs:, primary_environment: nil, primary_compiled_graph: nil, primary_result: nil, candidate_environment: nil, candidate_compiled_graph: nil, candidate_result: nil, tolerance: nil, primary_name: "primary", candidate_name: "candidate") ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/igniter/extensions/contracts/differential_pack.rb', line 25 def compare( inputs:, primary_environment: nil, primary_compiled_graph: nil, primary_result: nil, candidate_environment: nil, candidate_compiled_graph: nil, candidate_result: nil, tolerance: nil, primary_name: "primary", candidate_name: "candidate" ) Differential::Runner.new( primary_name: primary_name, candidate_name: candidate_name, tolerance: tolerance ).compare( inputs: inputs, primary_environment: primary_environment, primary_compiled_graph: primary_compiled_graph, primary_result: primary_result, candidate_environment: candidate_environment, candidate_compiled_graph: candidate_compiled_graph, candidate_result: candidate_result ) end |
.install_into(kernel) ⇒ Object
21 22 23 |
# File 'lib/igniter/extensions/contracts/differential_pack.rb', line 21 def install_into(kernel) kernel end |
.manifest ⇒ Object
14 15 16 17 18 19 |
# File 'lib/igniter/extensions/contracts/differential_pack.rb', line 14 def manifest Igniter::Contracts::PackManifest.new( name: :extensions_differential, metadata: { category: :developer } ) end |
.shadow(**arguments) ⇒ Object
52 53 54 55 56 57 |
# File 'lib/igniter/extensions/contracts/differential_pack.rb', line 52 def shadow(**arguments) on_divergence = arguments.delete(:on_divergence) report = compare(**arguments) on_divergence.call(report) if on_divergence && !report.match? report end |