Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit fe6b2406bfa018e73033e492cb374d5ddf1639c4 1 parent affddc8
Christopher Saunders csaunders authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/active_shipping/shipping/location.rb
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
Please sign in to comment.
Something went wrong with that request. Please try again.