Browse files

Ruby 1.8.7 doesn't supported named matches, fixed that issue and

just use the old-school way of grabbing matches for the regex.
  • Loading branch information...
1 parent affddc8 commit fe6b2406bfa018e73033e492cb374d5ddf1639c4 @csaunders csaunders committed May 31, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/active_shipping/shipping/location.rb
View
4 lib/active_shipping/shipping/location.rb
@@ -134,8 +134,8 @@ def inspect
# Returns the postal code as a properly formatted Zip+4 code, e.g. "77095-2233"
def zip_plus_4
- if /(?<zip>\d{5})(?<plus_4>\d{4})/ =~ @postal_code
- return "#{zip}-#{plus_4}"
+ if /(\d{5})(\d{4})/ =~ @postal_code
+ return "#{$1}-#{$2}"
elsif /\d{5}-\d{4}/ =~ @postal_code
return @postal_code
else

0 comments on commit fe6b240

Please sign in to comment.