Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add runner attribute to the message initialization #126

Merged
merged 1 commit into from
Feb 16, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/pronto/message.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module Pronto
class Message
attr_reader :path, :line, :level, :msg, :commit_sha
attr_reader :path, :line, :level, :msg, :commit_sha, :runner

LEVELS = [:info, :warning, :error, :fatal]

def initialize(path, line, level, msg, commit_sha = nil)
def initialize(path, line, level, msg, commit_sha = nil, runner = nil)
unless LEVELS.include?(level)
raise ::ArgumentError, "level should be set to one of #{LEVELS}"
end
Expand All @@ -13,6 +13,7 @@ def initialize(path, line, level, msg, commit_sha = nil)
@line = line
@level = level
@msg = msg
@runner = runner
@commit_sha = commit_sha
@commit_sha ||= line.commit_sha if line
end
Expand Down