puppet-debugger 1.4.0 → 1.5.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: 588f4c8928181443aa7e98e820530d79c9efb705a7a9b95f5e447066d87cac96
4
- data.tar.gz: 109e0616bd93547ea2e6975bbdd4e58b27e92bcc9533b206c4194d37be6a49e8
3
+ metadata.gz: c05bac6e844493bd642e75761c8aa9362e7b1858c7b425c304f7f9babd973965
4
+ data.tar.gz: c067b4abb4088b86050f77afecc23bd14b75a1ae58f8136e4407ac2e7002b58e
5
5
  SHA512:
6
- metadata.gz: 592067114dea290451e1933655d0f72ee254c8c7fb063e5bcf7901d2f3caf9afb45c7f370a5c6cbbc2c9dfff22e35a2a60d776ad94e4ba5b6a6b476e2bd82c29
7
- data.tar.gz: b7b2a003cdc1051f58e7be727ffcdd61d5d888312eac091015c54ea1ea137ba23ad4ac2d2c1514b0a4dd5d1ef7872a850dbf576b67d25ec49f419f0d6995c3b1
6
+ metadata.gz: 001e82eafc7e251adb9fe445a7657cdf9171d301621e848c416dcbd75c9e39965f0e50058ec177a03b895e28b23ed5e5ae618b1279272c6a318224dc0a56b990
7
+ data.tar.gz: 95858260c3286ac3b1f2eed2a8b0a01e6a1554426c981483b680ce3089119468bed28a58f5171e10b9e93f66d1b677d629b667902894949ea34674f024eb1bc8
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.6.5
1
+ 3.4.2
data/CHANGELOG.md CHANGED
@@ -1,6 +1,10 @@
1
1
  # Puppet Debugger Changelog
2
2
 
3
3
  ## Unreleased
4
+
5
+ ## 1.5 (3/28/25)
6
+ - Fix legacy facterdb fact issue
7
+
4
8
  ## 1.4
5
9
  - Add support for puppet 8
6
10
  - Add support for ruby 3 (tested with 3.0-3.4)
@@ -12,7 +12,7 @@ module PuppetDebugger
12
12
  end
13
13
 
14
14
  def default_facterdb_filter
15
- "operatingsystem=#{facter_os_name} and operatingsystemrelease=#{facter_os_version} and architecture=x86_64 and facterversion=#{facter_version}"
15
+ "os.name=#{facter_os_name} and os.release.major=#{facter_os_version} and os.architecture=x86_64 and facterversion=#{facter_version}"
16
16
  end
17
17
 
18
18
  def facter_version
@@ -21,19 +21,15 @@ module PuppetDebugger
21
21
 
22
22
  # return the correct supported version of facter facts
23
23
  def default_facter_version
24
- if Gem::Version.new(Puppet.version) >= Gem::Version.new(4.4)
25
- '/^3\.1/'
26
- else
27
- '/^2\.4/'
28
- end
24
+ '/^4/'
29
25
  end
30
26
 
31
27
  def facter_os_name
32
- ENV['DEBUGGER_FACTER_OS_NAME'] || 'Fedora'
28
+ ENV['DEBUGGER_FACTER_OS_NAME'] || 'Rocky'
33
29
  end
34
30
 
35
31
  def facter_os_version
36
- ENV['DEBUGGER_FACTER_OS_VERSION'] || '23'
32
+ ENV['DEBUGGER_FACTER_OS_VERSION'] || '8'
37
33
  end
38
34
 
39
35
  def set_facts(value)
@@ -49,7 +45,8 @@ module PuppetDebugger
49
45
  message = <<~OUT
50
46
  Using filter: #{dynamic_facterdb_filter}
51
47
  Bad FacterDB filter, please change the filter so it returns a result set.
52
- See https://github.com/camptocamp/facterdb/#with-a-string-filter
48
+ Use puppet debugger --no-facterdb to disable facterdb.
49
+ See https://github.com/voxpupuli/facterdb/#with-a-string-filter
53
50
  OUT
54
51
  raise PuppetDebugger::Exception::BadFilter, message: message
55
52
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PuppetDebugger
4
- VERSION = '1.4.0'
4
+ VERSION = '1.5.0'
5
5
  end
data/spec/facts_spec.rb CHANGED
@@ -8,7 +8,7 @@ describe 'facts' do
8
8
  end
9
9
 
10
10
  let(:puppet_version) do
11
- '4.5.3'
11
+ '8.1'
12
12
  end
13
13
 
14
14
  let(:facter_version) do
@@ -19,28 +19,9 @@ describe 'facts' do
19
19
  allow(Puppet).to receive(:version).and_return(puppet_version)
20
20
  end
21
21
 
22
- describe '2.4' do
23
- before(:each) do
24
- ENV['DEBUGGER_FACTERDB_FILTER'] = nil
25
- end
26
- let(:puppet_version) do
27
- '4.2.0'
28
- end
29
- it 'returns 2.4' do
30
- expect(facter_version).to eq('/^2\.4/')
31
- end
32
- it 'return default filter' do
33
- expect(debugger.dynamic_facterdb_filter).to eq('operatingsystem=Fedora and operatingsystemrelease=23 and architecture=x86_64 and facterversion=/^2\\.4/')
34
- end
35
- it 'get node_facts' do
36
- expect(debugger.node_facts).to be_instance_of(Hash)
37
- end
38
- it 'has fqdn' do
39
- expect(debugger.node_facts[:fqdn]).to eq('foo.example.com')
40
- end
41
- end
42
22
 
43
- describe '3.1' do
23
+
24
+ describe '4' do
44
25
  before(:each) do
45
26
  ENV['DEBUGGER_FACTERDB_FILTER'] = nil
46
27
  end
@@ -56,11 +37,11 @@ describe 'facts' do
56
37
  it 'has fqdn' do
57
38
  expect(debugger.node_facts[:fqdn]).to eq('foo.example.com')
58
39
  end
59
- it 'returns 3.1' do
60
- expect(facter_version).to eq('/^3\.1/')
40
+ it 'returns 4' do
41
+ expect(facter_version).to eq('/^4/')
61
42
  end
62
43
  it 'return default filter' do
63
- expect(debugger.dynamic_facterdb_filter).to eq('operatingsystem=Fedora and operatingsystemrelease=23 and architecture=x86_64 and facterversion=/^3\\.1/')
44
+ expect(debugger.dynamic_facterdb_filter).to eq("os.name=Rocky and os.release.major=8 and os.architecture=x86_64 and facterversion=/^4/")
64
45
  end
65
46
  end
66
47
 
@@ -78,10 +59,10 @@ describe 'facts' do
78
59
  end
79
60
  describe 'good filter' do
80
61
  before(:each) do
81
- ENV['DEBUGGER_FACTERDB_FILTER'] = 'facterversion=/^3\.1/'
62
+ ENV['DEBUGGER_FACTERDB_FILTER'] = 'facterversion=/^4.0.52/'
82
63
  end
83
64
  it 'return filter' do
84
- expect(debugger.dynamic_facterdb_filter).to eq('facterversion=/^3\\.1/')
65
+ expect(debugger.dynamic_facterdb_filter).to eq('facterversion=/^4.0.52/')
85
66
  end
86
67
  end
87
68
  end
@@ -43,6 +43,7 @@ describe :functions do
43
43
  debugger_output = /HELLO/
44
44
  debugger.handle_input("swapcase('hello')")
45
45
  expect(output.string).to match(debugger_output)
46
+ # did you run? bundle exec puppet module install puppetlabs-stdlib
46
47
  end
47
48
 
48
49
  it '#function_obj with native function' do
data/spec/spec_helper.rb CHANGED
@@ -32,7 +32,8 @@ $LOAD_PATH.unshift(File.dirname(__FILE__))
32
32
 
33
33
  require 'rspec'
34
34
  require 'puppet-debugger'
35
- ENV['REPL_FACTERDB_FILTER'] = 'operatingsystem=Fedora and operatingsystemrelease=23 and architecture=x86_64 and facterversion=/^2\\.4/'
35
+
36
+ ENV['REPL_FACTERDB_FILTER'] = 'os.name=Rocky and os.release.major=8 and architecture=x86_64 and facterversion=/^4/'
36
37
  # Requires supporting files with custom matchers and macros, etc,
37
38
  # in ./support/ and its subdirectories.
38
39
  Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].sort.each { |f| require f }
data/test_matrix.rb CHANGED
@@ -23,7 +23,7 @@ def run_container(image, puppet_version)
23
23
  end
24
24
 
25
25
  def ci_data
26
- @ci_data ||= YAML.load_file(File.expand_path('.gitlab-ci.yml'))
26
+ @ci_data ||= YAML.load_file(File.expand_path('.gitlab-ci.yml'), aliases: true)
27
27
  end
28
28
 
29
29
  def matrix
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet-debugger
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Corey Osman
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-01-18 00:00:00.000000000 Z
10
+ date: 2025-03-28 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: awesome_print
@@ -307,7 +306,6 @@ licenses:
307
306
  - MIT
308
307
  metadata:
309
308
  allowed_push_host: https://rubygems.org
310
- post_install_message:
311
309
  rdoc_options: []
312
310
  require_paths:
313
311
  - lib
@@ -322,8 +320,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
322
320
  - !ruby/object:Gem::Version
323
321
  version: '0'
324
322
  requirements: []
325
- rubygems_version: 3.4.10
326
- signing_key:
323
+ rubygems_version: 3.6.2
327
324
  specification_version: 4
328
325
  summary: A repl based debugger for the puppet language
329
326
  test_files: []