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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: be968efdb00276ee6fa87fe89f2f456ee0be28608ae30b37324ffec5e21edc56
4
- data.tar.gz: e3d4f033d70eb58cd4ec345330388eecf63a2e34065b1d97c1c189ccebbc2994
3
+ metadata.gz: 0b15c8e235da934d1d27d9781215977293e64d8aacf81e08536366a2d03dc922
4
+ data.tar.gz: c1afa1ea391ce25520de325de8b35bc8b86c2a8da2690469b74b04e555c1f587
5
5
  SHA512:
6
- metadata.gz: 2487a471642a25e9a4674d07d89f95b204117aa15e47bd148bb630cd91decce6c61d8beaca71f3f1149016f40b98c75648fcf5927f9bf2fc7e52e13cc90441fa
7
- data.tar.gz: b8dcddeaca0a6906935c5f278c8b4a9b254c489a62e6dcd634d37dca5eb65a6aa70479090fce12ad91f1ab33c33e666c960fd8d0b81f915aa7de9d462284299c
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.3.1
6
- - 2.3.0
7
- - 2.2.3
8
- - 2.1.7
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 install bundler
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
@@ -2,3 +2,4 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in business-br.gemspec
4
4
  gemspec
5
+
data/Gemfile.lock CHANGED
@@ -1,63 +1,59 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- business-br (0.7.1)
5
- rest-client (~> 2.0)
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.5.0)
11
- public_suffix (~> 2.0, >= 2.0.2)
12
- crack (0.4.3)
13
- safe_yaml (~> 1.0.0)
14
- diff-lcs (1.2.5)
15
- domain_name (0.5.20161129)
16
- unf (>= 0.0.5, < 1.0.0)
17
- hashdiff (0.3.0)
18
- http-cookie (1.0.3)
19
- domain_name (~> 0.5)
20
- mime-types (3.1)
21
- mime-types-data (~> 3.2015)
22
- mime-types-data (3.2016.0521)
23
- netrc (0.11.0)
24
- public_suffix (2.0.4)
25
- rake (10.4.2)
26
- rest-client (2.0.0)
27
- http-cookie (>= 1.0.2, < 2.0)
28
- mime-types (>= 1.16, < 4.0)
29
- netrc (~> 0.8)
30
- rspec (3.5.0)
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.5.0)
39
- rspec-mocks (3.5.0)
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.5.0)
42
- rspec-support (3.5.0)
43
- safe_yaml (1.0.4)
44
- unf (0.1.4)
45
- unf_ext
46
- unf_ext (0.0.7.2)
47
- webmock (2.1.0)
48
- addressable (>= 2.3.6)
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.12)
51
+ bundler (~> 2.1)
57
52
  business-br!
58
- rake (~> 10.0)
53
+ rake (~> 13.0)
59
54
  rspec (~> 3.0)
60
- webmock (~> 2.1, >= 2.1.0)
55
+ simplecov (~> 0.18.5)
56
+ webmock (~> 3.8)
61
57
 
62
58
  BUNDLED WITH
63
- 1.12.5
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 = 'This project provide classes for validations and conversions to use in brazilian ruby projects.'
16
- spec.description = 'Business::BR is a namespace to place all validations like CPF, CNPJ, CEP and some other things to be used in a brazilian ruby project.'
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 { |f| f.match(%r{^(test|spec|features)/}) }
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
- spec.required_ruby_version = '>= 2.0.0'
32
+
33
+ spec.required_ruby_version = '>= 2.7'
23
34
 
24
35
  # dependency
25
- spec.add_development_dependency 'bundler', '~> 1.12'
26
- spec.add_development_dependency 'rake', '~> 10.0'
27
- spec.add_development_dependency 'rspec', '~> 3.0'
28
- spec.add_development_dependency 'webmock', '~> 2.1', '>= 2.1.0'
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.add_dependency 'rest-client', '~> 2.0'
44
+ spec.metadata['rubygems_mfa_required'] = 'true'
31
45
  end
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'rest-client'
3
+ require 'json'
4
+ require 'faraday'
4
5
 
5
6
  module Business
6
7
  module BR
@@ -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 = RestClient.get "http://api.postmon.com.br/v1/cep/#{@zipcode}"
11
+ response = Faraday.get("http://api.postmon.com.br/v1/cep/#{@zipcode}")
14
12
  parse_response(response.body)
15
- rescue RestClient::ExceptionWithResponse => e
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 = RestClient.get "http://cep.republicavirtual.com.br/web_cep.php?cep=#{@zipcode}&formato=json"
11
- parse_response(response)
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Business
4
4
  module BR
5
- VERSION = '0.10.0'
5
+ VERSION = '0.12.1'
6
6
  end
7
7
  end
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.10.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: 2020-02-14 00:00:00.000000000 Z
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.12'
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.12'
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: '10.0'
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: '10.0'
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: webmock
56
+ name: simplecov
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '2.1'
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: '2.1'
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: 2.1.0
82
+ version: '3.8'
75
83
  - !ruby/object:Gem::Dependency
76
- name: rest-client
84
+ name: faraday
77
85
  requirement: !ruby/object:Gem::Requirement
78
86
  requirements:
79
87
  - - "~>"
80
88
  - !ruby/object:Gem::Version
81
- version: '2.0'
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.0'
89
- description: Business::BR is a namespace to place all validations like CPF, CNPJ,
90
- CEP and some other things to be used in a brazilian ruby project.
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
- post_install_message:
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.0.0
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
- rubyforge_project:
134
- rubygems_version: 2.7.6
135
- signing_key:
142
+ rubygems_version: 3.3.7
143
+ signing_key:
136
144
  specification_version: 4
137
- summary: This project provide classes for validations and conversions to use in brazilian
138
- ruby projects.
145
+ summary: Classes for validations and conversions to use in brazilian ruby projects.
139
146
  test_files: []