Class: Reek::Report::GithubReport::WorkflowCommand
- Inherits:
-
Object
- Object
- Reek::Report::GithubReport::WorkflowCommand
- Defined in:
- lib/reek/report/github_report.rb
Overview
Represents a smell as a GitHub Workflow command.
Instance Method Summary collapse
- #file ⇒ Object private
-
#initialize(smell) ⇒ WorkflowCommand
constructor
A new instance of WorkflowCommand.
- #line ⇒ Object private
- #message ⇒ Object private
- #to_s ⇒ Object
Constructor Details
#initialize(smell) ⇒ WorkflowCommand
Returns a new instance of WorkflowCommand.
27 28 29 |
# File 'lib/reek/report/github_report.rb', line 27 def initialize(smell) @smell = smell end |
Instance Method Details
#file ⇒ Object (private)
41 42 43 |
# File 'lib/reek/report/github_report.rb', line 41 def file @smell.source end |
#line ⇒ Object (private)
45 46 47 |
# File 'lib/reek/report/github_report.rb', line 45 def line @smell.lines.first end |
#message ⇒ Object (private)
49 50 51 |
# File 'lib/reek/report/github_report.rb', line 49 def @smell..gsub('%', '%25').gsub("\r", '%0D').gsub("\n", '%0A') end |
#to_s ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/reek/report/github_report.rb', line 31 def to_s format( "::warning file=%<file>s,line=%<line>d::%<message>s\n", file: file, line: line, message: ) end |