ecfr 1.1.3 → 1.1.4
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/.rubocop.yml +1 -0
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +94 -74
- data/README.md +1 -1
- data/ecfr.gemspec +4 -3
- data/lib/ecfr/attribute_method_definition.rb +1 -1
- data/lib/ecfr/configuration.rb +1 -1
- data/lib/ecfr/facet_attribute_method_definition.rb +2 -2
- data/lib/ecfr/prince_xml_service/pdf.rb +2 -2
- data/lib/ecfr/search_service/content_version.rb +5 -5
- data/lib/ecfr/search_service/date_facet.rb +1 -1
- data/lib/ecfr/testing/factories/admin_service/agency_factory.rb +27 -0
- data/lib/ecfr/version.rb +1 -1
- data/lib/ecfr/versioner_service/ancestors.rb +1 -1
- data/lib/ecfr.rb +2 -0
- metadata +27 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 93cb578d4fc85f48e9d1d0ac423522886fa575a2425da6836547eb075d4e6cf5
|
4
|
+
data.tar.gz: b896739d0023e6398da9effbab99ed0b48323d6a61b9f21b94b2680f9ed74146
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc03bfa1d18e5e202f4e3f069d4cf3f8ee3caf5aa3af26fdf0f9813a1c9c7756fe403764ac69f00268e3c96cbad85f1697e69eb8eab6f74b4d84351e74806e2e
|
7
|
+
data.tar.gz: 599a3c76236594b98fde583b801922b3bfb686071c9cbf2460610895d229580c428ba02026898b181dd0729dcfa18ccbecd8c1af5fde036edc17229c55ca739d
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -2,119 +2,139 @@ PATH
|
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
4
|
ecfr (1.1.3)
|
5
|
-
activemodel
|
6
|
-
activesupport
|
5
|
+
activemodel
|
6
|
+
activesupport
|
7
7
|
faraday (~> 2.0)
|
8
8
|
faraday-net_http_persistent (~> 2.0)
|
9
|
+
ostruct
|
9
10
|
|
10
11
|
GEM
|
11
12
|
remote: https://rubygems.org/
|
12
13
|
specs:
|
13
|
-
activemodel (
|
14
|
-
activesupport (=
|
15
|
-
activesupport (
|
16
|
-
|
14
|
+
activemodel (7.2.1)
|
15
|
+
activesupport (= 7.2.1)
|
16
|
+
activesupport (7.2.1)
|
17
|
+
base64
|
18
|
+
bigdecimal
|
19
|
+
concurrent-ruby (~> 1.0, >= 1.3.1)
|
20
|
+
connection_pool (>= 2.2.5)
|
21
|
+
drb
|
17
22
|
i18n (>= 1.6, < 2)
|
23
|
+
logger (>= 1.4.2)
|
18
24
|
minitest (>= 5.1)
|
19
|
-
|
20
|
-
|
25
|
+
securerandom (>= 0.3)
|
26
|
+
tzinfo (~> 2.0, >= 2.0.5)
|
21
27
|
ast (2.4.2)
|
28
|
+
base64 (0.2.0)
|
29
|
+
bigdecimal (3.1.8)
|
22
30
|
coderay (1.1.3)
|
23
|
-
concurrent-ruby (1.
|
31
|
+
concurrent-ruby (1.3.4)
|
24
32
|
connection_pool (2.4.1)
|
25
|
-
diff-lcs (1.
|
33
|
+
diff-lcs (1.5.1)
|
34
|
+
drb (2.2.1)
|
26
35
|
ethon (0.16.0)
|
27
36
|
ffi (>= 1.15.0)
|
28
|
-
factory_bot (6.
|
37
|
+
factory_bot (6.5.0)
|
29
38
|
activesupport (>= 5.0.0)
|
30
|
-
faraday (2.
|
31
|
-
faraday-net_http (>= 2.0, < 3.
|
32
|
-
|
33
|
-
|
34
|
-
faraday-
|
39
|
+
faraday (2.12.0)
|
40
|
+
faraday-net_http (>= 2.0, < 3.4)
|
41
|
+
json
|
42
|
+
logger
|
43
|
+
faraday-net_http (3.3.0)
|
44
|
+
net-http
|
45
|
+
faraday-net_http_persistent (2.3.0)
|
35
46
|
faraday (~> 2.5)
|
36
|
-
net-http-persistent (
|
37
|
-
faraday-typhoeus (1.
|
47
|
+
net-http-persistent (>= 4.0.4, < 5)
|
48
|
+
faraday-typhoeus (1.1.0)
|
38
49
|
faraday (~> 2.0)
|
39
50
|
typhoeus (~> 1.4)
|
40
|
-
ffi (1.
|
41
|
-
i18n (1.
|
51
|
+
ffi (1.17.0)
|
52
|
+
i18n (1.14.6)
|
42
53
|
concurrent-ruby (~> 1.0)
|
43
|
-
json (2.
|
54
|
+
json (2.7.2)
|
44
55
|
language_server-protocol (3.17.0.3)
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
56
|
+
lint_roller (1.1.0)
|
57
|
+
logger (1.6.1)
|
58
|
+
method_source (1.1.0)
|
59
|
+
mini_portile2 (2.8.7)
|
60
|
+
minitest (5.25.1)
|
61
|
+
net-http (0.4.1)
|
62
|
+
uri
|
63
|
+
net-http-persistent (4.0.4)
|
49
64
|
connection_pool (~> 2.2)
|
50
|
-
nokogiri (1.
|
51
|
-
mini_portile2 (~> 2.8.
|
65
|
+
nokogiri (1.16.7)
|
66
|
+
mini_portile2 (~> 2.8.2)
|
52
67
|
racc (~> 1.4)
|
53
|
-
|
54
|
-
parallel (1.
|
55
|
-
parallel_tests (4.2
|
68
|
+
ostruct (0.6.1)
|
69
|
+
parallel (1.26.3)
|
70
|
+
parallel_tests (4.7.2)
|
56
71
|
parallel
|
57
|
-
parser (3.
|
72
|
+
parser (3.3.5.0)
|
58
73
|
ast (~> 2.4.1)
|
59
|
-
|
74
|
+
racc
|
75
|
+
pry (0.14.2)
|
60
76
|
coderay (~> 1.1)
|
61
77
|
method_source (~> 1.0)
|
62
|
-
racc (1.
|
63
|
-
rack (3.
|
78
|
+
racc (1.8.1)
|
79
|
+
rack (3.1.7)
|
64
80
|
rainbow (3.1.1)
|
65
|
-
regexp_parser (2.
|
66
|
-
request_store (1.
|
81
|
+
regexp_parser (2.9.2)
|
82
|
+
request_store (1.7.0)
|
67
83
|
rack (>= 1.4)
|
68
|
-
|
69
|
-
|
70
|
-
rspec-
|
71
|
-
rspec-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
rspec-expectations (3.10.1)
|
84
|
+
rspec (3.13.0)
|
85
|
+
rspec-core (~> 3.13.0)
|
86
|
+
rspec-expectations (~> 3.13.0)
|
87
|
+
rspec-mocks (~> 3.13.0)
|
88
|
+
rspec-core (3.13.1)
|
89
|
+
rspec-support (~> 3.13.0)
|
90
|
+
rspec-expectations (3.13.3)
|
76
91
|
diff-lcs (>= 1.2.0, < 2.0)
|
77
|
-
rspec-support (~> 3.
|
78
|
-
rspec-mocks (3.
|
92
|
+
rspec-support (~> 3.13.0)
|
93
|
+
rspec-mocks (3.13.2)
|
79
94
|
diff-lcs (>= 1.2.0, < 2.0)
|
80
|
-
rspec-support (~> 3.
|
81
|
-
rspec-support (3.
|
95
|
+
rspec-support (~> 3.13.0)
|
96
|
+
rspec-support (3.13.1)
|
82
97
|
rspec_junit_formatter (0.6.0)
|
83
98
|
rspec-core (>= 2, < 4, != 2.12.0)
|
84
|
-
rubocop (1.
|
99
|
+
rubocop (1.66.1)
|
85
100
|
json (~> 2.3)
|
101
|
+
language_server-protocol (>= 3.17.0)
|
86
102
|
parallel (~> 1.10)
|
87
|
-
parser (>= 3.
|
103
|
+
parser (>= 3.3.0.2)
|
88
104
|
rainbow (>= 2.2.2, < 4.0)
|
89
|
-
regexp_parser (>=
|
90
|
-
|
91
|
-
rubocop-ast (>= 1.26.0, < 2.0)
|
105
|
+
regexp_parser (>= 2.4, < 3.0)
|
106
|
+
rubocop-ast (>= 1.32.2, < 2.0)
|
92
107
|
ruby-progressbar (~> 1.7)
|
93
108
|
unicode-display_width (>= 2.4.0, < 3.0)
|
94
|
-
rubocop-ast (1.
|
95
|
-
parser (>= 3.
|
96
|
-
rubocop-performance (1.
|
97
|
-
rubocop (>= 1.
|
98
|
-
rubocop-ast (>=
|
109
|
+
rubocop-ast (1.32.3)
|
110
|
+
parser (>= 3.3.1.0)
|
111
|
+
rubocop-performance (1.22.1)
|
112
|
+
rubocop (>= 1.48.1, < 2.0)
|
113
|
+
rubocop-ast (>= 1.31.1, < 2.0)
|
99
114
|
ruby-progressbar (1.13.0)
|
100
|
-
|
101
|
-
standard (1.
|
115
|
+
securerandom (0.3.1)
|
116
|
+
standard (1.41.0)
|
102
117
|
language_server-protocol (~> 3.17.0.2)
|
103
|
-
|
104
|
-
rubocop
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
118
|
+
lint_roller (~> 1.0)
|
119
|
+
rubocop (~> 1.66.0)
|
120
|
+
standard-custom (~> 1.0.0)
|
121
|
+
standard-performance (~> 1.5)
|
122
|
+
standard-custom (1.0.2)
|
123
|
+
lint_roller (~> 1.0)
|
124
|
+
rubocop (~> 1.50)
|
125
|
+
standard-performance (1.5.0)
|
126
|
+
lint_roller (~> 1.1)
|
127
|
+
rubocop-performance (~> 1.22.0)
|
128
|
+
turbo_tests (2.2.4)
|
129
|
+
parallel_tests (>= 3.3.0, < 5)
|
130
|
+
rspec (>= 3.10)
|
131
|
+
typhoeus (1.4.1)
|
110
132
|
ethon (>= 0.9.0)
|
111
|
-
tzinfo (2.0.
|
133
|
+
tzinfo (2.0.6)
|
112
134
|
concurrent-ruby (~> 1.0)
|
113
|
-
unicode-display_width (2.
|
114
|
-
|
115
|
-
yard (0.9.
|
116
|
-
webrick (~> 1.7.0)
|
117
|
-
zeitwerk (2.4.2)
|
135
|
+
unicode-display_width (2.6.0)
|
136
|
+
uri (0.13.1)
|
137
|
+
yard (0.9.37)
|
118
138
|
|
119
139
|
PLATFORMS
|
120
140
|
ruby
|
@@ -135,4 +155,4 @@ DEPENDENCIES
|
|
135
155
|
yard
|
136
156
|
|
137
157
|
BUNDLED WITH
|
138
|
-
2.
|
158
|
+
2.6.5
|
data/README.md
CHANGED
@@ -34,7 +34,7 @@ Some endpoints return XML (like the Structure) and will be automatically parsed
|
|
34
34
|
|
35
35
|
### Response caching
|
36
36
|
|
37
|
-
Response caching can be enabled via a configuration option. This is a performance feature that allows the calling code to not worry about performance when different parts of the application call the same endpoints at different times in the same request. Responses are cached
|
37
|
+
Response caching can be enabled via a configuration option. This is a performance feature that allows the calling code to not worry about performance when different parts of the application call the same endpoints at different times in the same request. Responses are cached by HTTP method, api endpoint and requested parameters. You will need to install the [request_store](https://github.com/steveklabnik/request_store) gem when enabling this option.
|
38
38
|
|
39
39
|
If you are using request store outside of a Rails project or in a background process (eg Sidekiq) check the RequestStore documentation for how to use the required middleware.
|
40
40
|
|
data/ecfr.gemspec
CHANGED
@@ -29,10 +29,11 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
30
30
|
spec.require_paths = ["lib"]
|
31
31
|
|
32
|
-
spec.add_dependency "activemodel"
|
33
|
-
spec.add_dependency "activesupport"
|
32
|
+
spec.add_dependency "activemodel"
|
33
|
+
spec.add_dependency "activesupport"
|
34
34
|
spec.add_dependency "faraday", "~> 2.0"
|
35
35
|
spec.add_dependency "faraday-net_http_persistent", "~> 2.0"
|
36
|
+
spec.add_dependency "ostruct"
|
36
37
|
|
37
38
|
spec.add_development_dependency "factory_bot"
|
38
39
|
spec.add_development_dependency "parallel_tests"
|
@@ -64,7 +65,7 @@ Gem::Specification.new do |spec|
|
|
64
65
|
Some features of the eCFR gem support parsing XML responses, response
|
65
66
|
caching, and parallel requests.
|
66
67
|
|
67
|
-
To use these features you will
|
68
|
+
To use these features you will need to install the appropriate gems
|
68
69
|
(nokogiri, request_store, and faraday-typhoeus respectively) in your
|
69
70
|
application. In order to minimize depedencies and code that is loaded these
|
70
71
|
are not a default dependencies of the eCFR gem.
|
data/lib/ecfr/configuration.rb
CHANGED
@@ -13,7 +13,7 @@ module Ecfr
|
|
13
13
|
raise "must set :as to either :key or :value, was: #{as}"
|
14
14
|
end
|
15
15
|
|
16
|
-
super
|
16
|
+
super
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
@@ -37,7 +37,7 @@ module Ecfr
|
|
37
37
|
results[self.class.fv] = value
|
38
38
|
end
|
39
39
|
|
40
|
-
super
|
40
|
+
super
|
41
41
|
end
|
42
42
|
|
43
43
|
def count_for(key)
|
@@ -5,9 +5,9 @@ module Ecfr
|
|
5
5
|
|
6
6
|
PDF_PATH = ""
|
7
7
|
|
8
|
-
def self.client(client_options = {}, &
|
8
|
+
def self.client(client_options = {}, &)
|
9
9
|
client_options[:timeout] = Ecfr.config.prince_xml_service_pdf_timeout
|
10
|
-
super(client_options: client_options, &
|
10
|
+
super(client_options: client_options, &)
|
11
11
|
end
|
12
12
|
|
13
13
|
def self.html_to_pdf(string, output_path, sha)
|
@@ -1,11 +1,11 @@
|
|
1
1
|
module Ecfr
|
2
2
|
module SearchService
|
3
3
|
class ContentVersion < Base
|
4
|
-
require_relative "
|
5
|
-
require_relative "
|
6
|
-
require_relative "
|
7
|
-
require_relative "
|
8
|
-
require_relative "
|
4
|
+
require_relative "content_version/count"
|
5
|
+
require_relative "content_version/hierarchichal_result"
|
6
|
+
require_relative "content_version/result"
|
7
|
+
require_relative "content_version/suggestion"
|
8
|
+
require_relative "content_version/summary"
|
9
9
|
|
10
10
|
#
|
11
11
|
# Metadata about the number of matching items
|
@@ -0,0 +1,27 @@
|
|
1
|
+
FactoryBot.define do
|
2
|
+
factory :agency, class: "Ecfr::AdminService::Agency" do
|
3
|
+
skip_create
|
4
|
+
|
5
|
+
name { "Agency Name" }
|
6
|
+
display_name { "The Agency Name" }
|
7
|
+
short_name { "AN" }
|
8
|
+
sortable_name { "Name, Agency" }
|
9
|
+
slug { "agency-name" }
|
10
|
+
children {
|
11
|
+
[]
|
12
|
+
}
|
13
|
+
cfr_references {
|
14
|
+
[ecfr_attribute_hash(:hierarchy)]
|
15
|
+
}
|
16
|
+
|
17
|
+
initialize_with {
|
18
|
+
new(attributes.deep_stringify_keys)
|
19
|
+
}
|
20
|
+
end
|
21
|
+
|
22
|
+
trait :with_child do
|
23
|
+
children {
|
24
|
+
[build(:agency, name: "Child Agency")]
|
25
|
+
}
|
26
|
+
end
|
27
|
+
end
|
data/lib/ecfr/version.rb
CHANGED
data/lib/ecfr.rb
CHANGED
@@ -9,6 +9,8 @@ require "active_support/core_ext/hash"
|
|
9
9
|
require "active_support/core_ext/module/delegation"
|
10
10
|
require "active_support/core_ext/string"
|
11
11
|
|
12
|
+
require "ostruct"
|
13
|
+
|
12
14
|
require "faraday"
|
13
15
|
require "faraday/net_http_persistent"
|
14
16
|
require_relative "ecfr/faraday/user_agent/middleware"
|
metadata
CHANGED
@@ -1,43 +1,42 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ecfr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peregrinator
|
8
|
-
autorequire:
|
9
8
|
bindir: exe
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-03-27 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: activemodel
|
15
14
|
requirement: !ruby/object:Gem::Requirement
|
16
15
|
requirements:
|
17
|
-
- - "
|
16
|
+
- - ">="
|
18
17
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
18
|
+
version: '0'
|
20
19
|
type: :runtime
|
21
20
|
prerelease: false
|
22
21
|
version_requirements: !ruby/object:Gem::Requirement
|
23
22
|
requirements:
|
24
|
-
- - "
|
23
|
+
- - ">="
|
25
24
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
25
|
+
version: '0'
|
27
26
|
- !ruby/object:Gem::Dependency
|
28
27
|
name: activesupport
|
29
28
|
requirement: !ruby/object:Gem::Requirement
|
30
29
|
requirements:
|
31
|
-
- - "
|
30
|
+
- - ">="
|
32
31
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
32
|
+
version: '0'
|
34
33
|
type: :runtime
|
35
34
|
prerelease: false
|
36
35
|
version_requirements: !ruby/object:Gem::Requirement
|
37
36
|
requirements:
|
38
|
-
- - "
|
37
|
+
- - ">="
|
39
38
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
39
|
+
version: '0'
|
41
40
|
- !ruby/object:Gem::Dependency
|
42
41
|
name: faraday
|
43
42
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,6 +65,20 @@ dependencies:
|
|
66
65
|
- - "~>"
|
67
66
|
- !ruby/object:Gem::Version
|
68
67
|
version: '2.0'
|
68
|
+
- !ruby/object:Gem::Dependency
|
69
|
+
name: ostruct
|
70
|
+
requirement: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
75
|
+
type: :runtime
|
76
|
+
prerelease: false
|
77
|
+
version_requirements: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ">="
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '0'
|
69
82
|
- !ruby/object:Gem::Dependency
|
70
83
|
name: factory_bot
|
71
84
|
requirement: !ruby/object:Gem::Requirement
|
@@ -324,6 +337,7 @@ files:
|
|
324
337
|
- lib/ecfr/testing/extensions/search_service/date_facet_extensions.rb
|
325
338
|
- lib/ecfr/testing/extensions/versioner_service/ancestors_extensions.rb
|
326
339
|
- lib/ecfr/testing/extensions/versioner_service/title_extenstions.rb
|
340
|
+
- lib/ecfr/testing/factories/admin_service/agency_factory.rb
|
327
341
|
- lib/ecfr/testing/factories/admin_service/cfr_reference_factory.rb
|
328
342
|
- lib/ecfr/testing/factories/admin_service/ecfr_correction_factory.rb
|
329
343
|
- lib/ecfr/testing/factories/admin_service/issue_change_factory.rb
|
@@ -369,7 +383,7 @@ metadata:
|
|
369
383
|
changelog_uri: https://github.com/criticaljuncture/ecfr
|
370
384
|
post_install_message: "\n Some features of the eCFR gem support parsing XML responses,
|
371
385
|
response\n caching, and parallel requests.\n\n To use these features you will
|
372
|
-
|
386
|
+
need to install the appropriate gems\n (nokogiri, request_store, and faraday-typhoeus
|
373
387
|
respectively) in your\n application. In order to minimize depedencies and code
|
374
388
|
that is loaded these\n are not a default dependencies of the eCFR gem.\n\n See
|
375
389
|
the README for details of these features.\n "
|
@@ -387,8 +401,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
387
401
|
- !ruby/object:Gem::Version
|
388
402
|
version: '0'
|
389
403
|
requirements: []
|
390
|
-
rubygems_version: 3.
|
391
|
-
signing_key:
|
404
|
+
rubygems_version: 3.6.2
|
392
405
|
specification_version: 4
|
393
406
|
summary: eCFR.gov API client
|
394
407
|
test_files: []
|