correios-cep 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/.rspec +1 -1
- data/.travis.yml +1 -0
- data/CHANGELOG.rdoc +3 -0
- data/README.rdoc +2 -2
- data/correios-cep.gemspec +6 -6
- data/lib/correios/cep/version.rb +1 -1
- data/spec/correios/cep/address_finder_spec.rb +2 -2
- data/spec/correios/cep_spec.rb +3 -3
- data/spec/spec_helper.rb +0 -1
- metadata +54 -33
- checksums.yaml +0 -7
data/.rspec
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
--color
|
2
|
-
--format
|
2
|
+
--format documentation
|
data/.travis.yml
CHANGED
data/CHANGELOG.rdoc
CHANGED
data/README.rdoc
CHANGED
@@ -2,9 +2,9 @@
|
|
2
2
|
|
3
3
|
Current available solutions to find Brazilian addresses by zipcode use an HTML form from Correios web site to perform it, instead of to use a real API.
|
4
4
|
|
5
|
-
|
5
|
+
This works with an HTTP request to the form, followed by parsing the HTML result page. The huge problem here is when the Correios web site development team decides to modify some HTML element in the result page, even a layout update, it will break the parser logic for result.
|
6
6
|
|
7
|
-
Correios CEP gem solves this problem, getting data directly from Correios database.
|
7
|
+
Correios CEP gem solves this problem, getting data directly from Correios database.
|
8
8
|
|
9
9
|
http://prodis.net.br/images/ruby/2011/correios_logo.png
|
10
10
|
|
data/correios-cep.gemspec
CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |spec|
|
|
7
7
|
spec.version = Correios::CEP::VERSION
|
8
8
|
spec.authors = ["Prodis a.k.a. Fernando Hamasaki de Amorim"]
|
9
9
|
spec.email = ["prodis@gmail.com"]
|
10
|
-
spec.description = %q{Correios CEP gem gets updated Brazilian address from a zipcode, directly from Correios database. No HTML parsers
|
10
|
+
spec.description = %q{Correios CEP gem gets updated Brazilian address from a zipcode, directly from Correios database. No HTML parsers.}
|
11
11
|
spec.summary = spec.description
|
12
12
|
spec.homepage = "http://prodis.blog.br/correios-cep-gem-para-consulta-de-enderecos-por-cep"
|
13
13
|
spec.license = "MIT"
|
@@ -18,15 +18,15 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.require_paths = ["lib"]
|
19
19
|
|
20
20
|
spec.platform = Gem::Platform::RUBY
|
21
|
-
spec.required_ruby_version = Gem::Requirement.new(">= 1.9.
|
21
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 1.9.2")
|
22
22
|
|
23
|
-
spec.add_dependency "log-me", "= 0.0.
|
23
|
+
spec.add_dependency "log-me", "= 0.0.7"
|
24
24
|
spec.add_dependency "nokogiri", "~> 1.6"
|
25
25
|
|
26
26
|
spec.add_development_dependency "coveralls"
|
27
27
|
spec.add_development_dependency "pry"
|
28
28
|
spec.add_development_dependency "rake"
|
29
|
-
spec.add_development_dependency "rspec", "~>
|
30
|
-
spec.add_development_dependency "vcr", "
|
31
|
-
spec.add_development_dependency "webmock", "
|
29
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
30
|
+
spec.add_development_dependency "vcr", "2.9.2"
|
31
|
+
spec.add_development_dependency "webmock", "1.15.2"
|
32
32
|
end
|
data/lib/correios/cep/version.rb
CHANGED
@@ -6,8 +6,8 @@ describe Correios::CEP::AddressFinder do
|
|
6
6
|
let(:address) { { address: "Rua Fernando Amorim" } }
|
7
7
|
|
8
8
|
before do
|
9
|
-
Correios::CEP::WebService.
|
10
|
-
Correios::CEP::Parser.
|
9
|
+
allow_any_instance_of(Correios::CEP::WebService).to receive(:request!).with(cep).and_return(web_service_response)
|
10
|
+
allow_any_instance_of(Correios::CEP::Parser).to receive(:address).with(web_service_response).and_return(address)
|
11
11
|
end
|
12
12
|
|
13
13
|
describe "#get" do
|
data/spec/correios/cep_spec.rb
CHANGED
@@ -3,18 +3,18 @@ require 'spec_helper'
|
|
3
3
|
describe Correios::CEP do
|
4
4
|
describe "#request_timeout" do
|
5
5
|
it "default is 5" do
|
6
|
-
Correios::CEP.request_timeout.
|
6
|
+
expect(Correios::CEP.request_timeout).to eql 5
|
7
7
|
end
|
8
8
|
|
9
9
|
context "when set timeout" do
|
10
10
|
it "returns timeout" do
|
11
11
|
Correios::CEP.configure { |config| config.request_timeout = 3 }
|
12
|
-
Correios::CEP.request_timeout.
|
12
|
+
expect(Correios::CEP.request_timeout).to eql 3
|
13
13
|
end
|
14
14
|
|
15
15
|
it "returns timeout in seconds (integer)" do
|
16
16
|
Correios::CEP.configure { |config| config.request_timeout = 2.123 }
|
17
|
-
Correios::CEP.request_timeout.
|
17
|
+
expect(Correios::CEP.request_timeout).to eql 2
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -6,7 +6,6 @@ Coveralls.wear!
|
|
6
6
|
|
7
7
|
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
8
8
|
RSpec.configure do |config|
|
9
|
-
config.treat_symbols_as_metadata_keys_with_true_values = true
|
10
9
|
config.run_all_when_everything_filtered = true
|
11
10
|
config.filter_run :focus
|
12
11
|
config.order = "random"
|
metadata
CHANGED
@@ -1,138 +1,155 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: correios-cep
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- Prodis a.k.a. Fernando Hamasaki de Amorim
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date: 2014-
|
12
|
+
date: 2014-06-27 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: log-me
|
15
16
|
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
16
18
|
requirements:
|
17
19
|
- - '='
|
18
20
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.0.
|
21
|
+
version: 0.0.7
|
20
22
|
type: :runtime
|
21
23
|
prerelease: false
|
22
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
23
26
|
requirements:
|
24
27
|
- - '='
|
25
28
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.0.
|
29
|
+
version: 0.0.7
|
27
30
|
- !ruby/object:Gem::Dependency
|
28
31
|
name: nokogiri
|
29
32
|
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
30
34
|
requirements:
|
31
|
-
- -
|
35
|
+
- - ~>
|
32
36
|
- !ruby/object:Gem::Version
|
33
37
|
version: '1.6'
|
34
38
|
type: :runtime
|
35
39
|
prerelease: false
|
36
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
37
42
|
requirements:
|
38
|
-
- -
|
43
|
+
- - ~>
|
39
44
|
- !ruby/object:Gem::Version
|
40
45
|
version: '1.6'
|
41
46
|
- !ruby/object:Gem::Dependency
|
42
47
|
name: coveralls
|
43
48
|
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
44
50
|
requirements:
|
45
|
-
- -
|
51
|
+
- - ! '>='
|
46
52
|
- !ruby/object:Gem::Version
|
47
53
|
version: '0'
|
48
54
|
type: :development
|
49
55
|
prerelease: false
|
50
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
51
58
|
requirements:
|
52
|
-
- -
|
59
|
+
- - ! '>='
|
53
60
|
- !ruby/object:Gem::Version
|
54
61
|
version: '0'
|
55
62
|
- !ruby/object:Gem::Dependency
|
56
63
|
name: pry
|
57
64
|
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
58
66
|
requirements:
|
59
|
-
- -
|
67
|
+
- - ! '>='
|
60
68
|
- !ruby/object:Gem::Version
|
61
69
|
version: '0'
|
62
70
|
type: :development
|
63
71
|
prerelease: false
|
64
72
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
65
74
|
requirements:
|
66
|
-
- -
|
75
|
+
- - ! '>='
|
67
76
|
- !ruby/object:Gem::Version
|
68
77
|
version: '0'
|
69
78
|
- !ruby/object:Gem::Dependency
|
70
79
|
name: rake
|
71
80
|
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
72
82
|
requirements:
|
73
|
-
- -
|
83
|
+
- - ! '>='
|
74
84
|
- !ruby/object:Gem::Version
|
75
85
|
version: '0'
|
76
86
|
type: :development
|
77
87
|
prerelease: false
|
78
88
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
79
90
|
requirements:
|
80
|
-
- -
|
91
|
+
- - ! '>='
|
81
92
|
- !ruby/object:Gem::Version
|
82
93
|
version: '0'
|
83
94
|
- !ruby/object:Gem::Dependency
|
84
95
|
name: rspec
|
85
96
|
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
86
98
|
requirements:
|
87
|
-
- -
|
99
|
+
- - ~>
|
88
100
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
101
|
+
version: '3.0'
|
90
102
|
type: :development
|
91
103
|
prerelease: false
|
92
104
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
93
106
|
requirements:
|
94
|
-
- -
|
107
|
+
- - ~>
|
95
108
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
109
|
+
version: '3.0'
|
97
110
|
- !ruby/object:Gem::Dependency
|
98
111
|
name: vcr
|
99
112
|
requirement: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
100
114
|
requirements:
|
101
|
-
- -
|
115
|
+
- - '='
|
102
116
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
117
|
+
version: 2.9.2
|
104
118
|
type: :development
|
105
119
|
prerelease: false
|
106
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
107
122
|
requirements:
|
108
|
-
- -
|
123
|
+
- - '='
|
109
124
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
125
|
+
version: 2.9.2
|
111
126
|
- !ruby/object:Gem::Dependency
|
112
127
|
name: webmock
|
113
128
|
requirement: !ruby/object:Gem::Requirement
|
129
|
+
none: false
|
114
130
|
requirements:
|
115
|
-
- -
|
131
|
+
- - '='
|
116
132
|
- !ruby/object:Gem::Version
|
117
133
|
version: 1.15.2
|
118
134
|
type: :development
|
119
135
|
prerelease: false
|
120
136
|
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
121
138
|
requirements:
|
122
|
-
- -
|
139
|
+
- - '='
|
123
140
|
- !ruby/object:Gem::Version
|
124
141
|
version: 1.15.2
|
125
142
|
description: Correios CEP gem gets updated Brazilian address from a zipcode, directly
|
126
|
-
from Correios database. No HTML parsers
|
143
|
+
from Correios database. No HTML parsers.
|
127
144
|
email:
|
128
145
|
- prodis@gmail.com
|
129
146
|
executables: []
|
130
147
|
extensions: []
|
131
148
|
extra_rdoc_files: []
|
132
149
|
files:
|
133
|
-
-
|
134
|
-
-
|
135
|
-
-
|
150
|
+
- .gitignore
|
151
|
+
- .rspec
|
152
|
+
- .travis.yml
|
136
153
|
- CHANGELOG.rdoc
|
137
154
|
- Gemfile
|
138
155
|
- README.rdoc
|
@@ -153,28 +170,32 @@ files:
|
|
153
170
|
homepage: http://prodis.blog.br/correios-cep-gem-para-consulta-de-enderecos-por-cep
|
154
171
|
licenses:
|
155
172
|
- MIT
|
156
|
-
metadata: {}
|
157
173
|
post_install_message:
|
158
174
|
rdoc_options: []
|
159
175
|
require_paths:
|
160
176
|
- lib
|
161
177
|
required_ruby_version: !ruby/object:Gem::Requirement
|
178
|
+
none: false
|
162
179
|
requirements:
|
163
|
-
- -
|
180
|
+
- - ! '>='
|
164
181
|
- !ruby/object:Gem::Version
|
165
|
-
version: 1.9.
|
182
|
+
version: 1.9.2
|
166
183
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
184
|
+
none: false
|
167
185
|
requirements:
|
168
|
-
- -
|
186
|
+
- - ! '>='
|
169
187
|
- !ruby/object:Gem::Version
|
170
188
|
version: '0'
|
189
|
+
segments:
|
190
|
+
- 0
|
191
|
+
hash: -3925199381685944894
|
171
192
|
requirements: []
|
172
193
|
rubyforge_project:
|
173
|
-
rubygems_version:
|
194
|
+
rubygems_version: 1.8.25
|
174
195
|
signing_key:
|
175
|
-
specification_version:
|
196
|
+
specification_version: 3
|
176
197
|
summary: Correios CEP gem gets updated Brazilian address from a zipcode, directly
|
177
|
-
from Correios database. No HTML parsers
|
198
|
+
from Correios database. No HTML parsers.
|
178
199
|
test_files:
|
179
200
|
- spec/correios/cep/address_finder_spec.rb
|
180
201
|
- spec/correios/cep/parser_spec.rb
|
checksums.yaml
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz: 74eeacaf224a6667b7fe072f98d673415485b7d8
|
4
|
-
data.tar.gz: 3bbe59716bde2aa1dafc6e0b82a63b17e5060410
|
5
|
-
SHA512:
|
6
|
-
metadata.gz: 02e34371364e9c99601030c678a7433993b921041faea24c6742736c976b240637a5f50f79888b269e052512ae0984185f8ec1ba5ebcf37d1b38501d45461208
|
7
|
-
data.tar.gz: e58fc4b07f1f5f06ae6e87b40be161f1579319ccc951d9ce763832335904cf1cbd87bc90e93d39898d121a3e1067af76ba78a25cb833e0a78cf717f7966284c7
|