ecfr 1.0.11 → 1.0.13
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 +4 -4
- data/CHANGELOG.md +8 -0
- data/Gemfile.lock +1 -1
- data/lib/ecfr/admin_service/agency.rb +2 -0
- data/lib/ecfr/client.rb +15 -0
- data/lib/ecfr/search_service/content_version/result.rb +1 -0
- data/lib/ecfr/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0dfaa32b0ddc1df48587434c4ac948e073b91474e8bef1f709a206f06342db89
|
4
|
+
data.tar.gz: c7b6e16a5858ad9e0b4b1c12b062da7ca92491d2551eaad0654e8a84188291e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 861d6119026f3e701218612e4bff5af1caf885e907919da5e2fd2c85edaabec534618250e83ccc371fafac2aa4f4a5e6bf465819726395e3ab0351560243a7b6
|
7
|
+
data.tar.gz: 21352e8752996819180b84f8ff4530a1cf18c0901e05f5d7a99d9681f5c043f72f60f54d9742c3653fdf1bded88ecf4d4f5a890080d107dd409b7b6569decd4b
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
+
## [1.0.13] - 2023-11-30
|
4
|
+
### Updates
|
5
|
+
- Add additional keys to Agency response. Update search result to document agency filtering (70e4bcc1)
|
6
|
+
|
7
|
+
## [1.0.12] - 2023-09-11
|
8
|
+
### Updates
|
9
|
+
- Support retry-after header (e00ab2d)
|
10
|
+
|
3
11
|
## [1.0.11] - 2023-06-22
|
4
12
|
### Updates
|
5
13
|
- Support more robust site notifications(24010c96)
|
data/Gemfile.lock
CHANGED
@@ -5,6 +5,8 @@ module Ecfr
|
|
5
5
|
|
6
6
|
attribute :display_name, desc: "official name of agency, including parent (if any)"
|
7
7
|
attribute :name, desc: "official name of agency"
|
8
|
+
attribute :short_name, desc: "agency acronym"
|
9
|
+
attribute :slug, desc: "normalized, unique agency identifier in the eCFR system"
|
8
10
|
attribute :sortable_name, desc: "sortable version of agency name"
|
9
11
|
|
10
12
|
attribute :cfr_references, type: Array(Ecfr::Common::Hierarchy),
|
data/lib/ecfr/client.rb
CHANGED
@@ -29,6 +29,15 @@ module Ecfr
|
|
29
29
|
class Unauthorized < Error; end
|
30
30
|
class UnknownStatusCode < Error; end
|
31
31
|
|
32
|
+
class RetryAfter < Error
|
33
|
+
attr_reader :delay
|
34
|
+
|
35
|
+
def initialize(record = nil, message = "", delay: nil)
|
36
|
+
@delay = delay.to_i
|
37
|
+
super(record, message)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
32
41
|
#
|
33
42
|
# Faraday client configured for eCFR usage.
|
34
43
|
#
|
@@ -313,6 +322,12 @@ module Ecfr
|
|
313
322
|
raise RecordNotFound
|
314
323
|
when 422
|
315
324
|
raise InvalidRequest
|
325
|
+
when 429
|
326
|
+
if (retry_after = response.headers["retry-after"]).present?
|
327
|
+
raise RetryAfter.new(delay: retry_after.to_i)
|
328
|
+
else
|
329
|
+
raise UnknownStatusCode.new(errors, "Status code: #{response.status}")
|
330
|
+
end
|
316
331
|
when 500
|
317
332
|
raise ServerError.new(errors)
|
318
333
|
else
|
@@ -83,6 +83,7 @@ module Ecfr
|
|
83
83
|
# Retrieve results of search query
|
84
84
|
#
|
85
85
|
# @param [<Hash>] args supported search parameters; supported params:
|
86
|
+
# @option args [Array] :agency_slugs limit search to portions of the CFR these agencies are currently associated with (see Ecfr::AdminService::Agency)
|
86
87
|
# @option args [String] :date ISO date or 'current'
|
87
88
|
# @option args [String] :last_modified_after ISO date
|
88
89
|
# @option args [String] :last_modified_before ISO date
|
data/lib/ecfr/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ecfr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peregrinator
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-11-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -383,7 +383,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
383
383
|
- !ruby/object:Gem::Version
|
384
384
|
version: '0'
|
385
385
|
requirements: []
|
386
|
-
rubygems_version: 3.
|
386
|
+
rubygems_version: 3.4.10
|
387
387
|
signing_key:
|
388
388
|
specification_version: 4
|
389
389
|
summary: eCFR.gov API client
|