correios-cep 0.1.2 → 0.1.3

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: 2ae3e3f91d0821fdda221d34602c6c5f0e75485f
4
- data.tar.gz: 225d47253b5261291a661de99cb674a77a94d8f6
3
+ metadata.gz: 74eeacaf224a6667b7fe072f98d673415485b7d8
4
+ data.tar.gz: 3bbe59716bde2aa1dafc6e0b82a63b17e5060410
5
5
  SHA512:
6
- metadata.gz: 45ebcf3af3a53a45ececea956e457c74293bceafd23955224356c359f601a35baf13141a4b63b77b66cb361b7f4ba888ef066e441a5707b3c263e7fb841c9f04
7
- data.tar.gz: 0db954b8d1712e573139c2a147b8df9cea9bef7db0b9d1b2d66edae70359caa21c6d1def4b2b65cd2feb8896f7773eb7d5ba54df6a5d775ae991074edc856e02
6
+ metadata.gz: 02e34371364e9c99601030c678a7433993b921041faea24c6742736c976b240637a5f50f79888b269e052512ae0984185f8ec1ba5ebcf37d1b38501d45461208
7
+ data.tar.gz: e58fc4b07f1f5f06ae6e87b40be161f1579319ccc951d9ce763832335904cf1cbd87bc90e93d39898d121a3e1067af76ba78a25cb833e0a78cf717f7966284c7
data/CHANGELOG.rdoc CHANGED
@@ -1,3 +1,6 @@
1
+ == Version 0.1.3
2
+ - Improvement: Update LogMe gem to version 0.0.6 with support to log request and response messages.
3
+
1
4
  == Version 0.1.2
2
5
  - Improvement: Update LogMe gem to version 0.0.5 with support to log messages label.
3
6
 
data/correios-cep.gemspec CHANGED
@@ -20,10 +20,11 @@ Gem::Specification.new do |spec|
20
20
  spec.platform = Gem::Platform::RUBY
21
21
  spec.required_ruby_version = Gem::Requirement.new(">= 1.9.3")
22
22
 
23
- spec.add_dependency "log-me", "= 0.0.5"
23
+ spec.add_dependency "log-me", "= 0.0.6"
24
24
  spec.add_dependency "nokogiri", "~> 1.6"
25
25
 
26
26
  spec.add_development_dependency "coveralls"
27
+ spec.add_development_dependency "pry"
27
28
  spec.add_development_dependency "rake"
28
29
  spec.add_development_dependency "rspec", "~> 2.14"
29
30
  spec.add_development_dependency "vcr", "~> 2.8"
@@ -1,5 +1,5 @@
1
1
  module Correios
2
2
  module CEP
3
- VERSION = "0.1.2"
3
+ VERSION = "0.1.3"
4
4
  end
5
5
  end
@@ -14,10 +14,10 @@ module Correios
14
14
  http = build_http
15
15
 
16
16
  request = build_request zipcode
17
- log_request request
17
+ Correios::CEP.log_request request, @uri.to_s
18
18
 
19
19
  response = http.request request
20
- log_response response
20
+ Correios::CEP.log_response response
21
21
 
22
22
  response.body
23
23
  end
@@ -48,33 +48,6 @@ module Correios
48
48
  "</soapenv:Body>" +
49
49
  "</soapenv:Envelope>"
50
50
  end
51
-
52
- def log_request(request)
53
- message = format_message(request) do
54
- message = with_line_break { "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 { "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
51
  end
79
52
  end
80
53
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: correios-cep
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Prodis a.k.a. Fernando Hamasaki de Amorim
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-19 00:00:00.000000000 Z
11
+ date: 2014-02-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: log-me
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.0.5
19
+ version: 0.0.6
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.0.5
26
+ version: 0.0.6
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: nokogiri
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: pry
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: rake
57
71
  requirement: !ruby/object:Gem::Requirement