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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4d08cec2c05e1ac2e15d1889deec5f7348c767eafe2c1c8970e440051e3b4460
4
- data.tar.gz: 04ab00ed24f91fde2327ae63565e9a010bf174373e0125670963d9c5f5dcfa13
3
+ metadata.gz: 93cb578d4fc85f48e9d1d0ac423522886fa575a2425da6836547eb075d4e6cf5
4
+ data.tar.gz: b896739d0023e6398da9effbab99ed0b48323d6a61b9f21b94b2680f9ed74146
5
5
  SHA512:
6
- metadata.gz: 3ca1f2aeaf1d5b27b9da1af4505bf0d73c7f059665c8fce3572439aa8018abaa6aaf7e9af6e8ddb63dbefdb40266e5be04b5cad00056203332817bf5d2a28ff7
7
- data.tar.gz: 7120fcf30c26e811d0c4f7fa20ebefebbf8a44fa4407460760e010df2623922d35dcc8b64a54a3bcd3b35cf509eb073668886884df4a12b93cd7e665a5217624
6
+ metadata.gz: cc03bfa1d18e5e202f4e3f069d4cf3f8ee3caf5aa3af26fdf0f9813a1c9c7756fe403764ac69f00268e3c96cbad85f1697e69eb8eab6f74b4d84351e74806e2e
7
+ data.tar.gz: 599a3c76236594b98fde583b801922b3bfb686071c9cbf2460610895d229580c428ba02026898b181dd0729dcfa18ccbecd8c1af5fde036edc17229c55ca739d
data/.rubocop.yml CHANGED
@@ -1,4 +1,5 @@
1
1
  AllCops:
2
+ NewCops: enable
2
3
  Exclude:
