puppet-debugger 1.3.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: d2ccbfeec771b3cc202f749b5aa17e96e2dd5f5ebfa9090887e17fb22b035d30
4
- data.tar.gz: c8169e8f2531f3cd62c7b74e3f06a93b0be8e82e09b34ad71abc6a0456a6c113
3
+ metadata.gz: c05bac6e844493bd642e75761c8aa9362e7b1858c7b425c304f7f9babd973965
4
+ data.tar.gz: c067b4abb4088b86050f77afecc23bd14b75a1ae58f8136e4407ac2e7002b58e
5
5
  SHA512:
6
- metadata.gz: c7a4b91dee8c074e955cfefdae802d89f3ab1c3c5600fb56ea55cbbffca294845110f9b88ada2809bd1481925e7821fc34c9e4a8d77d986e5f02fa81f7e3a7e1
7
- data.tar.gz: 839bd3f8c4ef3d4d8a8ac4ecb4b2c4782f94b1207fda0a4ceaa7d8a623151605838934437c3b02801d095389d55d9a590de385f7423a1c87adf7723cd79fcd86
6
+ metadata.gz: 001e82eafc7e251adb9fe445a7657cdf9171d301621e848c416dcbd75c9e39965f0e50058ec177a03b895e28b23ed5e5ae618b1279272c6a318224dc0a56b990
7
+ data.tar.gz: 95858260c3286ac3b1f2eed2a8b0a01e6a1554426c981483b680ce3089119468bed28a58f5171e10b9e93f66d1b677d629b667902894949ea34674f024eb1bc8
data/.gitlab-ci.yml CHANGED
@@ -5,17 +5,26 @@ stages:
5
5
  - validate
6
6
  - test
7
7
  - release
8
- - deploy
8
+ # - deploy
9
9
  #- web_deploy
10
10
 
11
- .puppet_def: &puppet_job_def
11
+ .puppet_job_def_ruby27: &puppet_job_def_ruby27
12
12
  stage: test
13
13
  script:
14
14
  - rm -f Gemfile.lock
15
- - gem update --system > /dev/null
16
- - gem install bundler > /dev/null
15
+ - gem install bundler -v 2.4.22 > /dev/null
17
16
  - bundle install --without development validate
18
- - bundle exec puppet module install puppetlabs-stdlib
17
+ - bundle exec puppet module install puppetlabs-stdlib --version 8.6.0
18
+ - bundle exec rspec
19
+ tags:
20
+ - ruby
21
+
22
+ .puppet_job_def_ruby30plus: &puppet_job_def_ruby30plus
23
+ stage: test
24
+ script:
25
+ - rm -f Gemfile.lock
26
+ - bundle install --without development validate
27
+ - puppet module install puppetlabs-stdlib --version 9.4.1
19
28
  - bundle exec rspec
20
29
  tags:
21
30
  - ruby
@@ -64,67 +73,59 @@ bump_and_tag:
64
73
  # script:
65
74
  # - "curl -X POST -F token=$PREPL_BUILD_TRIGGER_TOKEN -F ref=$REF https://gitlab.com/api/v3/projects/1146764/trigger/builds"
66
75
 
67
- .ruby_24: &ruby24
68
- image: ruby:2.4
69
-
70
- .ruby_25: &ruby25
71
- image: ruby:2.5
72
-
73
- .ruby_26: &ruby26
74
- image: ruby:2.6
75
-
76
76
  .ruby_27: &ruby27
77
77
  image: ruby:2.7
78
78
 
79
- .ruby_30: &ruby30
80
- image: ruby:3.0
81
-
82
79
  .ruby_31: &ruby31
83
80
  image: ruby:3.1
84
81
 
85
- gem_production:
86
- image: ruby:2.7
87
- tags:
88
- - ruby
89
- before_script:
90
- - gem install dpl
91
- stage: deploy
92
- script:
93
- - dpl --provider=rubygems --api-key=$RUBYGEMS_API_KEY
94
- only:
95
- - tags
82
+ .ruby_32: &ruby32
83
+ image: ruby:3.2
96
84
 
97
- puppet_6_ruby25:
98
- variables:
99
- PUPPET_GEM_VERSION: "~> 6.0"
100
- <<: *puppet_job_def
101
- <<: *ruby25
85
+ .ruby_33: &ruby33
86
+ image: ruby:3.3
102
87
 
103
- puppet_6_ruby26:
104
- variables:
105
- PUPPET_GEM_VERSION: "~> 6.0"
106
- <<: *puppet_job_def
107
- <<: *ruby26
88
+ .ruby_34: &ruby34
89
+ image: ruby:3.4
90
+
91
+ # gem_production:
92
+ # image: ruby:2.7
93
+ # tags:
94
+ # - ruby
95
+ # before_script:
96
+ # - gem install dpl
97
+ # stage: deploy
98
+ # script:
99
+ # - dpl --provider=rubygems --api-key=$RUBYGEMS_API_KEY
100
+ # only:
101
+ # - tags
108
102
 
109
103
  puppet_6_ruby27:
110
104
  allow_failure: false
111
105
  variables:
112
106
  PUPPET_GEM_VERSION: "~> 6.0"
113
- <<: *puppet_job_def
107
+ <<: *puppet_job_def_ruby27
114
108
  <<: *ruby27
115
109
 
116
110
  puppet_7_ruby27:
117
111
  allow_failure: false
118
112
  variables:
119
113
  PUPPET_GEM_VERSION: "~> 7.0"
120
- <<: *puppet_job_def
114
+ <<: *puppet_job_def_ruby27
121
115
  <<: *ruby27
122
116
 
123
- # puppet_8_ruby3.0:
124
- # allow_failure: true
125
- # variables:
126
- # PUPPET_GEM_VERSION: "~> 8.0"
127
- # <<: *puppet_job_def
128
- # <<: *ruby30
117
+ puppet_8_ruby3.2:
118
+ allow_failure: true
119
+ variables:
120
+ PUPPET_GEM_VERSION: "~> 8.0"
121
+ <<: *puppet_job_def_ruby30plus
122
+ <<: *ruby32
123
+
124
+ puppet_8_ruby3.4:
125
+ allow_failure: true
126
+ variables:
127
+ PUPPET_GEM_VERSION: "~> 8.2"
128
+ <<: *puppet_job_def_ruby30plus
129
+ <<: *ruby32
129
130
 
130
131
 
data/.rubocop_todo.yml CHANGED
@@ -132,7 +132,7 @@ Style/IfUnlessModifier:
132
132
  - 'lib/puppet-debugger/hooks.rb'
133
133
 
134
134
  # Offense count: 1
135
- Style/MethodMissingSuper:
135
+ Lint/MissingSuper:
136
136
  Exclude:
137
137
  - 'lib/puppet-debugger/debugger_code.rb'
138
138
 
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.5 (3/28/25)
6
+ - Fix legacy facterdb fact issue
7
+
8
+ ## 1.4
9
+ - Add support for puppet 8
10
+ - Add support for ruby 3 (tested with 3.0-3.4)
11
+ - Updates rdoc to 6.0 due to json issue
12
+
4
13
  ## 1.3
5
14
  - Fix failures when using Bolt 3.23+
6
15
  - Relax tty-pager constraints (for Bolt)
data/Gemfile CHANGED
@@ -4,7 +4,7 @@ source 'http://rubygems.org'
4
4
  gem 'awesome_print', '~> 1.7'
5
5
  gem 'facterdb', '>= 0.5.0'
6
6
  gem 'pluginator', '~> 1.5.0'
7
- gem 'puppet', ENV['PUPPET_GEM_VERSION'] || '~> 5.5'
7
+ gem 'puppet', ENV['PUPPET_GEM_VERSION'] || '~> 8'
8
8
  gem 'rb-readline'
9
9
  gem 'table_print'
10
10
  gem 'tty-pager'
@@ -16,7 +16,7 @@ group :test, :development do
16
16
  gem 'pry'
17
17
  gem 'puppet-debugger', path: './'
18
18
  gem 'rake', '~> 13.0'
19
- gem 'rdoc', '~> 3.12'
19
+ gem 'rdoc', '~> 6.0'
20
20
  gem 'release_me'
21
21
  gem 'rspec', '~> 3.6'
22
22
  gem 'rubocop'
@@ -29,9 +29,10 @@ module PuppetDebugger
29
29
  files = globs.map { |g| Dir.glob(g) }.flatten
30
30
  files.map do |f|
31
31
  m = File.read(f).match(/type\s([a-z\d\:_]+)/i)
32
- next if m =~ /type|alias/ # can't figure out the best way to filter type and alias out
33
-
34
- m[1] if m && m[1] =~ /::/
32
+ if m
33
+ next if m[1] =~ /type|alias/ # can't figure out the best way to filter type and alias out
34
+ m[1] if m[1] =~ /::/
35
+ end
35
36
  end.uniq.compact
36
37
  end
37
38
 
@@ -325,7 +325,7 @@ class DebuggerCode
325
325
  def method_missing(name, *args, &block)
326
326
  to_s.send(name, *args, &block)
327
327
  end
328
- undef =~
328
+ undef =~ if method_defined?(:=~)
329
329
 
330
330
  protected
331
331
 
@@ -20,7 +20,7 @@ RSpec.shared_examples 'plugin_tests' do |_parameter|
20
20
  {}
21
21
  end
22
22
 
23
- it 'commands contant is an array' do
23
+ it 'commands content is an array' do
24
24
  expect(plugin.class::COMMAND_WORDS).to be_a(Array)
25
25
  end
26
26
 
@@ -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.3.0'
4
+ VERSION = '1.5.0'
5
5
  end
@@ -27,7 +27,7 @@ Gem::Specification.new do |s|
27
27
  'LICENSE.txt',
28
28
  'README.md'
29
29
  ]
30
- s.required_ruby_version = '>= 2.4'
30
+ s.required_ruby_version = '>= 2.7'
31
31
  s.homepage = 'https://gitlab.com/puppet-debugger/puppet-debugger'
32
32
  s.licenses = ['MIT']
33
33
  s.rubygems_version = '2.4.5.1'
@@ -36,11 +36,11 @@ 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', ['>= 5.5'])
39
+ s.add_runtime_dependency('puppet', ['>= 6'])
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'])
43
- s.add_runtime_dependency('tty-pager', ['~> 0.13'])
44
- s.add_development_dependency('rdoc', ['~> 3.12'])
45
- s.add_development_dependency('rspec', ['~> 3.6'])
43
+ s.add_runtime_dependency('tty-pager', ['~> 0.14'])
44
+ s.add_development_dependency('rdoc', ['>= 6.0'])
45
+ s.add_development_dependency('rspec', ['>= 3.6'])
46
46
  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
@@ -24,7 +24,7 @@ describe :exit do
24
24
  {}
25
25
  end
26
26
 
27
- it 'commands contant is an array' do
27
+ it 'commands content is an array' do
28
28
  expect(plugin.class::COMMAND_WORDS).to be_a(Array)
29
29
  end
30
30
 
@@ -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/pdb_spec.rb CHANGED
@@ -31,7 +31,7 @@ describe 'pdb' do
31
31
 
32
32
  describe 'remote_node' do
33
33
  let(:node_obj) do
34
- YAML.load_file(File.join(fixtures_dir, 'node_obj.yaml'))
34
+ YAML.unsafe_load_file(File.join(fixtures_dir, 'node_obj.yaml'))
35
35
  end
36
36
  let(:node_name) do
37
37
  'puppetdev.localdomain'
