Skip to content

Commit

Permalink
hoptoad-ios reports its API version as 2.1. Allow
Browse files Browse the repository at this point in the history
that. Also improve the message for ApiVersionError.
  • Loading branch information
boblail committed Nov 18, 2011
1 parent f706788 commit 3a04d97
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/hoptoad.rb
Expand Up @@ -3,7 +3,7 @@
module Hoptoad
class ApiVersionError < StandardError
def initialize
super "Wrong API Version: Expecting v2.0"
super "Wrong API Version: Expecting 2.0, 2.1, or 2.2"
end
end

Expand All @@ -17,9 +17,8 @@ def self.parse_xml!(xml)
private
def self.get_version_processor(version)
case version
when '2.0'; Hoptoad::V2
when '2.2'; Hoptoad::V2
else; raise ApiVersionError
when /2\.[012]/; Hoptoad::V2
else; raise ApiVersionError
end
end
end
Expand Down

0 comments on commit 3a04d97

Please sign in to comment.