correios-cep 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/CHANGELOG.rdoc +3 -0
- data/README.rdoc +5 -0
- data/correios-cep.gemspec +3 -0
- data/lib/correios/cep/address_finder.rb +4 -0
- data/lib/correios/cep/version.rb +1 -1
- data/spec/correios/cep/address_finder_spec.rb +10 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
OTA5NzFkZDkzZTIwY2FjNTE3NTA0OGNjMjhjZjc4YmY5NzcyZTJkNA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ODhlZTBlZjgxMzcxODczYjU4ODI5ZWNkYWU0YmQ5Nzg3ZmYyZWJkZQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NmM5MGQ4OTVlNGM3OGJhYzU2ZTdkNGE5ZmE2Y2JmZjBhOWQ1YzA0MWRjNzNk
|
10
|
+
NzNmY2ZmZDI2YjI1NGYwNmYxOGZlNDNmM2UxNzAyMzZjZDU0ZmYxMDkyMjcy
|
11
|
+
MTE3NzExOGExODVmOWMxZGE3NzUyNjU2ZDkyMmUwNDBlMDlmOGQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZGQ5YmVkMTQ5ZTkyMGQxNTE0ODc0MDE3NGYwZTU0OWYzMDgzNTdlZWQ4NDkz
|
14
|
+
ZGI1N2M5MTMwNDk3NjQ2ODRkNGE4ZWE1ZTNmNWRhNjFiOTY1YWFkYjFmMDNm
|
15
|
+
YjJjMGU0MmY3ZmJlMzBmZjA3YmJlMTJhYzRhMzI5NzhhMzI1ZWU=
|
data/CHANGELOG.rdoc
CHANGED
data/README.rdoc
CHANGED
@@ -19,8 +19,13 @@ http://prodis.net.br/images/ruby/2011/correios_logo.png
|
|
19
19
|
|
20
20
|
require 'correios-cep'
|
21
21
|
|
22
|
+
# With "get" instance method
|
22
23
|
finder = Correios::CEP::AddressFinder.new
|
23
24
|
address = finder.get "54250610"
|
25
|
+
|
26
|
+
# With "get" class method
|
27
|
+
address = Correios::CEP::AddressFinder.get "54250610"
|
28
|
+
|
24
29
|
address # =>
|
25
30
|
{
|
26
31
|
:address => "Rua Fernando Amorim",
|
data/correios-cep.gemspec
CHANGED
@@ -17,6 +17,9 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
18
|
spec.require_paths = ["lib"]
|
19
19
|
|
20
|
+
spec.platform = Gem::Platform::RUBY
|
21
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 1.9.3")
|
22
|
+
|
20
23
|
spec.add_dependency "log-me", "~> 0.0.4"
|
21
24
|
spec.add_dependency "nokogiri", "~> 1.6"
|
22
25
|
|
data/lib/correios/cep/version.rb
CHANGED
@@ -5,14 +5,20 @@ describe Correios::CEP::AddressFinder do
|
|
5
5
|
let(:web_service_response) { "<end>Rua Fernando Amorim</end>" }
|
6
6
|
let(:address) { { address: "Rua Fernando Amorim" } }
|
7
7
|
|
8
|
+
before do
|
9
|
+
Correios::CEP::WebService.any_instance.stub(:request!).with(cep).and_return(web_service_response)
|
10
|
+
Correios::CEP::Parser.any_instance.stub(:address).with(web_service_response).and_return(address)
|
11
|
+
end
|
12
|
+
|
8
13
|
describe "#get" do
|
9
|
-
|
10
|
-
|
11
|
-
Correios::CEP::Parser.any_instance.stub(:address).with(web_service_response).and_return(address)
|
14
|
+
it "returns address" do
|
15
|
+
expect(subject.get(cep)).to eq address
|
12
16
|
end
|
17
|
+
end
|
13
18
|
|
19
|
+
describe ".get" do
|
14
20
|
it "returns address" do
|
15
|
-
expect(
|
21
|
+
expect(Correios::CEP::AddressFinder.get(cep)).to eq address
|
16
22
|
end
|
17
23
|
end
|
18
24
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Prodis a.k.a. Fernando Hamasaki de Amorim
|
@@ -133,7 +133,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
133
133
|
requirements:
|
134
134
|
- - ! '>='
|
135
135
|
- !ruby/object:Gem::Version
|
136
|
-
version:
|
136
|
+
version: 1.9.3
|
137
137
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
138
138
|
requirements:
|
139
139
|
- - ! '>='
|