business-br 0.10.0 → 0.12.0
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 +48 -34
- data/business-br.gemspec +22 -8
- 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 +47 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5015d35ac8b5d59a5ef88efb7fc651607e83198b140f5e3de7cfdbbf9550979d
|
4
|
+
data.tar.gz: 6aa6000c0f7f24ebb31f62cc9acb91ec3b3948800a27fccc9bce1bbfda4a08c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f4a12217be15d348a8e4bb3ba105051019200f10695bc6b4174f2f784562f530b0dff2ed9de10202925835ef2d1fb1a4146fd55de83991edac33fa7ad6f78d0
|
7
|
+
data.tar.gz: 32ca9d1f24712715b280b5635b1960e0fb101c81744f258aa0a8d71d5f9d7b5155aa2aaeca0b4e3169977d3c31e3abe7b79ed625f93d9d202d79d305f2597388
|
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,77 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
business-br (0.
|
4
|
+
business-br (0.12.0)
|
5
|
+
faraday (~> 2.6)
|
5
6
|
rest-client (~> 2.0)
|
6
7
|
|
7
8
|
GEM
|
8
9
|
remote: https://rubygems.org/
|
9
10
|
specs:
|
10
|
-
addressable (2.
|
11
|
-
public_suffix (
|
12
|
-
crack (0.4.
|
13
|
-
|
14
|
-
diff-lcs (1.
|
15
|
-
|
11
|
+
addressable (2.8.1)
|
12
|
+
public_suffix (>= 2.0.2, < 6.0)
|
13
|
+
crack (0.4.5)
|
14
|
+
rexml
|
15
|
+
diff-lcs (1.5.0)
|
16
|
+
docile (1.4.0)
|
17
|
+
domain_name (0.5.20190701)
|
16
18
|
unf (>= 0.0.5, < 1.0.0)
|
17
|
-
|
18
|
-
|
19
|
+
faraday (2.6.0)
|
20
|
+
faraday-net_http (>= 2.0, < 3.1)
|
21
|
+
ruby2_keywords (>= 0.0.4)
|
22
|
+
faraday-net_http (3.0.2)
|
23
|
+
hashdiff (1.0.1)
|
24
|
+
http-accept (1.7.0)
|
25
|
+
http-cookie (1.0.5)
|
19
26
|
domain_name (~> 0.5)
|
20
|
-
mime-types (3.1)
|
27
|
+
mime-types (3.4.1)
|
21
28
|
mime-types-data (~> 3.2015)
|
22
|
-
mime-types-data (3.
|
29
|
+
mime-types-data (3.2022.0105)
|
23
30
|
netrc (0.11.0)
|
24
|
-
public_suffix (
|
25
|
-
rake (
|
26
|
-
rest-client (2.
|
31
|
+
public_suffix (5.0.0)
|
32
|
+
rake (13.0.6)
|
33
|
+
rest-client (2.1.0)
|
34
|
+
http-accept (>= 1.7.0, < 2.0)
|
27
35
|
http-cookie (>= 1.0.2, < 2.0)
|
28
36
|
mime-types (>= 1.16, < 4.0)
|
29
37
|
netrc (~> 0.8)
|
30
|
-
|
31
|
-
|
32
|
-
rspec-
|
33
|
-
rspec-
|
34
|
-
|
35
|
-
|
36
|
-
|
38
|
+
rexml (3.2.5)
|
39
|
+
rspec (3.12.0)
|
40
|
+
rspec-core (~> 3.12.0)
|
41
|
+
rspec-expectations (~> 3.12.0)
|
42
|
+
rspec-mocks (~> 3.12.0)
|
43
|
+
rspec-core (3.12.0)
|
44
|
+
rspec-support (~> 3.12.0)
|
45
|
+
rspec-expectations (3.12.0)
|
37
46
|
diff-lcs (>= 1.2.0, < 2.0)
|
38
|
-
rspec-support (~> 3.
|
39
|
-
rspec-mocks (3.
|
47
|
+
rspec-support (~> 3.12.0)
|
48
|
+
rspec-mocks (3.12.0)
|
40
49
|
diff-lcs (>= 1.2.0, < 2.0)
|
41
|
-
rspec-support (~> 3.
|
42
|
-
rspec-support (3.
|
43
|
-
|
50
|
+
rspec-support (~> 3.12.0)
|
51
|
+
rspec-support (3.12.0)
|
52
|
+
ruby2_keywords (0.0.5)
|
53
|
+
simplecov (0.18.5)
|
54
|
+
docile (~> 1.1)
|
55
|
+
simplecov-html (~> 0.11)
|
56
|
+
simplecov-html (0.12.3)
|
44
57
|
unf (0.1.4)
|
45
58
|
unf_ext
|
46
|
-
unf_ext (0.0.
|
47
|
-
webmock (
|
48
|
-
addressable (>= 2.
|
59
|
+
unf_ext (0.0.8.2)
|
60
|
+
webmock (3.18.1)
|
61
|
+
addressable (>= 2.8.0)
|
49
62
|
crack (>= 0.3.2)
|
50
|
-
hashdiff
|
63
|
+
hashdiff (>= 0.4.0, < 2.0.0)
|
51
64
|
|
52
65
|
PLATFORMS
|
53
66
|
ruby
|
54
67
|
|
55
68
|
DEPENDENCIES
|
56
|
-
bundler (~> 1
|
69
|
+
bundler (~> 2.1)
|
57
70
|
business-br!
|
58
|
-
rake (~>
|
71
|
+
rake (~> 13.0)
|
59
72
|
rspec (~> 3.0)
|
60
|
-
|
73
|
+
simplecov (~> 0.18.5)
|
74
|
+
webmock (~> 3.8)
|
61
75
|
|
62
76
|
BUNDLED WITH
|
63
|
-
1.
|
77
|
+
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 = %w[
|
16
|
+
Classes for validations and conversions to use in brazilian ruby projects.
|
17
|
+
]
|
18
|
+
|
19
|
+
spec.description = %w[
|
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.4'
|
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'
|
29
41
|
|
42
|
+
spec.add_dependency 'faraday', '~> 2.6'
|
30
43
|
spec.add_dependency 'rest-client', '~> 2.0'
|
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.0
|
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,25 +53,47 @@ 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
|
-
|
61
|
+
version: 0.18.5
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 0.18.5
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: webmock
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
63
74
|
- !ruby/object:Gem::Version
|
64
|
-
version:
|
75
|
+
version: '3.8'
|
65
76
|
type: :development
|
66
77
|
prerelease: false
|
67
78
|
version_requirements: !ruby/object:Gem::Requirement
|
68
79
|
requirements:
|
69
80
|
- - "~>"
|
70
81
|
- !ruby/object:Gem::Version
|
71
|
-
version: '
|
72
|
-
|
82
|
+
version: '3.8'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: faraday
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '2.6'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
73
95
|
- !ruby/object:Gem::Version
|
74
|
-
version: 2.
|
96
|
+
version: '2.6'
|
75
97
|
- !ruby/object:Gem::Dependency
|
76
98
|
name: rest-client
|
77
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -86,8 +108,9 @@ dependencies:
|
|
86
108
|
- - "~>"
|
87
109
|
- !ruby/object:Gem::Version
|
88
110
|
version: '2.0'
|
89
|
-
description: Business::BR is a namespace to place all validations
|
90
|
-
CEP and some other things to be used
|
111
|
+
description: '["Business::BR", "is", "a", "namespace", "to", "place", "all", "validations",
|
112
|
+
"like", "CPF", "CNPJ", "CEP", "and", "some", "other", "things", "to", "be", "used",
|
113
|
+
"in", "a", "brazilian", "ruby", "project."]'
|
91
114
|
email:
|
92
115
|
- daniel.vinciguerra@bivee.com.br
|
93
116
|
executables: []
|
@@ -114,8 +137,9 @@ files:
|
|
114
137
|
homepage: https://github.com/dvinciguerra/business-br
|
115
138
|
licenses:
|
116
139
|
- MIT
|
117
|
-
metadata:
|
118
|
-
|
140
|
+
metadata:
|
141
|
+
rubygems_mfa_required: 'true'
|
142
|
+
post_install_message:
|
119
143
|
rdoc_options: []
|
120
144
|
require_paths:
|
121
145
|
- lib
|
@@ -123,17 +147,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
123
147
|
requirements:
|
124
148
|
- - ">="
|
125
149
|
- !ruby/object:Gem::Version
|
126
|
-
version: 2.
|
150
|
+
version: '2.4'
|
127
151
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
128
152
|
requirements:
|
129
153
|
- - ">="
|
130
154
|
- !ruby/object:Gem::Version
|
131
155
|
version: '0'
|
132
156
|
requirements: []
|
133
|
-
|
134
|
-
|
135
|
-
signing_key:
|
157
|
+
rubygems_version: 3.3.7
|
158
|
+
signing_key:
|
136
159
|
specification_version: 4
|
137
|
-
summary:
|
138
|
-
ruby projects.
|
160
|
+
summary: '["Classes", "for", "validations", "and", "conversions", "to", "use", "in",
|
161
|
+
"brazilian", "ruby", "projects."]'
|
139
162
|
test_files: []
|