snail 2.1.0 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 812732750415ef2957431d92fcf8da7660d78402
4
- data.tar.gz: 1b71a4117e610bd5c67db6b8b139c7235c9bc7b7
3
+ metadata.gz: 548338f7e0eb13b8f20f4390f7d3a7c36c2949d6
4
+ data.tar.gz: 58e30cec8297302be78ee34df67986e66575cbe7
5
5
  SHA512:
6
- metadata.gz: 80159381c9ad565e003cd5f001f3ad7d0125f05378235301b35306b71679bb363602538910d7dfc8f99138892c586eee8efdc61a75ce1ade8950137f18f8c32b
7
- data.tar.gz: 2d95a236f10890ec2c1fb570e70fae2aeb6df23de9b1789a8df715325180654668aa1cb4eae07a18ef0bc6b6876cabd6c3e1942e49e7307e06a644582a157b47
6
+ metadata.gz: 04be1c223ec69fe97b2bc07879639772ecb50878cd74683b2d743c343acf0973e2538326b65b1b1d55ce3b6a9271e7f28b875e4b24a15ced93b19db3af0e700e
7
+ data.tar.gz: bb1ffffcfe621c9aab694a7e4cd59f714ea35f8e51d8f7621a0525e41dd93d45e5806bb3428ac0cf4a2cb57203df47707502a8d2aa33d8466208e4e37ae7e314
@@ -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'
@@ -1,3 +1,3 @@
1
1
  class Snail
2
- VERSION = '2.1.0'
2
+ VERSION = '2.2.0'
3
3
  end
@@ -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 &amp; 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 &amp; 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.1.0
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-06-02 00:00:00.000000000 Z
11
+ date: 2016-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport