Store log messages in an array of messages.
This commit is contained in:
parent
e0a011c917
commit
b2146e8659
|
@ -87,7 +87,9 @@ module Jekyll
|
|||
#
|
||||
# Returns the formatted message
|
||||
def message(topic, message)
|
||||
formatted_topic(topic) + message.to_s.gsub(/\s+/, ' ')
|
||||
msg = formatted_topic(topic) + message.to_s.gsub(/\s+/, ' ')
|
||||
messages << msg
|
||||
msg
|
||||
end
|
||||
|
||||
# Internal: Format the topic
|
||||
|
@ -98,5 +100,12 @@ module Jekyll
|
|||
def formatted_topic(topic)
|
||||
"#{topic} ".rjust(20)
|
||||
end
|
||||
|
||||
# Public: All the messages Stevenson has printed so far
|
||||
#
|
||||
# Returns an Array of all messages Stevenson has built so far using #message
|
||||
def messages
|
||||
@messages ||= Array.new
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue