facterdb 3.10.0 → 4.0.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: 4811b09fb0b84e2f9a69decfde91a957a1e436eb30f694b285b1d507da9aecac
4
- data.tar.gz: 7e374aaba5cefa94e2e5e4e5857010be2a93160841f8e67e5d4d25eda5325bd3
3
+ metadata.gz: 55fbb7e034c2f4b38f9e547240a29f84fd2ead1de14edf0234aa2f31d4a572ae
4
+ data.tar.gz: cb70cfca4a7a269a9a4f66933ab2bfaded0fe8897db543195129320fae8dbdf5
5
5
  SHA512:
6
- metadata.gz: 6f7ac617c3aab9d5896ab89e3090fba7817f14ac151cee2b07fd19cd72d0cc6c0ac2302ceba437bffc8fd907730932ee4c6e0c542bb34644f3f35d50a85c420d
7
- data.tar.gz: acc888a1711af6dd9a9f93f739e52b46771952542d8bc818b427d20313af8d23bb4d583efd149810eecb6c337f5f67e7b4dc608c51eab6712e9cdd3ebd3cc024
6
+ metadata.gz: 4c75725b68ad135b124d49a2e23320d549b7cc5d0f0d576a10edf704546e22175374ebb31c8e0e499d8adf91a37a730f80c7058db720ec98b75183c98bff0562
7
+ data.tar.gz: 0532e2b2a6476324f3c7d2a69c5a1138c2bc4645823038e221acb35c83f789ff1cc7373795d6ee73eb868ec87a00b5309e1c9fe6b54e6a5fc51d93f06a2f199f
@@ -22,7 +22,7 @@ jobs:
22
22
  runs-on: ubuntu-latest
23
23
  steps:
24
24
  - name: Checkout
25
- uses: actions/checkout@v4
25
+ uses: actions/checkout@v5
26
26
  - name: Set up Ruby
27
27
  uses: ruby/setup-ruby@v1
28
28
  with:
@@ -15,7 +15,7 @@ jobs:
15
15
  name: Build the gem
16
16
  runs-on: ubuntu-24.04
17
17
  steps:
18
- - uses: actions/checkout@v4
18
+ - uses: actions/checkout@v5
19
19
  - name: Install Ruby
20
20
  uses: ruby/setup-ruby@v1
21
21
  with:
@@ -15,7 +15,7 @@ jobs:
15
15
  outputs:
16
16
  ruby: ${{ steps.ruby.outputs.versions }}
17
17
  steps:
18
- - uses: actions/checkout@v4
18
+ - uses: actions/checkout@v5
19
19
  - name: Install Ruby ${{ matrix.ruby }}
20
20
  uses: ruby/setup-ruby@v1
21
21
  with:
@@ -34,7 +34,7 @@ jobs:
34
34
  matrix:
35
35
  ruby: ${{ fromJSON(needs.rubocop_and_matrix.outputs.ruby) }}
36
36
  steps:
37
- - uses: actions/checkout@v4
37
+ - uses: actions/checkout@v5
38
38
  - name: Install Ruby ${{ matrix.ruby }}
39
39
  uses: ruby/setup-ruby@v1
40
40
  with:
data/.rubocop.yml CHANGED
@@ -6,3 +6,6 @@ inherit_gem:
6
6
 
7
7
  Style/IfUnlessModifier:
8
8
  Enabled: false
9
+
10
+ AllCops:
11
+ TargetRubyVersion: 3.2
data/.rubocop_todo.yml CHANGED
@@ -1,13 +1,13 @@
1
1
  # This configuration was generated by
2
- # `rubocop --auto-gen-config`
3
- # on 2024-06-12 14:45:50 UTC using RuboCop version 1.63.5.
2
+ # `rubocop --auto-gen-config --no-auto-gen-timestamp`
3
+ # using RuboCop version 1.79.2.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
9
  # Offense count: 1
10
- # Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches.
10
+ # Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches, IgnoreDuplicateElseBranch.
11
11
  Lint/DuplicateBranch:
12
12
  Exclude:
13
13
  - 'Rakefile'
@@ -18,13 +18,6 @@ Lint/SuppressedException:
18
18
  Exclude:
19
19
  - 'Rakefile'
20
20
 
21
- # Offense count: 3
22
- # This cop supports unsafe autocorrection (--autocorrect-all).
23
- # Configuration parameters: AutoCorrect.
24
- Lint/UselessAssignment:
25
- Exclude:
26
- - 'spec/facts_spec.rb'
27
-
28
21
  # Offense count: 3
29
22
  # Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
30
23
  # AllowedNames: as, at, by, cc, db, id, if, in, io, ip, of, on, os, pp, to
@@ -71,15 +64,11 @@ RSpec/DescribedClass:
71
64
  Exclude:
72
65
  - 'spec/facter_db_spec.rb'
73
66
 
74
- # Offense count: 5
67
+ # Offense count: 4
75
68
  # Configuration parameters: CountAsOne.
76
69
  RSpec/ExampleLength:
77
70
  Max: 13
78
71
 
79
- # Offense count: 8
80
- RSpec/MultipleExpectations:
81
- Max: 13
82
-
83
72
  # Offense count: 11
84
73
  # Configuration parameters: AllowSubject.
85
74
  RSpec/MultipleMemoizedHelpers:
@@ -105,6 +94,12 @@ Style/CaseLikeIf:
105
94
  Exclude:
106
95
  - 'Rakefile'
107
96
 
97
+ # Offense count: 1
98
+ # This cop supports unsafe autocorrection (--autocorrect-all).
99
+ Style/CollectionQuerying:
100
+ Exclude:
101
+ - 'spec/facts_spec.rb'
102
+
108
103
  # Offense count: 2
109
104
  # Configuration parameters: AllowedConstants.
110
105
  Style/Documentation:
@@ -120,6 +115,7 @@ Style/Documentation:
120
115
  # SupportedStyles: always, always_true, never
121
116
  Style/FrozenStringLiteralComment:
122
117
  Exclude:
118
+ - '**/*.arb'
123
119
  - 'Gemfile'
124
120
  - 'Rakefile'
125
121
  - 'bin/facterdb'
@@ -188,7 +184,7 @@ Style/SymbolProc:
188
184
 
189
185
  # Offense count: 5
190
186
  # This cop supports safe autocorrection (--autocorrect).
191
- # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
187
+ # Configuration parameters: AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
192
188
  # URISchemes: http, https
193
189
  Layout/LineLength:
194
190
  Max: 154
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [4.0.0](https://rubygems.org/gems/facterdb/versions/4.0.0) (2025-08-12)
4
+
5
+ [Full Changelog](https://github.com/voxpupuli/facterdb/compare/3.10.0...4.0.0)
6
+
7
+ **Breaking changes:**
8
+
9
+ - Require Ruby 3.2 or newer [\#415](https://github.com/voxpupuli/facterdb/pull/415) ([bastelfreak](https://github.com/bastelfreak))
10
+
3
11
  ## [3.10.0](https://rubygems.org/gems/facterdb/versions/3.10.0) (2025-08-11)
4
12
 
5
13
  [Full Changelog](https://github.com/voxpupuli/facterdb/compare/3.9.0...3.10.0)
data/facterdb.gemspec CHANGED
@@ -15,12 +15,12 @@ Gem::Specification.new do |s|
15
15
  s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
16
16
 
17
17
  # we have that configured in our CI file
18
- s.required_ruby_version = Gem::Requirement.new('>= 2.7.0')
18
+ s.required_ruby_version = Gem::Requirement.new('>= 3.2.0')
19
19
 
20
20
  s.add_development_dependency 'coveralls', '~> 0.8.23'
21
21
  s.add_development_dependency 'rake', '~> 13.2', '>= 13.2.1'
22
22
  s.add_development_dependency 'rspec', '~> 3.13'
23
23
 
24
- s.add_development_dependency 'voxpupuli-rubocop', '~> 3.1.0'
24
+ s.add_development_dependency 'voxpupuli-rubocop', '~> 4.2.0'
25
25
  s.add_dependency 'jgrep', '~> 1.5', '>= 1.5.4'
26
26
  end
@@ -1,5 +1,5 @@
1
1
  module FacterDB
2
2
  module Version
3
- STRING = '3.10.0'
3
+ STRING = '4.0.0'
4
4
  end
5
5
  end
data/lib/facterdb.rb CHANGED
@@ -49,7 +49,7 @@ module FacterDB
49
49
  def self.default_fact_files
50
50
  return [] unless use_defaultdb?
51
51
 
52
- proj_root = File.join(File.dirname(File.dirname(__FILE__)))
52
+ proj_root = File.join(File.dirname(__FILE__, 2))
53
53
  facts_dir = File.expand_path(File.join(proj_root, 'facts'))
54
54
  Dir.glob(File.join(facts_dir, '**', '*.facts'))
55
55
  end
@@ -240,7 +240,7 @@ describe FacterDB do
240
240
  let(:symbolize_keys) { nil }
241
241
 
242
242
  context 'without parameters' do
243
- include_examples 'returns a result'
243
+ it_behaves_like 'returns a result'
244
244
  end
245
245
 
246
246
  context 'with stringified output' do
@@ -266,19 +266,19 @@ describe FacterDB do
266
266
  context 'with an Array filter' do
267
267
  let(:filter) { [kernel: 'Linux'] }
268
268
 
269
- include_examples 'returns a result'
269
+ it_behaves_like 'returns a result'
270
270
  end
271
271
 
272
272
  context 'with a Hash filter' do
273
273
  let(:filter) { { kernel: 'Linux' } }
274
274
 
275
- include_examples 'returns a result'
275
+ it_behaves_like 'returns a result'
276
276
  end
277
277
 
278
278
  context 'with a String filter' do
279
279
  let(:filter) { 'kernel=Linux' }
280
280
 
281
- include_examples 'returns a result'
281
+ it_behaves_like 'returns a result'
282
282
  end
283
283
 
284
284
  context 'with a filter of an unsupported type' do
data/spec/facts_spec.rb CHANGED
@@ -15,10 +15,9 @@ end
15
15
  RSpec::Matchers.define :be_valid_json do
16
16
  match do |actual|
17
17
  content = File.binread(actual)
18
- valid = false
19
18
  begin
20
- obj = JSON.parse(content)
21
- valid = true
19
+ JSON.parse(content)
20
+ true
22
21
  rescue JSON::ParserError => e
23
22
  raise "Invalid JSON file #{actual}.\n#{e}"
24
23
  end
data/spec/spec_helper.rb CHANGED
@@ -16,5 +16,5 @@ RSpec::Matchers.define_negated_matcher :not_be_nil, :be_nil
16
16
  RSpec::Matchers.define_negated_matcher :not_be_empty, :be_empty
17
17
 
18
18
  def project_dir
19
- File.dirname File.dirname(File.expand_path(__FILE__))
19
+ File.dirname(File.expand_path(__FILE__), 2)
20
20
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: facterdb
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.10.0
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vox Pupuli
@@ -63,14 +63,14 @@ dependencies:
63
63
  requirements:
64
64
  - - "~>"
65
65
  - !ruby/object:Gem::Version
66
- version: 3.1.0
66
+ version: 4.2.0
67
67
  type: :development
68
68
  prerelease: false
69
69
  version_requirements: !ruby/object:Gem::Requirement
70
70
  requirements:
71
71
  - - "~>"
72
72
  - !ruby/object:Gem::Version
73
- version: 3.1.0
73
+ version: 4.2.0
74
74
  - !ruby/object:Gem::Dependency
75
75
  name: jgrep
76
76
  requirement: !ruby/object:Gem::Requirement
@@ -545,7 +545,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
545
545
  requirements:
546
546
  - - ">="
547
547
  - !ruby/object:Gem::Version
548
- version: 2.7.0
548
+ version: 3.2.0
549
549
  required_rubygems_version: !ruby/object:Gem::Requirement
550
550
  requirements:
551
551
  - - ">="