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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NWUzZGIzNDAzN2UyMzE2NTNkMWQ3NzEyNjZkZDJlMWVlMTZjYTk2MQ==
4
+ OTA5NzFkZDkzZTIwY2FjNTE3NTA0OGNjMjhjZjc4YmY5NzcyZTJkNA==
5
5
  data.tar.gz: !binary |-
6
- ZmYyNWFhYzJjY2Q0NGExZjllYWRiNzljYTE2ZGIxYTIzOGE1ZTkwMg==
6
+ ODhlZTBlZjgxMzcxODczYjU4ODI5ZWNkYWU0YmQ5Nzg3ZmYyZWJkZQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- ZjQyODkzMGZmMjUzMjMzNzY1ZGQ2NDNmZmE0YjIzNzA1NjBiZTlhOGQ5YWZm
10
- MGIzM2ZjMzIxNDI0MjY4YzJlYWYxZmMyMmZlZjUyNjMwNGIyYzgwODlkM2Rk
11
- MGNhZGRmOThiZWFiYWRmZWJiNjM3MDZiZTM4ZWVhMjJkYzdlYWY=
9
+ NmM5MGQ4OTVlNGM3OGJhYzU2ZTdkNGE5ZmE2Y2JmZjBhOWQ1YzA0MWRjNzNk
10
+ NzNmY2ZmZDI2YjI1NGYwNmYxOGZlNDNmM2UxNzAyMzZjZDU0ZmYxMDkyMjcy
11
+ MTE3NzExOGExODVmOWMxZGE3NzUyNjU2ZDkyMmUwNDBlMDlmOGQ=
12
12
  data.tar.gz: !binary |-
13
- NDliYTA5YWE5ODJlOGE1ZGE1NzQyNmE0Y2YzYTQxY2FkMjc0MDA5MzU3YmNj
14
- YzUzMTY0OGZlODQ4ZTg2ZTgzYTBhOTJmYWIzYTVmMmFhNDQ2NmRhNzNlNjdj
15
- YjQxYzA1OWY1MjY3OTRmMjkwYjdjMTNiYmYyZGY3NTg4MjZiOGM=
13
+ ZGQ5YmVkMTQ5ZTkyMGQxNTE0ODc0MDE3NGYwZTU0OWYzMDgzNTdlZWQ4NDkz
14
+ ZGI1N2M5MTMwNDk3NjQ2ODRkNGE4ZWE1ZTNmNWRhNjFiOTY1YWFkYjFmMDNm
15
+ YjJjMGU0MmY3ZmJlMzBmZjA3YmJlMTJhYzRhMzI5NzhhMzI1ZWU=
data/CHANGELOG.rdoc CHANGED
@@ -1,3 +1,6 @@
1
+ == Version 0.1.1
2
+ - New: A "get" class method in AddressFinder class.
3
+
1
4
  == Version 0.1.0
2
5
  - First working version.
3
6
 
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
 
@@ -6,6 +6,10 @@ module Correios
6
6
  parser.address response
7
7
  end
8
8
 
9
+ def self.get(zipcode)
10
+ self.new.get zipcode
11
+ end
12
+
9
13
  private
10
14
 
11
15
  def web_service
@@ -1,5 +1,5 @@
1
1
  module Correios
2
2
  module CEP
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
@@ -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
- before do
10
- Correios::CEP::WebService.any_instance.stub(:request!).with(cep).and_return(web_service_response)
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(subject.get(cep)).to eq address
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.0
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: '0'
136
+ version: 1.9.3
137
137
  required_rubygems_version: !ruby/object:Gem::Requirement
138
138
  requirements:
139
139
  - - ! '>='