business-br 0.10.0 → 0.12.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +19 -17
- data/Gemfile +1 -0
- data/Gemfile.lock +40 -44
- data/business-br.gemspec +23 -9
- data/lib/business-br/cep/providers/base.rb +2 -1
- data/lib/business-br/cep/providers/postmon.rb +2 -4
- data/lib/business-br/cep/providers/republicavirtual.rb +5 -2
- data/lib/business-br/version.rb +1 -1
- metadata +35 -28
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b15c8e235da934d1d27d9781215977293e64d8aacf81e08536366a2d03dc922
|
4
|
+
data.tar.gz: c1afa1ea391ce25520de325de8b35bc8b86c2a8da2690469b74b04e555c1f587
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 15225c1852e5a5b27a6d2a58c99c75ebc1d727a273ef22874de1b8b3cf6b63d2550af14f5579e57df767eea052c7c27a8fb611ac9677f56bad0bdb393d373967
|
7
|
+
data.tar.gz: 768d07b1808da30c82d630d79093e883b7c5cc0979e15035bef108473d48e6d345418f9db94f4fb2b4d87edb184923537adc9601c86ba767762e62ba6cf2b986
|
data/.travis.yml
CHANGED
@@ -1,27 +1,29 @@
|
|
1
|
+
env:
|
2
|
+
global:
|
3
|
+
- COVERAGE=true
|
4
|
+
|
1
5
|
language: ruby
|
2
|
-
sudo: false
|
3
6
|
|
4
7
|
rvm:
|
5
|
-
- 2.
|
6
|
-
- 2.
|
7
|
-
- 2.
|
8
|
-
- 2.
|
9
|
-
- 2.0.0
|
10
|
-
- jruby-9.0.5.0
|
11
|
-
- jruby-19mode
|
12
|
-
- ruby-head
|
13
|
-
|
14
|
-
matrix:
|
15
|
-
allow_failures:
|
16
|
-
- rvm: jruby-19mode
|
17
|
-
- rvm: jruby-head
|
8
|
+
- 2.7
|
9
|
+
- 2.6
|
10
|
+
- 2.5
|
11
|
+
- 2.4
|
18
12
|
|
19
13
|
before_install:
|
20
|
-
- gem
|
14
|
+
- gem update
|
15
|
+
- gem install bundler --force
|
21
16
|
|
22
|
-
bundler_args:
|
23
|
-
--without test --jobs 3 --retry 3
|
17
|
+
bundler_args: --jobs 3 --retry 3
|
24
18
|
|
25
19
|
before_script:
|
20
|
+
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
21
|
+
- chmod +x ./cc-test-reporter
|
22
|
+
- ./cc-test-reporter before-build
|
26
23
|
- bundle update
|
27
24
|
|
25
|
+
script:
|
26
|
+
- bundle exec rspec
|
27
|
+
|
28
|
+
after_script:
|
29
|
+
- ./cc-test-reporter after-build --coverage-input-type simplecov --exit-code $TRAVIS_TEST_RESULT
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,63 +1,59 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
business-br (0.
|
5
|
-
|
4
|
+
business-br (0.12.1)
|
5
|
+
faraday (~> 2.6)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
addressable (2.
|
11
|
-
public_suffix (
|
12
|
-
crack (0.4.
|
13
|
-
|
14
|
-
diff-lcs (1.
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
rspec (3.
|
31
|
-
rspec-core (~> 3.5.0)
|
32
|
-
rspec-expectations (~> 3.5.0)
|
33
|
-
rspec-mocks (~> 3.5.0)
|
34
|
-
rspec-core (3.5.2)
|
35
|
-
rspec-support (~> 3.5.0)
|
36
|
-
rspec-expectations (3.5.0)
|
10
|
+
addressable (2.8.1)
|
11
|
+
public_suffix (>= 2.0.2, < 6.0)
|
12
|
+
crack (0.4.5)
|
13
|
+
rexml
|
14
|
+
diff-lcs (1.5.0)
|
15
|
+
docile (1.4.0)
|
16
|
+
faraday (2.6.0)
|
17
|
+
faraday-net_http (>= 2.0, < 3.1)
|
18
|
+
ruby2_keywords (>= 0.0.4)
|
19
|
+
faraday-net_http (3.0.2)
|
20
|
+
hashdiff (1.0.1)
|
21
|
+
public_suffix (5.0.0)
|
22
|
+
rake (13.0.6)
|
23
|
+
rexml (3.2.5)
|
24
|
+
rspec (3.12.0)
|
25
|
+
rspec-core (~> 3.12.0)
|
26
|
+
rspec-expectations (~> 3.12.0)
|
27
|
+
rspec-mocks (~> 3.12.0)
|
28
|
+
rspec-core (3.12.0)
|
29
|
+
rspec-support (~> 3.12.0)
|
30
|
+
rspec-expectations (3.12.0)
|
37
31
|
diff-lcs (>= 1.2.0, < 2.0)
|
38
|
-
rspec-support (~> 3.
|
39
|
-
rspec-mocks (3.
|
32
|
+
rspec-support (~> 3.12.0)
|
33
|
+
rspec-mocks (3.12.0)
|
40
34
|
diff-lcs (>= 1.2.0, < 2.0)
|
41
|
-
rspec-support (~> 3.
|
42
|
-
rspec-support (3.
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
35
|
+
rspec-support (~> 3.12.0)
|
36
|
+
rspec-support (3.12.0)
|
37
|
+
ruby2_keywords (0.0.5)
|
38
|
+
simplecov (0.18.5)
|
39
|
+
docile (~> 1.1)
|
40
|
+
simplecov-html (~> 0.11)
|
41
|
+
simplecov-html (0.12.3)
|
42
|
+
webmock (3.18.1)
|
43
|
+
addressable (>= 2.8.0)
|
49
44
|
crack (>= 0.3.2)
|
50
|
-
hashdiff
|
45
|
+
hashdiff (>= 0.4.0, < 2.0.0)
|
51
46
|
|
52
47
|
PLATFORMS
|
53
48
|
ruby
|
54
49
|
|
55
50
|
DEPENDENCIES
|
56
|
-
bundler (~> 1
|
51
|
+
bundler (~> 2.1)
|
57
52
|
business-br!
|
58
|
-
rake (~>
|
53
|
+
rake (~> 13.0)
|
59
54
|
rspec (~> 3.0)
|
60
|
-
|
55
|
+
simplecov (~> 0.18.5)
|
56
|
+
webmock (~> 3.8)
|
61
57
|
|
62
58
|
BUNDLED WITH
|
63
|
-
1.
|
59
|
+
2.1.4
|
data/business-br.gemspec
CHANGED
@@ -12,20 +12,34 @@ Gem::Specification.new do |spec|
|
|
12
12
|
spec.authors = ['Daniel Vinciguerra']
|
13
13
|
spec.email = ['daniel.vinciguerra@bivee.com.br']
|
14
14
|
|
15
|
-
spec.summary =
|
16
|
-
|
15
|
+
spec.summary = %q[
|
16
|
+
Classes for validations and conversions to use in brazilian ruby projects.
|
17
|
+
]
|
18
|
+
|
19
|
+
spec.description = %q[
|
20
|
+
Business::BR is a namespace to place all validations like CPF CNPJ CEP and
|
21
|
+
some other things to be used in a brazilian ruby project.
|
22
|
+
]
|
23
|
+
|
17
24
|
spec.homepage = 'https://github.com/dvinciguerra/business-br'
|
18
25
|
|
19
|
-
spec.files = `git ls-files -z`.split("\x0").reject
|
26
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |filename|
|
27
|
+
filename.match(%r{^(test|spec|features)/})
|
28
|
+
end
|
29
|
+
|
20
30
|
spec.bindir = 'exe'
|
21
31
|
spec.require_paths = ['lib']
|
22
|
-
|
32
|
+
|
33
|
+
spec.required_ruby_version = '>= 2.7'
|
23
34
|
|
24
35
|
# dependency
|
25
|
-
spec.add_development_dependency 'bundler',
|
26
|
-
spec.add_development_dependency 'rake',
|
27
|
-
spec.add_development_dependency 'rspec',
|
28
|
-
spec.add_development_dependency '
|
36
|
+
spec.add_development_dependency 'bundler', '~> 2.1'
|
37
|
+
spec.add_development_dependency 'rake', '~> 13.0'
|
38
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
39
|
+
spec.add_development_dependency 'simplecov', '~> 0.18.5'
|
40
|
+
spec.add_development_dependency 'webmock', '~> 3.8'
|
41
|
+
|
42
|
+
spec.add_dependency 'faraday', '~> 2.6'
|
29
43
|
|
30
|
-
spec.
|
44
|
+
spec.metadata['rubygems_mfa_required'] = 'true'
|
31
45
|
end
|
@@ -1,7 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'json'
|
4
|
-
|
5
3
|
module Business
|
6
4
|
module BR
|
7
5
|
class CEP
|
@@ -10,9 +8,9 @@ module Business
|
|
10
8
|
def search_by(cep)
|
11
9
|
@zipcode = cep
|
12
10
|
begin
|
13
|
-
response =
|
11
|
+
response = Faraday.get("http://api.postmon.com.br/v1/cep/#{@zipcode}")
|
14
12
|
parse_response(response.body)
|
15
|
-
rescue
|
13
|
+
rescue Faraday::ClientError => e
|
16
14
|
puts e.response if ENV['BUSINESS-BR_DEBUG']
|
17
15
|
nil
|
18
16
|
end
|
@@ -7,8 +7,11 @@ module Business
|
|
7
7
|
class RepublicaVirtual < Base
|
8
8
|
def search_by(cep)
|
9
9
|
@zipcode = cep
|
10
|
-
response =
|
11
|
-
|
10
|
+
response = Faraday.get("http://cep.republicavirtual.com.br/web_cep.php?cep=#{@zipcode}&formato=json")
|
11
|
+
parse_response(response.body)
|
12
|
+
rescue Faraday::ClientError => e
|
13
|
+
puts e.response if ENV['BUSINESS-BR_DEBUG']
|
14
|
+
nil
|
12
15
|
end
|
13
16
|
|
14
17
|
private
|
data/lib/business-br/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: business-br
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.12.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Vinciguerra
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1
|
19
|
+
version: '2.1'
|
20
20
|
type: :development
|
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: '1
|
26
|
+
version: '2.1'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '13.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '13.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -53,41 +53,49 @@ dependencies:
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '3.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: simplecov
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
62
|
-
- - ">="
|
63
|
-
- !ruby/object:Gem::Version
|
64
|
-
version: 2.1.0
|
61
|
+
version: 0.18.5
|
65
62
|
type: :development
|
66
63
|
prerelease: false
|
67
64
|
version_requirements: !ruby/object:Gem::Requirement
|
68
65
|
requirements:
|
69
66
|
- - "~>"
|
70
67
|
- !ruby/object:Gem::Version
|
71
|
-
version:
|
72
|
-
|
68
|
+
version: 0.18.5
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: webmock
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '3.8'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
73
81
|
- !ruby/object:Gem::Version
|
74
|
-
version:
|
82
|
+
version: '3.8'
|
75
83
|
- !ruby/object:Gem::Dependency
|
76
|
-
name:
|
84
|
+
name: faraday
|
77
85
|
requirement: !ruby/object:Gem::Requirement
|
78
86
|
requirements:
|
79
87
|
- - "~>"
|
80
88
|
- !ruby/object:Gem::Version
|
81
|
-
version: '2.
|
89
|
+
version: '2.6'
|
82
90
|
type: :runtime
|
83
91
|
prerelease: false
|
84
92
|
version_requirements: !ruby/object:Gem::Requirement
|
85
93
|
requirements:
|
86
94
|
- - "~>"
|
87
95
|
- !ruby/object:Gem::Version
|
88
|
-
version: '2.
|
89
|
-
description: Business::BR is a namespace to place all validations like CPF
|
90
|
-
CEP and
|
96
|
+
version: '2.6'
|
97
|
+
description: "\n Business::BR is a namespace to place all validations like CPF
|
98
|
+
CNPJ CEP and\n some other things to be used in a brazilian ruby project.\n "
|
91
99
|
email:
|
92
100
|
- daniel.vinciguerra@bivee.com.br
|
93
101
|
executables: []
|
@@ -114,8 +122,9 @@ files:
|
|
114
122
|
homepage: https://github.com/dvinciguerra/business-br
|
115
123
|
licenses:
|
116
124
|
- MIT
|
117
|
-
metadata:
|
118
|
-
|
125
|
+
metadata:
|
126
|
+
rubygems_mfa_required: 'true'
|
127
|
+
post_install_message:
|
119
128
|
rdoc_options: []
|
120
129
|
require_paths:
|
121
130
|
- lib
|
@@ -123,17 +132,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
123
132
|
requirements:
|
124
133
|
- - ">="
|
125
134
|
- !ruby/object:Gem::Version
|
126
|
-
version: 2.
|
135
|
+
version: '2.7'
|
127
136
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
128
137
|
requirements:
|
129
138
|
- - ">="
|
130
139
|
- !ruby/object:Gem::Version
|
131
140
|
version: '0'
|
132
141
|
requirements: []
|
133
|
-
|
134
|
-
|
135
|
-
signing_key:
|
142
|
+
rubygems_version: 3.3.7
|
143
|
+
signing_key:
|
136
144
|
specification_version: 4
|
137
|
-
summary:
|
138
|
-
ruby projects.
|
145
|
+
summary: Classes for validations and conversions to use in brazilian ruby projects.
|
139
146
|
test_files: []
|