correios-cep 0.0.1 → 0.1.0

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
- NWQ3NTU0ZmM1MDc5ZDFmMThlNTQ4ZDZmYzA4MjU0NDdlY2JhOTg2Nw==
4
+ NWUzZGIzNDAzN2UyMzE2NTNkMWQ3NzEyNjZkZDJlMWVlMTZjYTk2MQ==
5
5
  data.tar.gz: !binary |-
6
- MzdjNTJhZTk4YmRmZGI1N2M2NTI0YWFkNDRlMjI1ZmMyMzJhZDliOQ==
6
+ ZmYyNWFhYzJjY2Q0NGExZjllYWRiNzljYTE2ZGIxYTIzOGE1ZTkwMg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NTQxN2ViMDUyOTA2YTM4NmViZWQ0YjBiYmI5MmJjY2FjMGM5MjkxOTQyMWQz
10
- Yjg4NWY2N2ExMTVlZWYwYmU1ZTMyYTVkN2RlYjMwOGU1NDVmOTk4NTI4MGZl
11
- NDE2NzZlMzEzYzNjNjdhZWViMWRhZmRmYjkyNjRmN2U4MTUxYjU=
9
+ ZjQyODkzMGZmMjUzMjMzNzY1ZGQ2NDNmZmE0YjIzNzA1NjBiZTlhOGQ5YWZm
10
+ MGIzM2ZjMzIxNDI0MjY4YzJlYWYxZmMyMmZlZjUyNjMwNGIyYzgwODlkM2Rk
11
+ MGNhZGRmOThiZWFiYWRmZWJiNjM3MDZiZTM4ZWVhMjJkYzdlYWY=
12
12
  data.tar.gz: !binary |-
13
- NDJmZGVjOGI5NGEwMTU0MmQ0NGQ1OGRiMzMxMzJmYzUyMGJmM2M4ZDlmOGNl
14
- NWExOGExMzMyM2I2OTM4NGJiMWI5ZjM4MGM2NTg2NzU5MGI1NTUwYWEyMTYw
15
- MzY2NDI5ZTI1NzYzZWFjNzg0NjFhNDNiODg4ZDZmNTZlNmQ2MjI=
13
+ NDliYTA5YWE5ODJlOGE1ZGE1NzQyNmE0Y2YzYTQxY2FkMjc0MDA5MzU3YmNj
14
+ YzUzMTY0OGZlODQ4ZTg2ZTgzYTBhOTJmYWIzYTVmMmFhNDQ2NmRhNzNlNjdj
15
+ YjQxYzA1OWY1MjY3OTRmMjkwYjdjMTNiYmYyZGY3NTg4MjZiOGM=
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --format nested
data/CHANGELOG.rdoc ADDED
@@ -0,0 +1,5 @@
1
+ == Version 0.1.0
2
+ - First working version.
3
+
4
+ == Version 0.0.1
5
+ - First version, not working yet.
data/Gemfile CHANGED
@@ -1,4 +1,2 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in correios-cep.gemspec
1
+ source "http://rubygems.org"
4
2
  gemspec
data/README.rdoc CHANGED
@@ -1,6 +1,7 @@
1
1
  = correios-cep
2
2
 
3
- Correios CEP
3
+ Correios CEP gem gets updated Brazilian address from a zipcode, directly from Correios database.
4
+ No HTML parsers, no workarounds, no "gambis".
4
5
 
5
6
  http://prodis.net.br/images/ruby/2011/correios_logo.png
6
7
 
@@ -18,14 +19,81 @@ http://prodis.net.br/images/ruby/2011/correios_logo.png
18
19
 
19
20
  require 'correios-cep'
20
21
 
22
+ finder = Correios::CEP::AddressFinder.new
23
+ address = finder.get "54250610"
24
+ address # =>
25
+ {
26
+ :address => "Rua Fernando Amorim",
27
+ :neighborhood => "Cavaleiro",
28
+ :city => "Jaboatão dos Guararapes",
29
+ :state => "PE",
30
+ :zipcode => "54250610",
31
+ :complement => ""
32
+ }
33
+
21
34
 
22
35
  == Configurations
23
36
 
24
37
  === Timeout
25
38
 
39
+ For default, the timeout for a request to Correios Web Service is <b>5 seconds</b>. If Correios Web Service does not respond, a <b>Timeout::Error</b> exception will be raised.
40
+ You can configure this timeout using <b>Correios::CEP</b> module.
41
+
42
+ Correios::CEP.configure do |config|
43
+ config.request_timeout = 3 # It configures timeout to 3 seconds
44
+ end
26
45
 
