Class: Lazylead::Servers
- Inherits:
-
Requirement
- Object
- Requirement
- Lazylead::Servers
- Defined in:
- lib/lazylead/task/accuracy/servers.rb
Overview
Check that ticket has expected links to failed entities on dedicated
servers.
Instance Attribute Summary
Attributes inherited from Requirement
Instance Method Summary collapse
-
#initialize(score: 2, envs: [], desc: "Internal reproducing results") ⇒ Servers
constructor
A new instance of Servers.
- #passed(issue) ⇒ Object
Methods inherited from Requirement
Constructor Details
#initialize(score: 2, envs: [], desc: "Internal reproducing results") ⇒ Servers
Returns a new instance of Servers.
34 35 36 37 |
# File 'lib/lazylead/task/accuracy/servers.rb', line 34 def initialize(score: 2, envs: [], desc: "Internal reproducing results") super desc, score, "Description/Environment" @envs = envs end |
Instance Method Details
#passed(issue) ⇒ Object
39 40 41 42 43 44 45 46 47 48 |
# File 'lib/lazylead/task/accuracy/servers.rb', line 39 def passed(issue) return true if @envs.empty? lines = issue["environment"].to_s + "\n" + issue.description lines.split("\n") .reject(&:blank?) .map(&:strip) .flat_map { |l| l.split(" ").map(&:strip) } .select { |w| w.include?("http://") || w.include?("https://") } .any? { |u| @envs.any? { |e| u.match? e } } end |