Style and ordering

This commit is contained in:
David Heinemeier Hansson
2023-03-24 15:16:15 +01:00
parent 348f5844d5
commit 4ab5199853

View File

@@ -32,26 +32,26 @@ class Mrsk::Commands::Auditor < Mrsk::Commands::Base
end end
def tagged_record_line(line) def tagged_record_line(line)
quote [recorded_at_tag, performer_tag, role_tag, line].compact.join(" ") tagged_line recorded_at_tag, performer_tag, role_tag, line
end end
def tagged_broadcast_line(line) def tagged_broadcast_line(line)
quote [performer_tag, role_tag, line].compact.join(" ") tagged_line performer_tag, role_tag, line
end end
def role_tag def tagged_line(*tags_and_line)
"[#{role}]" if role "'#{tags_and_line.compact.join(" ")}'"
end
def performer_tag
"[#{`whoami`.strip}]"
end end
def recorded_at_tag def recorded_at_tag
"[#{Time.now.to_fs(:db)}]" "[#{Time.now.to_fs(:db)}]"
end end
def quote(tagged_line) def performer_tag
"'#{tagged_line}'" "[#{`whoami`.strip}]"
end
def role_tag
"[#{role}]" if role
end end
end end