puppet-debugger 1.4.0 → 1.6.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: f6b9c123d8e301638f736a18ee3a6330e677e8a74d21ae6a99725f1f06c3251b
4
+ data.tar.gz: 7a2508ee6b72443c40ca67150768bae8f60ea58845681f52094547d645d053ad
5
5
  SHA512:
6
- metadata.gz: 592067114dea290451e1933655d0f72ee254c8c7fb063e5bcf7901d2f3caf9afb45c7f370a5c6cbbc2c9dfff22e35a2a60d776ad94e4ba5b6a6b476e2bd82c29
7
- data.tar.gz: b7b2a003cdc1051f58e7be727ffcdd61d5d888312eac091015c54ea1ea137ba23ad4ac2d2c1514b0a4dd5d1ef7872a850dbf576b67d25ec49f419f0d6995c3b1
6
+ metadata.gz: 2925d1834927404340779da63fc1eabb2d39012a49cd9579a2deb45c6fd48d7b24a99ad18b84599bcee30d9ea4053ba80e493554749fe2bcf5883b13ae1a2e7c
7
+ data.tar.gz: 0beca4164a1f6aeb6a698ac7e960a4dea353f7c870f400ab93035a0544c523022221bc18cb40882803cbe32ed64873f98ad6cab3be8dae9d1c198547896b3b0b
data/.gitlab-ci.yml CHANGED
@@ -24,7 +24,7 @@ stages:
24
24
  script:
25
25
  - rm -f Gemfile.lock
26
26
  - bundle install --without development validate
27
- - puppet module install puppetlabs-stdlib --version 9.4.1
27
+ - bundle exec puppet module install puppetlabs-stdlib --version 9.4.1
28
28
  - bundle exec rspec
29
29
  tags:
30
30
  - ruby
@@ -115,7 +115,7 @@ puppet_7_ruby27:
115
115
  <<: *ruby27
116
116
 
117
117
  puppet_8_ruby3.2:
118
- allow_failure: true
118
+ allow_failure: false
119
119
  variables:
120
120
  PUPPET_GEM_VERSION: "~> 8.0"
121
121
  <<: *puppet_job_def_ruby30plus
@@ -126,6 +126,17 @@ puppet_8_ruby3.4:
126
126
  variables:
127
127
  PUPPET_GEM_VERSION: "~> 8.2"
128
128
  <<: *puppet_job_def_ruby30plus
129
+ <<: *ruby34
130
+
131
+ openvox_puppet_8_ruby3.2:
132
+ allow_failure: false
133
+ variables:
134
+ USE_OPENVOX: true
135
+ PUPPET_GEM_VERSION: "8.15.0"
136
+ <<: *puppet_job_def_ruby30plus
129
137
  <<: *ruby32
130
138
 
131
139
 
140
+
141
+
142
+
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.6.5
1
+ 3.4.2
data/CHANGELOG.md CHANGED
@@ -1,6 +1,15 @@
1
1
  # Puppet Debugger Changelog
2
2
 
3
3
  ## Unreleased
4
+
5
+ ## 1.6 (4/23/25)
6
+ - Add support for openvox puppet
7
+
8
+ This drops the require of puppet gem because of the recent changes in the community opensource version and now closed source legacy version. Puppet or Openvox gem is still required just not stated in the gemspec file.
9
+
10
+ ## 1.5 (3/28/25)
11
+ - Fix legacy facterdb fact issue
12
+
4
13
  ## 1.4
5
14
  - Add support for puppet 8
6
15
  - Add support for ruby 3 (tested with 3.0-3.4)
data/Gemfile CHANGED
@@ -1,17 +1,20 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  source 'http://rubygems.org'
4
- gem 'awesome_print', '~> 1.7'
5
- gem 'facterdb', '>= 0.5.0'
4
+ gem 'awesome_print', '~> 1.9'
5
+ gem 'facterdb', '>= 2.0.0'
6
6
  gem 'pluginator', '~> 1.5.0'
7
- gem 'puppet', ENV['PUPPET_GEM_VERSION'] || '~> 8'
8
7
  gem 'rb-readline'
9
8
  gem 'table_print'
10
9
  gem 'tty-pager'
10
+ if ENV['USE_OPENVOX']
11
+ gem 'openvox', git: 'https://github.com/OpenVoxProject/puppet.git', ref: ENV['PUPPET_GEM_VERSION'] || '8.15.0'
12
+ else
13
+ gem 'puppet', ENV['PUPPET_GEM_VERSION'] || '~> 8'
14
+ end
11
15
  #gem 'bolt' if Gem::Version(ENV['PUPPET_GEM_VERSION'])
12
16
 
13
17
  group :test, :development do
