brasilapi 0.7.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2d4feae01c7e83e53c8f30fe32b71bb335e64d17a05874b0e465abc695ba518a
4
- data.tar.gz: 8d36f60325e36d611da49f21a513fbe6e8551fea5f44446e7b9106c6d16ae221
3
+ metadata.gz: 87b8c8af7660cc90444b966b63661968ffe0c45a14d802789e4ceeb6ed41fb60
4
+ data.tar.gz: ea5a0f1dfe670f2026a0c0802fb663f6bce93f9fbf6e4aed649ff2c3dcf19c35
5
5
  SHA512:
6
- metadata.gz: df32ff8fb00d74216638a81b683e1ca95abd42be4f0404deff5ada20ec1b52d411711a854aed8c4650e93b76d81ac587dab67db54c08abfa36907fbf9c987de8
7
- data.tar.gz: 005a4a9b91af86ad408f2f8fb5293d5285b2a974b4720d9b884c2e657f84286add533d0ed6a2d3cea75105c3ed4583ea89738fa44396b4e94430c421ba011b39
6
+ metadata.gz: b379ae808c17254e42bac91d610e0fa07321d384254f1c546260d094459cb2db64c7bc90b5f82d9cff6e6cf74880a7d6711ff77f0b102e94ae9907a6a729e3ff
7
+ data.tar.gz: df16c05ceb798aa8703351813761237ca0852baa9a27c7954786abdfa344b7ab1d99b4c27e9ec00d074e0d6a0f77fd15a12ee435781dc82ba03ca3608ce8f82e
data/.rubocop.yml CHANGED
@@ -1,8 +1,10 @@
1
- require: rubocop-rspec
1
+ plugins:
2
+ - rubocop-rspec
2
3
 
3
4
  AllCops:
4
5
  NewCops: enable
5
- TargetRubyVersion: 2.6
6
+ TargetRubyVersion: 3.3
7
+ SuggestExtensions: false
6
8
 
7
9
  Style/StringLiterals:
8
10
  Enabled: true
@@ -12,9 +14,6 @@ Style/StringLiteralsInInterpolation:
12
14
  Enabled: true
13
15
  EnforcedStyle: double_quotes
14
16
 
15
- Style/Documentation:
16
- Enabled: false
17
-
18
17
  Layout/LineLength:
19
18
  Max: 120
20
19
 
data/.yardopts ADDED
@@ -0,0 +1,5 @@
1
+ --markup markdown
2
+ --main README.md
3
+ --output-dir doc
4
+ --files CHANGELOG.md,LICENSE.txt
5
+ lib/**/*.rb
data/CHANGELOG.md CHANGED
@@ -1,5 +1,102 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.9.0] - 2026-10-20
4
+
5
+ ### DDD
6
+ - `BrasilAPI::DDD.all`
7
+ - `BrasilAPI::DDD.find(ddd, version: 2)`
8
+ - `BrasilAPI::DDD.by_state(state)`
9
+ - `Address.state_and_cities_by_area_code` permanece para a v1
10
+
11
+ ### CPTEC
12
+ - Specs de `capital_weather` e `airport_weather`
13
+ - A previsão semanal por latitude/longitude não entrou: a rota responde 404 para coordenadas válidas
14
+
15
+ ### CVM
16
+ - `CVM.all(state:)` filtra corretoras por UF e omite `uf` quando o estado não é informado
17
+ - `BrasilAPI::CVM::Fund.all(page:, size:)`
18
+ - `BrasilAPI::CVM::Fund.find_by_cnpj`, aceitando CNPJ com ou sem pontuação
19
+
20
+ ### FIPE
21
+ - `vehicle_brands` sem tipo de veículo lista todas as marcas
22
+ - `vehicle_years(type, brand, model, reference_table = nil)`
23
+ - `vehicle_details(type, brand, model, year, reference_table = nil)`
24
+ - Specs das rotas que já existiam (`vehicle_price`, `fipe_tables`, `list_vehicles`)
25
+
26
+ ### IBGE
27
+ - `IBGE.regions`, `IBGE.find_region_by_code` e `IBGE.states_by_region`
28
+ - `BrasilAPI::IBGE::CNAE.classes`, `find_class`, `find_division` e `find_group`
29
+
30
+ ### Feriados
31
+ - `Holiday.by_year(year, state:)` inclui feriados estaduais e omite `uf` quando o estado não é informado
32
+
33
+ ### Câmbio
34
+ - `BrasilAPI::Cambio.currencies`
35
+ - `BrasilAPI::Cambio.quote(currency, date)`, aceitando `Date` ou `String`
36
+
37
+ ### CPF
38
+ - `BrasilAPI::CPF.find`, com ou sem pontuação
39
+
40
+ ### Dias úteis
41
+ - `BrasilAPI::BusinessDays.between(start_date, end_date, include_national_holidays:)`
42
+
43
+ ### Geolocalização
44
+ - `BrasilAPI::Geolocation.reverse(latitude, longitude, language: nil)`
45
+
46
+ ### Hospitais
47
+ - `BrasilAPI::Hospital.all`, `nearby`, `options`, `ciatox`, `find_by_cnes` e `states`
48
+
49
+ ### IBPT
50
+ - `BrasilAPI::IBPT.version`
51
+ - `IBPT.ncm(state, code = nil, exception: nil)`
52
+ - `IBPT.nbs(state, code = nil, exception: nil)`
53
+ - `IBPT.lc116(state, code = nil, exception: nil)`
54
+
55
+ ### IGP-M
56
+ - `BrasilAPI::IGPM.all`, `IGPM.last(limit)` e `IGPM.between(initial_date, final_date)`
57
+
58
+ ### CID-10
59
+ - `BrasilAPI::CID10.all` e `CID10.find_by_code`
60
+
61
+ ### Incidência solar
62
+ - `BrasilAPI::Solar.incidence(location)` na rota real `/solar/v1`
63
+
64
+ ### Status
65
+ - `BrasilAPI::Status.check`
66
+
67
+ ### B3
68
+ - `BrasilAPI::B3.stocks` e `B3.funds(type)`
69
+
70
+ ### TUSS
71
+ - `BrasilAPI::TUSS.all`, `find_by_code`, `search` e `autocomplete`
72
+
73
+ ### ISBN, NCM, PIX, Registro.br e Taxas
74
+ - Specs com cassettes VCR para os métodos que já existiam
75
+
76
+ ### Documentação e qualidade
77
+ - README com exemplo de cada endpoint, comentário da CVM corrigido e uma única seção de licença
78
+ - Documentação YARD de toda a API pública (`rake yard`); `rake yard_stats` exige 100% documentado
79
+ - `webrick` como dependência de desenvolvimento, para `bundle exec yard server` no Ruby 3.3+
80
+ - `Style/Documentation` do RuboCop volta a ser exigido
81
+ - Metadado `documentation_uri` aponta para https://rubydoc.info/gems/brasilapi
82
+ - SimpleCov passa a exigir 100% de cobertura de linha e de branch em `bundle exec rake`
83
+ - Não entram nesta versão, porque a BrasilAPI não responde com sucesso: CEP v3, previsão semanal do CPTEC por coordenadas, eleições e universidades
84
+
85
+ ## [0.8.0] - 2026-10-20
86
+
87
+ - `BrasilAPI::NotFound` passa a herdar de `BrasilAPI::Error`, então `rescue BrasilAPI::Error` também captura 404
88
+ - Erros HTTP preservam status, corpo e os campos `message`/`type` da BrasilAPI; qualquer resposta 2xx é sucesso
89
+ - Novas subclasses `BadRequest` (400), `ServerError` (5xx) e `Timeout`, todas filhas de `BrasilAPI::Error`
90
+ - Timeout padrão de 10 segundos, configurável com `BrasilAPI.configure { |config| config.timeout = 30 }`
91
+ - Segmentos de URL são escapados com `URI.encode_uri_component`, sem `URI::Parser#escape` (obsoleto no Ruby 3.4+)
92
+ - FIPE deixa de enviar `tabela_referencia` vazio quando o parâmetro é nil
93
+ - CI dispara em push na `main` e em pull requests, nas Rubies suportadas 3.3, 3.4 e 4.0
94
+ - Ruby mínima sobe de 2.6 para 3.3, porque 2.6–3.2 estão fora de manutenção
95
+ - Publicação automática no RubyGems via Trusted Publishing (OIDC), sem API key
96
+ - Testes da API do CPTEC
97
+ - Metadado `github_repo` no gemspec
98
+ - Correção do texto "Dado aisso" na descrição do gemspec
99
+
3
100
  ## [0.7.0] - 2025-04-21
4
101
 
5
102
  - Integração da API do CPTEC
data/Gemfile CHANGED
@@ -7,8 +7,11 @@ gemspec
7
7
  group :development do
8
8
  gem "rake", "~> 13.0"
9
9
  gem "rspec", "~> 3.0"
10
- gem "rubocop", "~> 1.21"
11
- gem "rubocop-rspec", "~> 2.24"
10
+ gem "rubocop", "~> 1.86"
11
+ gem "rubocop-rspec", "~> 3.0"
12
+ gem "simplecov", "~> 0.22"
12
13
  gem "vcr", "~> 6.3"
13
14
  gem "webmock", "~> 3.25"
15
+ gem "webrick", "~> 1.8"
16
+ gem "yard", "~> 0.9"
14
17
  end
data/Gemfile.lock CHANGED
@@ -1,88 +1,99 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- brasilapi (0.7.0)
4
+ brasilapi (0.9.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- addressable (2.8.7)
10
- public_suffix (>= 2.0.2, < 7.0)
11
- ast (2.4.2)
12
- base64 (0.1.1)
13
- bigdecimal (3.1.9)
14
- crack (1.0.0)
9
+ addressable (2.9.0)
10
+ public_suffix (>= 2.0.2, < 8.0)
11
+ ast (2.4.3)
12
+ bigdecimal (4.1.3)
13
+ crack (1.0.1)
15
14
  bigdecimal
16
15
  rexml
17
- diff-lcs (1.5.0)
18
- hashdiff (1.1.2)
19
- json (2.6.3)
20
- language_server-protocol (3.17.0.3)
21
- parallel (1.23.0)
22
- parser (3.2.2.4)
16
+ diff-lcs (1.6.2)
17
+ docile (1.4.1)
18
+ hashdiff (1.2.1)
19
+ json (3.1.0)
20
+ language_server-protocol (3.17.0.6)
21
+ lint_roller (1.1.0)
22
+ parallel (2.3.0)
23
+ parser (3.3.12.0)
23
24
  ast (~> 2.4.1)
24
25
  racc
25
- public_suffix (6.0.1)
26
- racc (1.7.1)
26
+ prism (1.9.0)
27
+ public_suffix (7.0.5)
28
+ racc (1.8.1)
27
29
  rainbow (3.1.1)
28
- rake (13.0.6)
29
- regexp_parser (2.8.2)
30
- rexml (3.4.1)
31
- rspec (3.12.0)
32
- rspec-core (~> 3.12.0)
33
- rspec-expectations (~> 3.12.0)
34
- rspec-mocks (~> 3.12.0)
35
- rspec-core (3.12.2)
36
- rspec-support (~> 3.12.0)
37
- rspec-expectations (3.12.3)
30
+ rake (13.4.2)
31
+ regexp_parser (2.13.1)
32
+ rexml (3.4.4)
33
+ rspec (3.13.2)
34
+ rspec-core (~> 3.13.0)
35
+ rspec-expectations (~> 3.13.0)
36
+ rspec-mocks (~> 3.13.0)
37
+ rspec-core (3.13.6)
38
+ rspec-support (~> 3.13.0)
39
+ rspec-expectations (3.13.5)
38
40
  diff-lcs (>= 1.2.0, < 2.0)
39
- rspec-support (~> 3.12.0)
40
- rspec-mocks (3.12.6)
41
+ rspec-support (~> 3.13.0)
42
+ rspec-mocks (3.13.8)
41
43
  diff-lcs (>= 1.2.0, < 2.0)
42
- rspec-support (~> 3.12.0)
43
- rspec-support (3.12.1)
44
- rubocop (1.57.1)
45
- base64 (~> 0.1.1)
46
- json (~> 2.3)
47
- language_server-protocol (>= 3.17.0)
48
- parallel (~> 1.10)
49
- parser (>= 3.2.2.4)
44
+ rspec-support (~> 3.13.0)
45
+ rspec-support (3.13.7)
46
+ rubocop (1.92.0)
47
+ json (>= 2.3)
48
+ language_server-protocol (~> 3.17.0.2)
49
+ lint_roller (~> 1.1.0)
50
+ parallel (>= 1.10)
51
+ parser (>= 3.3.0.2)
50
52
  rainbow (>= 2.2.2, < 4.0)
51
- regexp_parser (>= 1.8, < 3.0)
52
- rexml (>= 3.2.5, < 4.0)
53
- rubocop-ast (>= 1.28.1, < 2.0)
53
+ regexp_parser (>= 2.11.3, < 3.0)
54
+ rubocop-ast (>= 1.49.0, < 2.0)
54
55
  ruby-progressbar (~> 1.7)
55
- unicode-display_width (>= 2.4.0, < 3.0)
56
- rubocop-ast (1.29.0)
57
- parser (>= 3.2.1.0)
58
- rubocop-capybara (2.19.0)
59
- rubocop (~> 1.41)
60
- rubocop-factory_bot (2.24.0)
61
- rubocop (~> 1.33)
62
- rubocop-rspec (2.24.1)
63
- rubocop (~> 1.33)
64
- rubocop-capybara (~> 2.17)
65
- rubocop-factory_bot (~> 2.22)
56
+ unicode-display_width (>= 2.4.0, < 4.0)
57
+ rubocop-ast (1.50.0)
58
+ parser (>= 3.3.7.2)
59
+ prism (~> 1.7)
60
+ rubocop-rspec (3.10.2)
61
+ lint_roller (~> 1.1)
62
+ regexp_parser (>= 2.0)
63
+ rubocop (~> 1.86, >= 1.86.2)
66
64
  ruby-progressbar (1.13.0)
67
- unicode-display_width (2.5.0)
68
- vcr (6.3.1)
69
- base64
70
- webmock (3.25.1)
65
+ simplecov (0.22.0)
66
+ docile (~> 1.1)
67
+ simplecov-html (~> 0.11)
68
+ simplecov_json_formatter (~> 0.1)
69
+ simplecov-html (0.13.2)
70
+ simplecov_json_formatter (0.1.4)
71
+ unicode-display_width (3.3.0)
72
+ unicode-emoji (~> 4.3)
73
+ unicode-emoji (4.3.0)
74
+ vcr (6.4.0)
75
+ webmock (3.34.0)
71
76
  addressable (>= 2.8.0)
72
77
  crack (>= 0.3.2)
73
78
  hashdiff (>= 0.4.0, < 2.0.0)
79
+ webrick (1.9.2)
80
+ yard (0.9.45)
74
81
 
75
82
  PLATFORMS
83
+ ruby
76
84
  x86_64-linux
77
85
 
78
86
  DEPENDENCIES
79
87
  brasilapi!
80
88
  rake (~> 13.0)
81
89
  rspec (~> 3.0)
82
- rubocop (~> 1.21)
83
- rubocop-rspec (~> 2.24)
90
+ rubocop (~> 1.86)
91
+ rubocop-rspec (~> 3.0)
92
+ simplecov (~> 0.22)
84
93
  vcr (~> 6.3)
85
94
  webmock (~> 3.25)
95
+ webrick (~> 1.8)
96
+ yard (~> 0.9)
86
97
 
87
98
  BUNDLED WITH
88
- 2.4.10
99
+ 4.0.23