Class: Lazylead::LogsLink
- Inherits:
-
Logs
- Object
- Requirement
- Attachment
- Logs
- Lazylead::LogsLink
- Defined in:
- lib/lazylead/task/accuracy/logs_link.rb
Overview
Check that ticket has link/reference to log record(s) in another system like ELK, GrayLog, etc.
or with plain log file
Instance Attribute Summary
Attributes inherited from Requirement
Instance Method Summary collapse
-
#initialize(link) ⇒ LogsLink
constructor
A new instance of LogsLink.
-
#link?(issue) ⇒ Boolean
Ensure that ticket has a link to external logs system like ELK, GrayLog, etc.
- #passed(issue) ⇒ Object
Methods inherited from Logs
Methods inherited from Attachment
Methods inherited from Requirement
Constructor Details
#initialize(link) ⇒ LogsLink
Returns a new instance of LogsLink.
32 33 34 35 |
# File 'lib/lazylead/task/accuracy/logs_link.rb', line 32 def initialize(link) super @link = link end |
Instance Method Details
#link?(issue) ⇒ Boolean
Ensure that ticket has a link to external logs system like ELK, GrayLog, etc.
42 43 44 45 46 47 48 49 50 |
# File 'lib/lazylead/task/accuracy/logs_link.rb', line 42 def link?(issue) return false if issue.description.nil? issue.description .split("\n") .reject(&:blank?) .flat_map(&:split) .reject(&:blank?) .any? { |word| word.start_with? @link } end |
#passed(issue) ⇒ Object
37 38 39 |
# File 'lib/lazylead/task/accuracy/logs_link.rb', line 37 def passed(issue) super(issue) || link?(issue) end |