14
- # ruby versions prior to 2.0 cannot install json_pure 2.0.2+
15
18
  gem 'bundler'
16
19
  gem 'pry'
17
20
  gem 'puppet-debugger', path: './'
@@ -1,6 +1,9 @@
1
1
  # frozen_string_literal: true
2
-
3
- require 'puppet'
2
+ begin
3
+ require 'puppet'
4
+ rescue LoadError
5
+ abort "puppet-debugger requires either the 'puppet' or 'openvox' gem to be installed."
6
+ end
4
7
  require 'readline'
5
8
  require 'json'
6
9
  require 'puppet-debugger/support'
@@ -16,6 +19,7 @@ module PuppetDebugger
16
19
  extend Forwardable
17
20
  attr_accessor :settings, :log_level, :in_buffer, :out_buffer, :html_mode, :extra_prompt, :bench
18
21
  attr_reader :source_file, :source_line_num, :hooks, :options
22
+
19
23
  def_delegators :hooks, :exec_hook, :add_hook, :delete_hook
20
24
  OUT_SYMBOL = ' => '
21
25
  def initialize(options = {})
@@ -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
@@ -142,7 +142,7 @@ module PuppetDebugger
142
142
  file
143
143
  end
144
144
 
145
- # @return [Bolt::PuppetDB::Client]
145
+ # @return [Bolt::PuppetDB::Client]
146
146
  def bolt_pdb_client
147
147
  @bolt_pdb_client ||=
148
148
  begin
@@ -196,7 +196,6 @@ module PuppetDebugger
196
196
  def puppet_lib_dir
197
197
  # returns something like "/Library/Ruby/Gems/2.0.0/gems/puppet-4.2.2/lib/puppet.rb"
198
198
  # "/Users/adam/.rbenv/versions/2.2.6/lib/ruby/gems/2.2.0/gems/puppet-4.9.4/lib"
199
-
200
199
  # this is only useful when returning a namespace with the functions
201
200
  @puppet_lib_dir ||= File.dirname(Puppet.method(:[]).source_location.first)
202
201
  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.6.0'
5
5
  end
@@ -36,7 +36,7 @@ Gem::Specification.new do |s|
36
36
  s.add_runtime_dependency('bundler')
37
37
  s.add_runtime_dependency('facterdb', ['>= 0.4.0'])
38
38
  s.add_runtime_dependency('pluginator', ['~> 1.5.0'])
39
- s.add_runtime_dependency('puppet', ['>= 6'])
39
+ # s.add_runtime_dependency('puppet', ['>= 6']) - since there is now puppet and openvox, this is now a grey dependency
40
40
  # s.add_runtime_dependency('bolt', ['>= 2.42.0'])
41
41
  s.add_runtime_dependency('rb-readline', ['>= 0.5.5'])
42
42
  s.add_runtime_dependency('table_print', ['>= 1.0.0'])
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/spec/support_spec.rb CHANGED
@@ -17,7 +17,7 @@ describe 'support' do
17
17
  end
18
18
 
19
19
  let(:puppet_version) do
20
- debugger.puppet_lib_dir.scan(debugger.mod_finder).flatten.last
20
+ Puppet.version
21
21
  end
22
22
 
23
23
  let(:manifest_file) do
@@ -41,7 +41,7 @@ describe 'support' do
41
41
  end
42
42
 
43
43
  it 'should return a puppet version' do
44
- expect(puppet_version).to match(/puppet-\d\.\d+.\d/)
44
+ expect(puppet_version).to match(/\d\.\d+.\d/)
45
45
  end
46
46
 
47
47
  it 'should return lib dirs' do
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.6.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-04-23 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: awesome_print
@@ -66,20 +65,6 @@ dependencies:
66
65
  - - "~>"
67
66
  - !ruby/object:Gem::Version
68
67
  version: 1.5.0
69
- - !ruby/object:Gem::Dependency
70
- name: puppet
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- version: '6'
76
- type: :runtime
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: '6'
83
68
  - !ruby/object:Gem::Dependency
84
69
  name: rb-readline
85
70
  requirement: !ruby/object:Gem::Requirement
@@ -307,7 +292,6 @@ licenses:
307
292
  - MIT
308
293
  metadata:
309
294
  allowed_push_host: https://rubygems.org
310
- post_install_message:
311
295
  rdoc_options: []
312
296
  require_paths:
313
297
  - lib
@@ -322,8 +306,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
322
306
  - !ruby/object:Gem::Version
323
307
  version: '0'
324
308
  requirements: []
325
- rubygems_version: 3.4.10
326
- signing_key:
309
+ rubygems_version: 3.6.2
327
310
  specification_version: 4
328
311
  summary: A repl based debugger for the puppet language
329
312
  test_files: []