Skip to content
This repository has been archived by the owner on Dec 28, 2017. It is now read-only.

Commit

Permalink
changed API, now returns a Hash
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Cook committed Jan 8, 2012
1 parent dd571af commit 829d61e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/epub_validator/format_message.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
module EpubValidator
class FormatMessage
def process_message(message)
return ['Passed.'] if message.match('No errors or warnings detected')
status = Hash.new
status[:valid] = 1
return status if message.match('No errors or warnings detected')

m_array = message.split(/\n/)

Expand All @@ -12,7 +14,9 @@ def process_message(message)
s.match('^Check finished.*')
end

m_array.unshift('FAILED!')
status[:valid] = 0
status[:message] = m_array
return status
end
end
end

0 comments on commit 829d61e

Please sign in to comment.