Class: Lazylead::Logs
- Inherits:
-
Attachment
- Object
- Requirement
- Attachment
- Lazylead::Logs
- Defined in:
- lib/lazylead/task/accuracy/logs.rb
Overview
Check that ticket has log file(s) in attachment.
Instance Attribute Summary
Attributes inherited from Requirement
Instance Method Summary collapse
-
#initialize ⇒ Logs
constructor
A new instance of Logs.
-
#matching(attachment) ⇒ Object
Ensure that ticket has a ‘*.log’ file more ‘5KB’.
Methods inherited from Attachment
Methods inherited from Requirement
Constructor Details
#initialize ⇒ Logs
Returns a new instance of Logs.
30 31 32 |
# File 'lib/lazylead/task/accuracy/logs.rb', line 30 def initialize super("Log files", 2, "Attachments") end |
Instance Method Details
#matching(attachment) ⇒ Object
Ensure that ticket has a ‘*.log’ file more ‘5KB’
35 36 37 38 39 40 |
# File 'lib/lazylead/task/accuracy/logs.rb', line 35 def matching() name = .attrs["filename"].downcase return false unless .attrs["size"].to_i > 5120 return true if File.extname(name).start_with?(".log", ".txt") %w[.log.zip .log.gz .log.tar.gz].any? { |l| name.end_with? l } end |