@@ -29,7 +29,7 @@ describe 'PuppetDebugger' do
29
29
 
30
30
  describe 'remote node' do
31
31
  let(:node_obj) do
32
- YAML.load_file(File.join(fixtures_dir, 'node_obj.yaml'))
32
+ YAML.unsafe_load_file(File.join(fixtures_dir, 'node_obj.yaml'))
33
33
  end
34
34
  let(:node_name) do
35
35
  'puppetdev.localdomain'
@@ -69,7 +69,7 @@ describe 'PuppetDebugger' do
69
69
  end
70
70
  describe 'use defaults when invalid' do
71
71
  let(:node_obj) do
72
- YAML.load_file(File.join(fixtures_dir, 'invalid_node_obj.yaml'))
72
+ YAML.unsafe_load_file(File.join(fixtures_dir, 'invalid_node_obj.yaml'))
73
73
  end
74
74
  let(:node_name) do
75
75
  'invalid.localdomain'
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.3.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: 2022-12-02 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
@@ -72,14 +71,14 @@ dependencies:
72
71
  requirements:
73
72
  - - ">="
74
73
  - !ruby/object:Gem::Version
75
- version: '5.5'
74
+ version: '6'
76
75
  type: :runtime
77
76
  prerelease: false
78
77
  version_requirements: !ruby/object:Gem::Requirement
79
78
  requirements:
80
79
  - - ">="
81
80
  - !ruby/object:Gem::Version
82
- version: '5.5'
81
+ version: '6'
83
82
  - !ruby/object:Gem::Dependency
84
83
  name: rb-readline
85
84
  requirement: !ruby/object:Gem::Requirement
@@ -114,40 +113,40 @@ dependencies:
114
113
  requirements:
115
114
  - - "~>"
116
115
  - !ruby/object:Gem::Version
117
- version: '0.13'
116
+ version: '0.14'
118
117
  type: :runtime
119
118
  prerelease: false
120
119
  version_requirements: !ruby/object:Gem::Requirement
121
120
  requirements:
122
121
  - - "~>"
123
122
  - !ruby/object:Gem::Version
124
- version: '0.13'
123
+ version: '0.14'
125
124
  - !ruby/object:Gem::Dependency
126
125
  name: rdoc
127
126
  requirement: !ruby/object:Gem::Requirement
128
127
  requirements:
129
- - - "~>"
128
+ - - ">="
130
129
  - !ruby/object:Gem::Version
131
- version: '3.12'
130
+ version: '6.0'
132
131
  type: :development
133
132
  prerelease: false
134
133
  version_requirements: !ruby/object:Gem::Requirement
135
134
  requirements:
136
- - - "~>"
135
+ - - ">="
137
136
  - !ruby/object:Gem::Version
138
- version: '3.12'
137
+ version: '6.0'
139
138
  - !ruby/object:Gem::Dependency
140
139
  name: rspec
141
140
  requirement: !ruby/object:Gem::Requirement
142
141
  requirements:
143
- - - "~>"
142
+ - - ">="
144
143
  - !ruby/object:Gem::Version
145
144
  version: '3.6'
146
145
  type: :development
147
146
  prerelease: false
148
147
  version_requirements: !ruby/object:Gem::Requirement
149
148
  requirements:
150
- - - "~>"
149
+ - - ">="
151
150
  - !ruby/object:Gem::Version
152
151
  version: '3.6'
153
152
  description: A interactive command line tool for evaluating and debugging the puppet
@@ -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
@@ -315,15 +313,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
315
313
  requirements:
316
314
  - - ">="
317
315
  - !ruby/object:Gem::Version
318
- version: '2.4'
316
+ version: '2.7'
319
317
  required_rubygems_version: !ruby/object:Gem::Requirement
320
318
  requirements:
321
319
  - - ">="
322
320
  - !ruby/object:Gem::Version
323
321
  version: '0'
324
322
  requirements: []
325
- rubygems_version: 3.0.3
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: []