Skip to content

Commit

Permalink
be explicit with :endian_precendence default value
Browse files Browse the repository at this point in the history
  • Loading branch information
Lee Jarvis committed May 30, 2011
1 parent d3eb5bf commit 0fb02ba
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/chronic/chronic.rb
Expand Up @@ -5,7 +5,7 @@ module Chronic
:now => Chronic.time_class.now,
:guess => true,
:ambiguous_time_range => 6,
:endian_precedence => nil
:endian_precedence => [:middle, :little]
}

class << self
Expand Down
3 changes: 1 addition & 2 deletions lib/chronic/handlers.rb
Expand Up @@ -3,8 +3,7 @@ module Chronic
class << self

def definitions(options={}) #:nodoc:
options[:endian_precedence] = [:middle, :little] if options[:endian_precedence].nil?

options[:endian_precedence] ||= [:middle, :little]
# ensure the endian precedence is exactly two elements long
raise ChronicPain, "More than two elements specified for endian precedence array" unless options[:endian_precedence].length == 2

Expand Down

0 comments on commit 0fb02ba

Please sign in to comment.