snail 2.1.0 → 2.2.0
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/snail.rb +1 -1
- data/lib/snail/version.rb +1 -1
- data/test/snail_test.rb +12 -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: 548338f7e0eb13b8f20f4390f7d3a7c36c2949d6
|
4
|
+
data.tar.gz: 58e30cec8297302be78ee34df67986e66575cbe7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04be1c223ec69fe97b2bc07879639772ecb50878cd74683b2d743c343acf0973e2538326b65b1b1d55ce3b6a9271e7f28b875e4b24a15ced93b19db3af0e700e
|
7
|
+
data.tar.gz: bb1ffffcfe621c9aab694a7e4cd59f714ea35f8e51d8f7621a0525e41dd93d45e5806bb3428ac0cf4a2cb57203df47707502a8d2aa33d8466208e4e37ae7e314
|
data/lib/snail.rb
CHANGED
@@ -132,7 +132,7 @@ class Snail
|
|
132
132
|
when 'NL'
|
133
133
|
"#{postal_code} #{city}"
|
134
134
|
when 'IE'
|
135
|
-
"#{city}, #{region}"
|
135
|
+
"#{city}, #{region}#{"\n" unless postal_code.nil? || postal_code.empty?}#{postal_code}"
|
136
136
|
when 'GB', 'RU', 'UA', 'JO', 'LB', 'IR', 'SA', 'NZ'
|
137
137
|
"#{city} #{postal_code}" # Locally these may be on separate lines. The USPS prefers the city line above the country line, though.
|
138
138
|
when 'EC'
|
data/lib/snail/version.rb
CHANGED
data/test/snail_test.rb
CHANGED
@@ -146,12 +146,24 @@ class SnailTest < Snail::TestCase
|
|
146
146
|
assert_equal "John Doe\n12345 5th St\nSomewheres NY 12345\nCANADA", s.to_s
|
147
147
|
end
|
148
148
|
|
149
|
+
test "to_s ireland doesn't show a linebreak if zip is empty" do
|
150
|
+
s = Snail.new(@ie.merge(:zip => ""))
|
151
|
+
puts s.to_s
|
152
|
+
assert_equal "John Doe\n12345 5th St\nSomewheres, Dublin\nIRELAND", s.to_s
|
153
|
+
end
|
154
|
+
|
149
155
|
test "to_html" do
|
150
156
|
s = Snail.new(@ca)
|
151
157
|
s.name = 'John & Jane Doe'
|
152
158
|
assert_equal "John & Jane Doe<br />12345 5th St<br />Somewheres NY 12345<br />CANADA", s.to_html
|
153
159
|
assert s.to_html.html_safe?
|
154
160
|
end
|
161
|
+
|
162
|
+
test "to_html ireland doesn't show a linebreak if zip is empty" do
|
163
|
+
s = Snail.new(@ie.merge(:zip => ""))
|
164
|
+
s.name = 'John & Jane Doe'
|
165
|
+
assert_equal "John & Jane Doe<br />12345 5th St<br />Somewheres, Dublin<br />IRELAND", s.to_html
|
166
|
+
end
|
155
167
|
end
|
156
168
|
|
157
169
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: snail
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lance Ivy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|