postal_address 0.9.0 → 0.9.2

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: 6284773a18364d9fe9d92dd813773600962ae91d
4
- data.tar.gz: 5d07abcc7f4041971831df9d44d3365670b6fd50
3
+ metadata.gz: f83668dafff4ede2c9d49c1c711cb5867167bd44
4
+ data.tar.gz: 535bb43703e2f420c0f5177973ae95845d0270dc
5
5
  SHA512:
6
- metadata.gz: 5b3807375fb3e684a72ee605f0836b7f0927faaa04a86918615d619b253059a3d4c81ecdc1246ff4f394d6ec59821de2705a336bf01f278c9956059f37afd0b9
7
- data.tar.gz: e2d9a0d08082ef7f994095360ef0c503a0bf2cf636a1e72bd0b9ae587ba21f9a6aa279fc5a4b0492622f08ffab0626a61c8c6a45a03272caa818c2571f8c7037
6
+ metadata.gz: dad66c7a372952a9ba32058e3a9bddbbe1f5c86704fd68d358ea304f3b6ce533025c5b06083f190ab523d6566f235a83f8ffacab5abea4421f2fd20f04ab0352
7
+ data.tar.gz: dc0a4a98c5b98429e355bbc43c765544f62ddd304ff7d115d2e67fbba19365ae2bab261cc9e50b9227a9f7f4ac51bace01f1f61197d6f5003e12e37eab29d9c5
@@ -13,7 +13,7 @@ module Postal
13
13
  private
14
14
 
15
15
  def address_data
16
- @address[:country] = nil if Postal.home_country? @address[:country_code]
16
+ @address[:country] = nil if Postal.home_country == @address[:country_code]
17
17
  @address
18
18
  end
19
19
 
@@ -1,3 +1,3 @@
1
1
  module Postal
2
- VERSION = "0.9.0"
2
+ VERSION = "0.9.2"
3
3
  end
@@ -11,10 +11,6 @@ module Postal
11
11
  def home_country=(code)
12
12
  @home_country = sanitize(code)
13
13
  end
14
-
15
- def home_country?(code)
16
- home_country == code
17
- end
18
14
 
19
15
  def sanitize(code)
20
16
  code && code.to_s.downcase
@@ -22,5 +22,4 @@ Gem::Specification.new do |spec|
22
22
  spec.add_development_dependency "rake"
23
23
  spec.add_development_dependency "minitest", '~> 4.7.0'
24
24
  spec.add_development_dependency "turn"
25
- spec.add_development_dependency "virtus"
26
25
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: postal_address
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Melchert
@@ -66,20 +66,6 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
- - !ruby/object:Gem::Dependency
70
- name: virtus
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- version: '0'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: '0'
83
69
  description: International postal address formatting
84
70
  email:
85
71
  - kevin.melchert@gmail.com
@@ -103,7 +89,6 @@ files:
103
89
  - postal_address.gemspec
104
90
  - spec/postal_address_spec.rb
105
91
  - spec/spec_helper.rb
106
- - spec/virtus_integration_spec.rb
107
92
  homepage: ''
108
93
  licenses:
109
94
  - MIT
@@ -131,4 +116,3 @@ summary: International postal address formatting
131
116
  test_files:
132
117
  - spec/postal_address_spec.rb
133
118
  - spec/spec_helper.rb
134
- - spec/virtus_integration_spec.rb
@@ -1,39 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
- require 'spec_helper'
3
- require 'virtus'
4
-
5
- class Address
6
- include Virtus
7
- attribute :id, Integer
8
- attribute :recipient, String
9
- attribute :street, String
10
- attribute :zip, String
11
- attribute :city, String
12
- attribute :state, String
13
- attribute :country_code, String
14
- attribute :geolocation, Array
15
-
16
- def postal_address
17
- Postal::Address.new(self.attributes).to_s
18
- end
19
- end
20
-
21
- describe Address do
22
- let(:address) {
23
- Address.new({
24
- id: 1001,
25
- recipient: 'Tobias Füncke',
26
- street: '101 Broadway',
27
- city: 'New York City',
28
- zip: '10002',
29
- state: 'NY',
30
- country_code: 'us',
31
- geolocation: [13,52]
32
- })
33
- }
34
-
35
- it "should work" do
36
- Postal.home_country = 'us'
37
- address.postal_address.must_equal "Tobias Füncke\n101 Broadway\nNew York City NY 10002"
38
- end
39
- end