3
4
  - bin/*
4
5
  - lib/yard/*
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [1.1.4] - 2025-03-27
4
+ ### Additions
5
+ - Add factory for Agency (38185411)
6
+ ### Dependencies
7
+ - Removed lock to Rails 6 (f6c5024a)
8
+
3
9
  ## [1.1.3] - 2024-12-10
4
10
  ### Additions
5
11
  - Add content attribute to origin (292fed36)
data/Gemfile.lock CHANGED
@@ -2,119 +2,139 @@ PATH
2
2
  remote: .
3
3
  specs:
4
4
  ecfr (1.1.3)
5
- activemodel (~> 6.0)
6
- activesupport (~> 6.0)
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 (6.1.4)
14
- activesupport (= 6.1.4)
15
- activesupport (6.1.4)
16
- concurrent-ruby (~> 1.0, >= 1.0.2)
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
- tzinfo (~> 2.0)
20
- zeitwerk (~> 2.3)
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.1.9)
31
+ concurrent-ruby (1.3.4)
24
32
  connection_pool (2.4.1)
25
- diff-lcs (1.4.4)
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.2.1)
37
+ factory_bot (6.5.0)
29
38
  activesupport (>= 5.0.0)
30
- faraday (2.5.2)
31
- faraday-net_http (>= 2.0, < 3.1)
32
- ruby2_keywords (>= 0.0.4)
33
- faraday-net_http (3.0.0)
34
- faraday-net_http_persistent (2.1.0)
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 (~> 4.0)
37
- faraday-typhoeus (1.0.0)
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.15.5)
41
- i18n (1.8.10)
51
+ ffi (1.17.0)
52
+ i18n (1.14.6)
42
53
  concurrent-ruby (~> 1.0)
43
- json (2.6.3)
54
+ json (2.7.2)
44
55
  language_server-protocol (3.17.0.3)
45
- method_source (1.0.0)
46
- mini_portile2 (2.8.1)
47
- minitest (5.14.4)
48
- net-http-persistent (4.0.2)
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.14.0)
51
- mini_portile2 (~> 2.8.0)
65
+ nokogiri (1.16.7)
66
+ mini_portile2 (~> 2.8.2)
52
67
  racc (~> 1.4)
53
- optparse (0.3.1)
54
- parallel (1.22.1)
55
- parallel_tests (4.2.0)
68
+ ostruct (0.6.1)
69
+ parallel (1.26.3)
70
+ parallel_tests (4.7.2)
56
71
  parallel
57
- parser (3.2.2.0)
72
+ parser (3.3.5.0)
58
73
  ast (~> 2.4.1)
59
- pry (0.14.1)
74
+ racc
75
+ pry (0.14.2)
60
76
  coderay (~> 1.1)
61
77
  method_source (~> 1.0)
62
- racc (1.6.2)
63
- rack (3.0.4.1)
78
+ racc (1.8.1)
79
+ rack (3.1.7)
64
80
  rainbow (3.1.1)
65
- regexp_parser (2.7.0)
66
- request_store (1.5.1)
81
+ regexp_parser (2.9.2)
82
+ request_store (1.7.0)
67
83
  rack (>= 1.4)
68
- rexml (3.2.5)
69
- rspec (3.10.0)
70
- rspec-core (~> 3.10.0)
71
- rspec-expectations (~> 3.10.0)
72
- rspec-mocks (~> 3.10.0)
73
- rspec-core (3.10.1)
74
- rspec-support (~> 3.10.0)
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.10.0)
78
- rspec-mocks (3.10.2)
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.10.0)
81
- rspec-support (3.10.2)
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.48.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.2.0.0)
103
+ parser (>= 3.3.0.2)
88
104
  rainbow (>= 2.2.2, < 4.0)
89
- regexp_parser (>= 1.8, < 3.0)
90
- rexml (>= 3.2.5, < 4.0)
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.28.0)
95
- parser (>= 3.2.1.0)
96
- rubocop-performance (1.16.0)
97
- rubocop (>= 1.7.0, < 2.0)
98
- rubocop-ast (>= 0.4.0)
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
- ruby2_keywords (0.0.5)
101
- standard (1.26.0)
115
+ securerandom (0.3.1)
116
+ standard (1.41.0)
102
117
  language_server-protocol (~> 3.17.0.2)
103
- rubocop (~> 1.48.1)
104
- rubocop-performance (~> 1.16.0)
105
- turbo_tests (1.0.0)
106
- optparse
107
- parallel_tests
108
- rspec
109
- typhoeus (1.4.0)
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.4)
133
+ tzinfo (2.0.6)
112
134
  concurrent-ruby (~> 1.0)
113
- unicode-display_width (2.4.2)
114
- webrick (1.7.0)
115
- yard (0.9.28)
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.2.33
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 my 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.
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", "~> 6.0"
33
- spec.add_dependency "activesupport", "~> 6.0"
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 beed to install the appropriate gems
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.
@@ -43,7 +43,7 @@ module Ecfr
43
43
  end
44
44
 
45
45
  if options[:type] == :boolean
46
- define_method "#{attr}?" do
46
+ define_method :"#{attr}?" do
47
47
  val = extract_value(attr, options)
48
48
  Ecfr::AttributeCaster.cast_attr(val, options[:type], options[:options] || {})
49
49
  end
@@ -50,7 +50,7 @@ module Ecfr
50
50
 
51
51
  def initialize
52
52
  CONFIG_DEFAULTS.each do |k, v|
53
- instance_variable_set("@#{k}", v)
53
+ instance_variable_set(:"@#{k}", v)
54
54
  end
55
55
  end
56
56
 
@@ -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(*attribute)
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(results, options)
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 = {}, &block)
8
+ def self.client(client_options = {}, &)
9
9
  client_options[:timeout] = Ecfr.config.prince_xml_service_pdf_timeout
10
- super(client_options: client_options, &block)
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 "./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"
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
@@ -12,7 +12,7 @@ module Ecfr
12
12
  # @return [<DateFacet>] counts by date
13
13
  def self.search(type, options = {})
14
14
  # no-op documentation only
15
- super(type, options)
15
+ super
16
16
  end
17
17
  end
18
18
  end
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ecfr
4
- VERSION = "1.1.3"
4
+ VERSION = "1.1.4"
5
5
  end
@@ -157,7 +157,7 @@ module Ecfr
157
157
  # response
158
158
  #
159
159
  def initialize(attributes, options = {})
160
- super(attributes, options)
160
+ super
161
161
 
162
162
  ancestors.each_with_object({}) do |ancestor, hsh|
163
163
  hsh[ancestor.type] = ancestor.identifier
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.3
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: 2024-12-10 00:00:00.000000000 Z
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: '6.0'
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: '6.0'
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: '6.0'
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: '6.0'
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
- beed to install the appropriate gems\n (nokogiri, request_store, and faraday-typhoeus
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.5.16
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: []