27
46
  === Log
28
47
 
48
+ For default, each request to Correios Web service is logged to STDOUT, with <b>:info</b> log level, using the gem {LogMe}[http://github.com/prodis/log-me].
49
+
50
+ Log example:
51
+ I, [2014-02-14T00:10:12.718413 #76361] INFO -- : Correios-CEP Request:
52
+ POST http://200.252.60.209/SigepCliente/AtendeClienteService
53
+ <?xml version="1.0" encoding="UTF-8"?>
54
+ <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cli="http://cliente.bean.master.sigep.bsb.correios.com.br/">
55
+ <soapenv:Header />
56
+ <soapenv:Body>
57
+ <cli:consultaCEP>
58
+ <cep>54250610</cep>
59
+ </cli:consultaCEP>
60
+ </soapenv:Body>
61
+ </soapenv:Envelope>
62
+
63
+ I, [2014-02-14T00:10:12.969937 #76361] INFO -- : Correios-CEP Response:
64
+ HTTP/1.1 200 OK
65
+ <?xml version='1.0' encoding='UTF-8'?>
66
+ <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
67
+ <S:Body>
68
+ <ns2:consultaCEPResponse xmlns:ns2="http://cliente.bean.master.sigep.bsb.correios.com.br/">
69
+ <return>
70
+ <bairro>Cavaleiro</bairro>
71
+ <cep>54250610</cep>
72
+ <cidade>Jaboatão dos Guararapes</cidade>
73
+ <complemento></complemento>
74
+ <complemento2></complemento2>
75
+ <end>Rua Fernando Amorim</end>
76
+ <id>0</id>
77
+ <uf>PE</uf>
78
+ </return>
79
+ </ns2:consultaCEPResponse>
80
+ </S:Body>
81
+ </S:Envelope>
82
+
83
+ To disable the log and configure other log output, use <b>Correios::CEP</b> module:
84
+
85
+ Correios::CEP.configure do |config|
86
+ config.log_enabled = false # It disables the log
87
+ config.logger = Rails.logger # It uses Rails logger
88
+ end
89
+
90
+ === Configuration example
91
+
92
+ Correios::CEP.configure do |config|
93
+ config.logger = Rails.logger
94
+ config.request_timeout = 3
95
+ end
96
+
29
97
 
30
98
  == Author
31
99
  - {Fernando Hamasaki de Amorim (prodis)}[http://prodis.blog.br]
@@ -47,7 +115,7 @@ http://prodis.net.br/images/ruby/2011/correios_logo.png
47
115
 
48
116
  (The MIT License)
49
117
 
50
- {Prodis a.k.a. Fernando Hamasaki}[http://prodis.blog.br]
118
+ {Prodis a.k.a. Fernando Hamasaki de Amorim}[http://prodis.blog.br]
51
119
 
52
120
  http://prodis.net.br/images/prodis_150.gif
53
121
 
data/correios-cep.gemspec CHANGED
@@ -1,16 +1,15 @@
1
- # coding: utf-8
2
1
  lib = File.expand_path('../lib', __FILE__)
3
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
3
  require 'correios/cep/version'
5
4
 
6
5
  Gem::Specification.new do |spec|
7
6
  spec.name = "correios-cep"
8
- spec.version = Correios::Cep::VERSION
9
- spec.authors = ["Fernando Hamasaki de Amorim"]
7
+ spec.version = Correios::CEP::VERSION
8
+ spec.authors = ["Prodis a.k.a. Fernando Hamasaki de Amorim"]
10
9
  spec.email = ["prodis@gmail.com"]
11
- spec.description = %q{Correios CEP}
12
- spec.summary = %q{Correios CEP}
13
- spec.homepage = ""
10
+ spec.description = %q{Correios CEP gem gets updated Brazilian address from a zipcode, directly from Correios database. No HTML parsers, no workarounds, no "gambis".}
11
+ spec.summary = spec.description
12
+ spec.homepage = "https://github.com/prodis/correios-cep"
14
13
  spec.license = "MIT"
15
14
 
16
15
  spec.files = `git ls-files`.split($/)
@@ -18,6 +17,11 @@ Gem::Specification.new do |spec|
18
17
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
18
  spec.require_paths = ["lib"]
20
19
 
21
- spec.add_development_dependency "bundler", "~> 1.3"
20
+ spec.add_dependency "log-me", "~> 0.0.4"
21
+ spec.add_dependency "nokogiri", "~> 1.6"
22
+
22
23
  spec.add_development_dependency "rake"
24
+ spec.add_development_dependency "rspec", "~> 2.14"
25
+ spec.add_development_dependency "vcr", "~> 2.8"
26
+ spec.add_development_dependency "webmock", "~> 1.15.2"
23
27
  end
@@ -0,0 +1,4 @@
1
+ require 'correios/cep'
2
+ require 'correios/cep/address_finder'
3
+ require 'correios/cep/parser'
4
+ require 'correios/cep/web_service'
data/lib/correios/cep.rb CHANGED
@@ -1,7 +1,18 @@
1
- require "correios/cep/version"
1
+ require 'log-me'
2
2
 
3
3
  module Correios
4
- module Cep
5
- # Your code goes here...
4
+ module CEP
5
+ extend LogMe
6
+
7
+ module Timeout
8
+ DEFAULT_REQUEST_TIMEOUT = 5 #seconds
9
+ attr_writer :request_timeout
10
+
11
+ def request_timeout
12
+ (@request_timeout ||= DEFAULT_REQUEST_TIMEOUT).to_i
13
+ end
14
+ end
15
+
16
+ extend Timeout
6
17
  end
7
18
  end
@@ -0,0 +1,20 @@
1
+ module Correios
2
+ module CEP
3
+ class AddressFinder
4
+ def get(zipcode)
5
+ response = web_service.request! zipcode
6
+ parser.address response
7
+ end
8
+
9
+ private
10
+
11
+ def web_service
12
+ @web_service ||= Correios::CEP::WebService.new
13
+ end
14
+
15
+ def parser
16
+ @parser ||= Correios::CEP::Parser.new
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,37 @@
1
+ require 'nokogiri'
2
+
3
+ module Correios
4
+ module CEP
5
+ class Parser
6
+ ADDRESS_MAP = {
7
+ "end" => :address,
8
+ "bairro" => :neighborhood,
9
+ "cidade" => :city,
10
+ "uf" => :state,
11
+ "cep" => :zipcode,
12
+ "complemento" => :complement,
13
+ "complemento2" => :complement2,
14
+ }.freeze
15
+
16
+ def address(xml)
17
+ result = Nokogiri::XML(xml).xpath("//return")
18
+ return if result.nil? || result.empty?
19
+
20
+ address = {}
21
+ result.children.each do |element|
22
+ address[ADDRESS_MAP[element.name]] = element.text if ADDRESS_MAP[element.name]
23
+ end
24
+
25
+ join_complements! address
26
+ address
27
+ end
28
+
29
+ private
30
+
31
+ def join_complements!(address)
32
+ address[:complement] += " #{address.delete(:complement2)}"
33
+ address[:complement].strip!
34
+ end
35
+ end
36
+ end
37
+ end
@@ -1,5 +1,5 @@
1
1
  module Correios
2
- module Cep
3
- VERSION = "0.0.1"
2
+ module CEP
3
+ VERSION = "0.1.0"
4
4
  end
5
5
  end
@@ -0,0 +1,80 @@
1
+ require 'net/http'
2
+ require 'uri'
3
+
4
+ module Correios
5
+ module CEP
6
+ class WebService
7
+ URL = "http://200.252.60.209/SigepCliente/AtendeClienteService"
8
+
9
+ def initialize
10
+ @uri = URI.parse(URL)
11
+ end
12
+
13
+ def request!(zipcode)
14
+ http = build_http
15
+
16
+ request = build_request zipcode
17
+ log_request request
18
+
19
+ response = http.request request
20
+ log_response response
21
+
22
+ response.body
23
+ end
24
+
25
+ private
26
+
27
+ def build_http
28
+ http = Net::HTTP.new(@uri.host, @uri.port)
29
+ http.open_timeout = Correios::CEP.request_timeout
30
+ http
31
+ end
32
+
33
+ def build_request(zipcode)
34
+ request = Net::HTTP::Post.new(@uri.path)
35
+ request["Content-Type"] = "text/xml; charset=utf-8"
36
+ request.body = request_body zipcode
37
+ request
38
+ end
39
+
40
+ def request_body(zipcode)
41
+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
42
+ "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:cli=\"http://cliente.bean.master.sigep.bsb.correios.com.br/\">" +
43
+ "<soapenv:Header />" +
44
+ "<soapenv:Body>" +
45
+ "<cli:consultaCEP>" +
46
+ "<cep>#{zipcode}</cep>" +
47
+ "</cli:consultaCEP>" +
48
+ "</soapenv:Body>" +
49
+ "</soapenv:Envelope>"
50
+ end
51
+
52
+ def log_request(request)
53
+ message = format_message(request) do
54
+ message = with_line_break { "Correios-CEP Request:" }
55
+ message << with_line_break { "POST #{URL}" }
56
+ end
57
+
58
+ Correios::CEP.log(message)
59
+ end
60
+
61
+ def log_response(response)
62
+ message = format_message(response) do
63
+ message = with_line_break { "Correios-CEP Response:" }
64
+ message << with_line_break { "HTTP/#{response.http_version} #{response.code} #{response.message}" }
65
+ end
66
+
67
+ Correios::CEP.log(message)
68
+ end
69
+
70
+ def format_message(http)
71
+ message = yield
72
+ message << with_line_break { http.body }
73
+ end
74
+
75
+ def with_line_break
76
+ "#{yield}\n"
77
+ end
78
+ end
79
+ end
80
+ end
@@ -0,0 +1,18 @@
1
+ require 'spec_helper'
2
+
3
+ describe Correios::CEP::AddressFinder do
4
+ let(:cep) { "54250610" }
5
+ let(:web_service_response) { "<end>Rua Fernando Amorim</end>" }
6
+ let(:address) { { address: "Rua Fernando Amorim" } }
7
+
8
+ 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)
12
+ end
13
+
14
+ it "returns address" do
15
+ expect(subject.get(cep)).to eq address
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,57 @@
1
+ # encoding: UTF-8
2
+ require 'spec_helper'
3
+
4
+ describe Correios::CEP::Parser do
5
+ describe "#address" do
6
+ context "when address is found" do
7
+ let(:xml) do
8
+ "<?xml version='1.0' encoding='UTF-8'?>" +
9
+ "<S:Envelope>" +
10
+ "<S:Body>" +
11
+ "<ns2:consultaCEPResponse xmlns:ns2=\"http://cliente.bean.master.sigep.bsb.correios.com.br/\">" +
12
+ "<return>" +
13
+ "<bairro>Cavaleiro</bairro>" +
14
+ "<cep>54250610</cep>" +
15
+ "<cidade>Jaboatão dos Guararapes</cidade>" +
16
+ "<complemento>de 1500 até o fim</complemento>" +
17
+ "<complemento2>(zona mista)</complemento2>" +
18
+ "<end>Rua Fernando Amorim</end>" +
19
+ "<id>0</id>" +
20
+ "<uf>PE</uf>" +
21
+ "</return>" +
22
+ "</ns2:consultaCEPResponse>" +
23
+ "</S:Body>" +
24
+ "</S:Envelope>"
25
+ end
26
+ let(:expected_address) do
27
+ {
28
+ address: "Rua Fernando Amorim",
29
+ neighborhood: "Cavaleiro",
30
+ city: "Jaboatão dos Guararapes",
31
+ state: "PE",
32
+ zipcode: "54250610",
33
+ complement: "de 1500 até o fim (zona mista)"
34
+ }
35
+ end
36
+
37
+ it "returns address" do
38
+ expect(subject.address(xml)).to eq expected_address
39
+ end
40
+ end
41
+
42
+ context "when address is not found" do
43
+ let(:xml) do
44
+ "<?xml version='1.0' encoding='UTF-8'?>" +
45
+ "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">" +
46
+ "<S:Body>" +
47
+ "<ns2:consultaCEPResponse xmlns:ns2=\"http://cliente.bean.master.sigep.bsb.correios.com.br/\"/>" +
48
+ "</S:Body>" +
49
+ "</S:Envelope>"
50
+ end
51
+
52
+ it "returns nil" do
53
+ expect(subject.address(xml)).to be_nil
54
+ end
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,18 @@
1
+ require 'spec_helper'
2
+
3
+ describe Correios::CEP::WebService do
4
+ let(:cep) { "54250610" }
5
+
6
+ describe "#request!", vcr: { cassette_name: "correios_consulta_cep_ok" } do
7
+ around do |example|
8
+ Correios::CEP.log_enabled = false
9
+ example.run
10
+ Correios::CEP.log_enabled = true
11
+ end
12
+
13
+ it "returns HTTP response body from Correios Web Service" do
14
+ result = subject.request! cep
15
+ expect(result).to include("Rua Fernando Amorim")
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,22 @@
1
+ require 'spec_helper'
2
+
3
+ describe Correios::CEP do
4
+ describe "#request_timeout" do
5
+ it "default is 5" do
6
+ Correios::CEP.request_timeout.should eql 5
7
+ end
8
+
9
+ context "when set timeout" do
10
+ it "returns timeout" do
11
+ Correios::CEP.configure { |config| config.request_timeout = 3 }
12
+ Correios::CEP.request_timeout.should eql 3
13
+ end
14
+
15
+ it "returns timeout in seconds (integer)" do
16
+ Correios::CEP.configure { |config| config.request_timeout = 2.123 }
17
+ Correios::CEP.request_timeout.should eql 2
18
+ end
19
+ end
20
+ end
21
+ end
22
+
@@ -0,0 +1,58 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://200.252.60.209/SigepCliente/AtendeClienteService
6
+ body:
7
+ encoding: US-ASCII
8
+ string: <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
9
+ xmlns:cli="http://cliente.bean.master.sigep.bsb.correios.com.br/"><soapenv:Header
10
+ /><soapenv:Body><cli:consultaCEP><cep>54250610</cep></cli:consultaCEP></soapenv:Body></soapenv:Envelope>
11
+ headers:
12
+ Accept:
13
+ - ! '*/*'
14
+ User-Agent:
15
+ - Ruby
16
+ Content-Type:
17
+ - text/xml; charset=utf-8
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: !binary |-
22
+ T0s=
23
+ headers:
24
+ !binary "RGF0ZQ==":
25
+ - !binary |-
26
+ V2VkLCAxMiBGZWIgMjAxNCAwNDoyNDowMSBHTVQ=
27
+ !binary "U2VydmVy":
28
+ - !binary |-
29
+ QXBhY2hlLzIuMi4zIChSZWQgSGF0KQ==
30
+ !binary "WC1Qb3dlcmVkLUJ5":
31
+ - !binary |-
32
+ U2VydmxldC8yLjUgSlNQLzIuMQ==
33
+ !binary "Q29ubmVjdGlvbg==":
34
+ - !binary |-
35
+ Y2xvc2U=
36
+ !binary "VHJhbnNmZXItRW5jb2Rpbmc=":
37
+ - !binary |-
38
+ Y2h1bmtlZA==
39
+ !binary "Q29udGVudC1UeXBl":
40
+ - !binary |-
41
+ dGV4dC94bWw7Y2hhcnNldD0idXRmLTgi
42
+ body:
43
+ encoding: ASCII-8BIT
44
+ string: !binary |-
45
+ PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz48UzpFbnZl
46
+ bG9wZSB4bWxuczpTPSJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy9zb2Fw
47
+ L2VudmVsb3BlLyI+PFM6Qm9keT48bnMyOmNvbnN1bHRhQ0VQUmVzcG9uc2Ug
48
+ eG1sbnM6bnMyPSJodHRwOi8vY2xpZW50ZS5iZWFuLm1hc3Rlci5zaWdlcC5i
49
+ c2IuY29ycmVpb3MuY29tLmJyLyI+PHJldHVybj48YmFpcnJvPkNhdmFsZWly
50
+ bzwvYmFpcnJvPjxjZXA+NTQyNTA2MTA8L2NlcD48Y2lkYWRlPkphYm9hdMOj
51
+ byBkb3MgR3VhcmFyYXBlczwvY2lkYWRlPjxjb21wbGVtZW50bz48L2NvbXBs
52
+ ZW1lbnRvPjxjb21wbGVtZW50bzI+PC9jb21wbGVtZW50bzI+PGVuZD5SdWEg
53
+ RmVybmFuZG8gQW1vcmltPC9lbmQ+PGlkPjA8L2lkPjx1Zj5QRTwvdWY+PC9y
54
+ ZXR1cm4+PC9uczI6Y29uc3VsdGFDRVBSZXNwb25zZT48L1M6Qm9keT48L1M6
55
+ RW52ZWxvcGU+
56
+ http_version:
57
+ recorded_at: Wed, 12 Feb 2014 04:25:10 GMT
58
+ recorded_with: VCR 2.8.0
@@ -0,0 +1,18 @@
1
+ require 'correios-cep'
2
+ require 'vcr'
3
+
4
+ # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
5
+ RSpec.configure do |config|
6
+ config.treat_symbols_as_metadata_keys_with_true_values = true
7
+ config.run_all_when_everything_filtered = true
8
+ config.filter_run :focus
9
+ config.order = "random"
10
+ end
11
+
12
+ VCR.configure do |config|
13
+ config.default_cassette_options = { :match_requests_on => [:uri, :method, :body, :headers] }
14
+ config.cassette_library_dir = 'spec/fixtures/cassettes'
15
+ config.hook_into :webmock
16
+ config.configure_rspec_metadata!
17
+ end
18
+
metadata CHANGED
@@ -1,29 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: correios-cep
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
- - Fernando Hamasaki de Amorim
7
+ - Prodis a.k.a. Fernando Hamasaki de Amorim
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-12 00:00:00.000000000 Z
11
+ date: 2014-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: bundler
14
+ name: log-me
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ~>
18
18
  - !ruby/object:Gem::Version
19
- version: '1.3'
20
- type: :development
19
+ version: 0.0.4
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: 0.0.4
27
+ - !ruby/object:Gem::Dependency
28
+ name: nokogiri
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: '1.6'
34
+ type: :runtime
21
35
  prerelease: false
22
36
  version_requirements: !ruby/object:Gem::Requirement
23
37
  requirements:
24
38
  - - ~>
25
39
  - !ruby/object:Gem::Version
26
- version: '1.3'
40
+ version: '1.6'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: rake
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -38,7 +52,50 @@ dependencies:
38
52
  - - ! '>='
39
53
  - !ruby/object:Gem::Version
40
54
  version: '0'
41
- description: Correios CEP
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: '2.14'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: '2.14'
69
+ - !ruby/object:Gem::Dependency
70
+ name: vcr
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ~>
74
+ - !ruby/object:Gem::Version
75
+ version: '2.8'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ~>
81
+ - !ruby/object:Gem::Version
82
+ version: '2.8'
83
+ - !ruby/object:Gem::Dependency
84
+ name: webmock
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ~>
88
+ - !ruby/object:Gem::Version
89
+ version: 1.15.2
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ~>
95
+ - !ruby/object:Gem::Version
96
+ version: 1.15.2
97
+ description: Correios CEP gem gets updated Brazilian address from a zipcode, directly
98
+ from Correios database. No HTML parsers, no workarounds, no "gambis".
42
99
  email:
43
100
  - prodis@gmail.com
44
101
  executables: []
@@ -46,13 +103,25 @@ extensions: []
46
103
  extra_rdoc_files: []
47
104
  files:
48
105
  - .gitignore
106
+ - .rspec
107
+ - CHANGELOG.rdoc
49
108
  - Gemfile
50
109
  - README.rdoc
51
110
  - Rakefile
52
111
  - correios-cep.gemspec
112
+ - lib/correios-cep.rb
53
113
  - lib/correios/cep.rb
114
+ - lib/correios/cep/address_finder.rb
115
+ - lib/correios/cep/parser.rb
54
116
  - lib/correios/cep/version.rb
55
- homepage: ''
117
+ - lib/correios/cep/web_service.rb
118
+ - spec/correios/cep/address_finder_spec.rb
119
+ - spec/correios/cep/parser_spec.rb
120
+ - spec/correios/cep/web_service_spec.rb
121
+ - spec/correios/cep_spec.rb
122
+ - spec/fixtures/cassettes/correios_consulta_cep_ok.yml
123
+ - spec/spec_helper.rb
124
+ homepage: https://github.com/prodis/correios-cep
56
125
  licenses:
57
126
  - MIT
58
127
  metadata: {}
@@ -75,5 +144,12 @@ rubyforge_project:
75
144
  rubygems_version: 2.0.4
76
145
  signing_key:
77
146
  specification_version: 4
78
- summary: Correios CEP
79
- test_files: []
147
+ summary: Correios CEP gem gets updated Brazilian address from a zipcode, directly
148
+ from Correios database. No HTML parsers, no workarounds, no "gambis".
149
+ test_files:
150
+ - spec/correios/cep/address_finder_spec.rb
151
+ - spec/correios/cep/parser_spec.rb
152
+ - spec/correios/cep/web_service_spec.rb
153
+ - spec/correios/cep_spec.rb
154
+ - spec/fixtures/cassettes/correios_consulta_cep_ok.yml
155
+ - spec/spec_helper.rb