Class: TriggeredJobHelper
- Inherits:
-
ExtensionHelper
- Object
- SimpleDelegator
- ExtensionHelper
- TriggeredJobHelper
- Defined in:
- lib/jenkins_pipeline_builder/extensions/helpers/build_steps/triggered_job.rb
Instance Attribute Summary
Attributes inherited from ExtensionHelper
Instance Method Summary collapse
- #block_condition? ⇒ Boolean
- #generate_for_threshold(xml_builder, threshold_type) ⇒ Object
- #resolve_block_condition(key) ⇒ Object
Methods inherited from ExtensionHelper
Constructor Details
This class inherits a constructor from ExtensionHelper
Instance Method Details
#block_condition? ⇒ Boolean
24 25 26 |
# File 'lib/jenkins_pipeline_builder/extensions/helpers/build_steps/triggered_job.rb', line 24 def block_condition? respond_to?(:block_condition) && block_condition != false end |
#generate_for_threshold(xml_builder, threshold_type) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/jenkins_pipeline_builder/extensions/helpers/build_steps/triggered_job.rb', line 6 def generate_for_threshold(xml_builder, threshold_type) case threshold_type when /failure/i, :failure generate_threshold_xml({ name: 'FAILURE', ordinal: 2, color: 'RED' }, xml_builder) when /unstable/i, :unstable generate_threshold_xml({ name: 'UNSTABLE', ordinal: 1, color: 'YELLOW' }, xml_builder) when /success/i, :success generate_threshold_xml({ name: 'SUCCESS', ordinal: 0, color: 'BLUE' }, xml_builder) else raise ArgumentError("Input should be one of the following either as a case insensitive string or symbol: \n 'failure', 'unstable', 'success'") end end |
#resolve_block_condition(key) ⇒ Object
20 21 22 |
# File 'lib/jenkins_pipeline_builder/extensions/helpers/build_steps/triggered_job.rb', line 20 def resolve_block_condition(key) try(:block_condition).try([], key) end |