lib/otp/base.rb in otp-0.0.8 vs lib/otp/base.rb in otp-0.0.9

- old
+ new

@@ -40,11 +40,11 @@ pw = "0" + pw while pw.length < digits return pw end def verify(given_pw, last:0, post:0) - raise "last must be greater than or equal to 0" if last < 0 - raise "post must be greater than or equal to 0" if post < 0 + raise ArgumentError, "last must be greater than or equal to 0" if last < 0 + raise ArgumentError, "post must be greater than or equal to 0" if post < 0 return false if given_pw.nil? || given_pw.empty? return (-last..post).any?{|i| compare(password(i), given_pw) } end ## URI related methods