going_postal 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/going_postal.rb +5 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f3b76826ddbfd629cb8ec49edd71eed7c90f6f26
|
|
4
|
+
data.tar.gz: 7435b969946dfa00c0bec50d586ee97a703c3ba2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 33640d1079991cb40dc376bb96f619dd865c6ebd28fa68438b3412a0eef556218101f37ea23b4d3ae91003e5ac820b2e228441ecee1180a26da80716f585c196
|
|
7
|
+
data.tar.gz: 959f26dc83f106d0ef5f3aea0512c7bc6380163c2b4da217f3de9c59361066e794d7c2e3ed1d40b2e3da4b9b0550b3cbc7b3da31bd50e70b9e2464ca2e0c4973
|
data/lib/going_postal.rb
CHANGED
|
@@ -188,6 +188,11 @@ module GoingPostal
|
|
|
188
188
|
string.insert(4, " ") if string.length >= 4
|
|
189
189
|
string if string =~ /^[1-9][0-9]{3} (S[BCE-RT-Z]|[A-RT-Z][A-Z])$/
|
|
190
190
|
end
|
|
191
|
+
|
|
192
|
+
def format_pl_postcode(string)
|
|
193
|
+
match = /^(\d\d)[^\w]*(\d\d\d)$/.match(string)
|
|
194
|
+
match.captures.join("-") if match && match[1] && match[2]
|
|
195
|
+
end
|
|
191
196
|
|
|
192
197
|
private
|
|
193
198
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: going_postal
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Matthew Sadler
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2014-03-12 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: Post/zip code formatting and validation for the UK, US, CA and more.
|
|
14
14
|
email: mat@sourcetagsandcodes.com
|