Store log messages in an array of messages.

This commit is contained in:
Parker Moore 2014-07-22 14:08:11 -04:00
parent e0a011c917
commit b2146e8659
1 changed files with 10 additions and 1 deletions

View File

@ -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