Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Time.parse("") blows up on ruby 1.9

>> RUBY_DESCRIPTION
=> "ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-darwin11.4.0]"
>> require 'time'
=> true
>> Time.parse('')
ArgumentError: no time information in ""
    from .rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/time.rb:267:in `parse'
  • Loading branch information...
commit cc4ef394311fc059741506c93c5158c3973bbc43 1 parent e1f89af
@tmm1 tmm1 authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/multipass.rb
View
4 lib/multipass.rb
@@ -84,11 +84,11 @@ def decode(data)
# Force everything coming out of json into a Time object if it isn't already
# with YAJL, it parses dates for us (ugh)
- if options.has_key?(:expires) && options[:expires].is_a?(String)
+ if options.has_key?(:expires) && options[:expires].is_a?(String) && !options[:expires].empty?
options[:expires] = Time.parse(options[:expires])
end
- if options[:expires].nil? || Time.now.utc > options[:expires]
+ if options[:expires].nil? || (options[:expires] != '' && Time.now.utc > options[:expires])
raise MultiPass::ExpiredError.new(data, json, options)
end
Please sign in to comment.
Something went wrong with that request. Please try again.