tops_connect 0.3.2 → 0.3.3

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: 9ed44b3ea707e7e23717699b06d03c5b553280c7
4
- data.tar.gz: 08ce4c8758a74bce6468604eaeef765db27176a6
3
+ metadata.gz: 12bd272bb843f887f7d9a0fd09d63629e238cfa8
4
+ data.tar.gz: 7d5af65edaaf96f561223558a54bc4de908395aa
5
5
  SHA512:
6
- metadata.gz: 49cc58338ed25e9bb840a08f7c9b1bcd0cfd62ca2b2a80dd64cc59af68611806c79abda10a70fe692d332c66edfc574e2204a1be1478e6d071ed4ef446f47bf9
7
- data.tar.gz: 467889a07a333198ba4e886b8195cd4d5fbfa0872bb6d57c6b0927190e398078b33e2baef54adf652c005fe5a05e10209bec8d961fef2b1acd27056702afe614
6
+ metadata.gz: a1d3b92f3ac701116b3cf43fc8fa384b3b5bd15f07f3f3f00f270fd4045d71447cecdb11d7ee1666e76cad18167e87b7c676e7ff0ecd6c562a27ed76e2e85bc7
7
+ data.tar.gz: d611c3ed05763ed61d54d87dd1867a0008cab0cb620974151f0231ede406ec02b5b96e935ddfc57e2f4b6a825df342d6ddff48b7a4a7a29b35fd54a69f5481c8
@@ -8,21 +8,25 @@ module TopsConnect
8
8
 
9
9
  def alternate_mailing_addresses
10
10
  [1, 2].map do |n|
11
- next unless data["AltMailing#{n}AddressLine1"]
11
+ lines = []
12
+
13
+ if data["AltMailing#{n}AddressLine1"] =~ /[[:graph:]]/
14
+ lines << data["AltMailing#{n}AddressLine1"].strip
15
+ end
16
+
17
+ if data["AltMailing#{n}AddressLine2"] =~ /[[:graph:]]/
18
+ lines << data["AltMailing#{n}AddressLine2"].strip
19
+ end
20
+
21
+ next if lines.empty?
12
22
 
13
23
  city = data["AltMailing#{n}City"]
14
24
  state = data["AltMailing#{n}State"]
15
25
  zip = data["AltMailing#{n}Zip"]
16
26
 
17
- lines = [data["AltMailing#{n}AddressLine1"]]
18
-
19
- if data["AltMailing#{n}AddressLine2"] !~ /[^[:space:]]/
20
- lines << data["AltMailing#{n}AddressLine2"]
21
- end
22
-
23
- lines << "#{city}, #{state} #{zip}"
27
+ lines << "#{city}, #{state} #{zip}".strip
24
28
 
25
- lines.reject(&:blank?).join("\n")
29
+ lines.join("\n")
26
30
  end.compact
27
31
  end
28
32
 
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module TopsConnect
3
- VERSION = '0.3.2'
3
+ VERSION = '0.3.3'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tops_connect
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Hoffman
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-06-06 00:00:00.000000000 Z
11
+ date: 2016-09-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -128,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
128
128
  version: '0'
129
129
  requirements: []
130
130
  rubyforge_project:
131
- rubygems_version: 2.5.1
131
+ rubygems_version: 2.6.6
132
132
  signing_key:
133
133
  specification_version: 4
134
134
  summary: Make use of the Tops Connect API