puppet-debugger 0.19.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitlab-ci.yml +10 -27
- data/.rubocop.yml +64 -232
- data/.rubocop_todo.yml +89 -147
- data/CHANGELOG.md +12 -1
- data/Gemfile +7 -5
- data/README.md +4 -5
- data/Rakefile +11 -12
- data/bin/pdb +1 -1
- data/lib/awesome_print/ext/awesome_puppet.rb +10 -8
- data/lib/plugins/puppet-debugger/input_responders/benchmark.rb +5 -4
- data/lib/plugins/puppet-debugger/input_responders/classes.rb +4 -1
- data/lib/plugins/puppet-debugger/input_responders/classification.rb +4 -2
- data/lib/plugins/puppet-debugger/input_responders/commands.rb +18 -18
- data/lib/plugins/puppet-debugger/input_responders/datatypes.rb +11 -5
- data/lib/plugins/puppet-debugger/input_responders/environment.rb +4 -2
- data/lib/plugins/puppet-debugger/input_responders/exit.rb +4 -2
- data/lib/plugins/puppet-debugger/input_responders/facterdb_filter.rb +4 -2
- data/lib/plugins/puppet-debugger/input_responders/facts.rb +4 -2
- data/lib/plugins/puppet-debugger/input_responders/functions.rb +34 -32
- data/lib/plugins/puppet-debugger/input_responders/help.rb +4 -2
- data/lib/plugins/puppet-debugger/input_responders/krt.rb +4 -2
- data/lib/plugins/puppet-debugger/input_responders/play.rb +22 -24
- data/lib/plugins/puppet-debugger/input_responders/reset.rb +5 -3
- data/lib/plugins/puppet-debugger/input_responders/resources.rb +5 -2
- data/lib/plugins/puppet-debugger/input_responders/set.rb +34 -32
- data/lib/plugins/puppet-debugger/input_responders/stacktrace.rb +23 -0
- data/lib/plugins/puppet-debugger/input_responders/types.rb +6 -2
- data/lib/plugins/puppet-debugger/input_responders/vars.rb +6 -5
- data/lib/plugins/puppet-debugger/input_responders/whereami.rb +5 -3
- data/lib/puppet-debugger/cli.rb +118 -91
- data/lib/puppet-debugger/code/code_file.rb +13 -14
- data/lib/puppet-debugger/code/code_range.rb +5 -3
- data/lib/puppet-debugger/code/loc.rb +1 -1
- data/lib/puppet-debugger/debugger_code.rb +2 -0
- data/lib/puppet-debugger/hooks.rb +15 -16
- data/lib/puppet-debugger/input_responder_plugin.rb +54 -52
- data/lib/puppet-debugger/monkey_patches.rb +4 -1
- data/lib/puppet-debugger/plugin_test_helper.rb +9 -8
- data/lib/puppet-debugger/support.rb +27 -17
- data/lib/puppet-debugger/support/environment.rb +4 -4
- data/lib/puppet-debugger/support/errors.rb +25 -27
- data/lib/puppet-debugger/support/facts.rb +5 -5
- data/lib/puppet-debugger/support/node.rb +4 -5
- data/lib/puppet-debugger/support/scope.rb +19 -17
- data/lib/puppet-debugger/trollop.rb +38 -31
- data/lib/puppet-debugger/version.rb +1 -1
- data/lib/puppet/application/debugger.rb +141 -135
- data/output.json +1 -0
- data/puppet-debugger.gemspec +17 -16
- data/spec/awesome_print/ext/awesome_puppet_spec.rb +30 -30
- data/spec/fixtures/sample_start_debugger.pp +3 -2
- data/spec/hooks_spec.rb +33 -35
- data/spec/input_responder_plugin_spec.rb +7 -6
- data/spec/input_responders/benchmark_spec.rb +3 -1
- data/spec/input_responders/classes_spec.rb +12 -10
- data/spec/input_responders/classification_spec.rb +4 -2
- data/spec/input_responders/commands_spec.rb +2 -0
- data/spec/input_responders/datatypes_spec.rb +4 -3
- data/spec/input_responders/environment_spec.rb +2 -0
- data/spec/input_responders/exit_spec.rb +9 -11
- data/spec/input_responders/facterdb_filter_spec.rb +2 -0
- data/spec/input_responders/facts_spec.rb +2 -0
- data/spec/input_responders/functions_spec.rb +30 -28
- data/spec/input_responders/help_spec.rb +4 -2
- data/spec/input_responders/krt_spec.rb +3 -1
- data/spec/input_responders/play_spec.rb +10 -20
- data/spec/input_responders/reset_spec.rb +2 -0
- data/spec/input_responders/resources_spec.rb +3 -1
- data/spec/input_responders/set_spec.rb +3 -1
- data/spec/input_responders/stacktrace_spec.rb +15 -0
- data/spec/input_responders/types_spec.rb +2 -0
- data/spec/input_responders/vars_spec.rb +4 -4
- data/spec/input_responders/whereami_spec.rb +2 -0
- data/spec/pdb_spec.rb +0 -9
- data/spec/puppet/application/debugger_spec.rb +18 -19
- data/spec/puppet_debugger_spec.rb +81 -84
- data/spec/remote_node_spec.rb +1 -5
- data/spec/spec_helper.rb +22 -18
- data/spec/support_spec.rb +3 -5
- data/test_matrix.rb +1 -1
- metadata +48 -31
data/spec/remote_node_spec.rb
CHANGED
@@ -41,7 +41,7 @@ describe 'PuppetDebugger' do
|
|
41
41
|
|
42
42
|
describe 'set' do
|
43
43
|
it 'sends message about resetting' do
|
44
|
-
expect(output.string).to eq("
|
44
|
+
expect(output.string).to eq(" => Resetting to use node puppetdev.localdomain\n")
|
45
45
|
end
|
46
46
|
|
47
47
|
it 'return node name' do
|
@@ -74,10 +74,6 @@ describe 'PuppetDebugger' do
|
|
74
74
|
let(:node_name) do
|
75
75
|
'invalid.localdomain'
|
76
76
|
end
|
77
|
-
# this test stopped working in the puppet 5.x series
|
78
|
-
xit 'name' do
|
79
|
-
expect { debugger.node.name }.to raise_error(PuppetDebugger::Exception::UndefinedNode)
|
80
|
-
end
|
81
77
|
end
|
82
78
|
|
83
79
|
it 'set node name' do
|
data/spec/spec_helper.rb
CHANGED
@@ -1,25 +1,30 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'simplecov'
|
4
3
|
require_relative '../lib/puppet-debugger'
|
5
4
|
require 'yaml'
|
6
|
-
ENV['
|
5
|
+
ENV['CI'] = 'true'
|
7
6
|
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
if ENV['COVERAGE']
|
8
|
+
require 'simplecov'
|
9
|
+
|
10
|
+
module SimpleCov::Configuration
|
11
|
+
def clean_filters
|
12
|
+
@filters = []
|
13
|
+
end
|
11
14
|
end
|
12
|
-
end
|
13
15
|
|
14
|
-
SimpleCov.configure do
|
15
|
-
|
16
|
-
|
17
|
-
end
|
16
|
+
SimpleCov.configure do
|
17
|
+
clean_filters
|
18
|
+
load_profile 'test_frameworks'
|
19
|
+
end
|
18
20
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
21
|
+
if ENV['COVERAGE']
|
22
|
+
SimpleCov.start do
|
23
|
+
add_filter '/.rvm/'
|
24
|
+
add_filter 'vendor'
|
25
|
+
add_filter 'bundler'
|
26
|
+
end
|
27
|
+
end
|
23
28
|
end
|
24
29
|
|
25
30
|
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
@@ -30,17 +35,17 @@ require 'puppet-debugger'
|
|
30
35
|
ENV['REPL_FACTERDB_FILTER'] = 'operatingsystem=Fedora and operatingsystemrelease=23 and architecture=x86_64 and facterversion=/^2\\.4/'
|
31
36
|
# Requires supporting files with custom matchers and macros, etc,
|
32
37
|
# in ./support/ and its subdirectories.
|
33
|
-
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
38
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].sort.each { |f| require f }
|
34
39
|
|
35
40
|
def stdlib_path
|
36
41
|
File.join(Puppet[:basemodulepath].split(':').first, 'stdlib')
|
37
42
|
end
|
38
43
|
|
39
44
|
def install_stdlib
|
40
|
-
`bundle exec puppet module install puppetlabs/stdlib` unless File.
|
45
|
+
`bundle exec puppet module install puppetlabs/stdlib` unless File.exist?(stdlib_path)
|
41
46
|
end
|
42
47
|
|
43
|
-
#install_stdlib
|
48
|
+
# install_stdlib
|
44
49
|
|
45
50
|
def fixtures_dir
|
46
51
|
File.join(File.dirname(__FILE__), 'fixtures')
|
@@ -62,7 +67,6 @@ def supports_datatypes?
|
|
62
67
|
Gem::Version.new(Puppet.version) >= Gem::Version.new('4.5')
|
63
68
|
end
|
64
69
|
|
65
|
-
|
66
70
|
RSpec.configure do |config|
|
67
71
|
config.filter_run_excluding native_functions: !supports_native_functions?
|
68
72
|
RSpec::Expectations.configuration.on_potential_false_positives = :nothing
|
data/spec/support_spec.rb
CHANGED
@@ -21,19 +21,19 @@ describe 'support' do
|
|
21
21
|
end
|
22
22
|
|
23
23
|
let(:manifest_file) do
|
24
|
-
|
24
|
+
File.open('/tmp/debugger_puppet_manifest.pp', 'w') do |f|
|
25
25
|
f.write(manifest_code)
|
26
26
|
end
|
27
27
|
'/tmp/debugger_puppet_manifest.pp'
|
28
28
|
end
|
29
29
|
|
30
30
|
let(:manifest_code) do
|
31
|
-
<<-
|
31
|
+
<<-OUT
|
32
32
|
file{'/tmp/test.txt': ensure => absent } \n
|
33
33
|
notify{'hello_there':} \n
|
34
34
|
service{'httpd': ensure => running}\n
|
35
35
|
|
36
|
-
|
36
|
+
OUT
|
37
37
|
end
|
38
38
|
|
39
39
|
after(:each) do
|
@@ -61,6 +61,4 @@ describe 'support' do
|
|
61
61
|
expect(debugger.node.facts.values).to be_instance_of(Hash)
|
62
62
|
expect(debugger.node.facts.values['fqdn']).to eq('foo.example.com')
|
63
63
|
end
|
64
|
-
|
65
|
-
|
66
64
|
end
|
data/test_matrix.rb
CHANGED
metadata
CHANGED
@@ -1,113 +1,127 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppet-debugger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Corey Osman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-08-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: awesome_print
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.
|
19
|
+
version: '1.7'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.
|
26
|
+
version: '1.7'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: facterdb
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.
|
47
|
+
version: 0.4.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.
|
54
|
+
version: 0.4.0
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: pluginator
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 1.5.0
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 1.5.0
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: puppet
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
58
72
|
requirements:
|
59
73
|
- - ">="
|
60
74
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
75
|
+
version: '5.5'
|
62
76
|
type: :runtime
|
63
77
|
prerelease: false
|
64
78
|
version_requirements: !ruby/object:Gem::Requirement
|
65
79
|
requirements:
|
66
80
|
- - ">="
|
67
81
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
82
|
+
version: '5.5'
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
84
|
+
name: rb-readline
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
72
86
|
requirements:
|
73
87
|
- - ">="
|
74
88
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.
|
89
|
+
version: 0.5.5
|
76
90
|
type: :runtime
|
77
91
|
prerelease: false
|
78
92
|
version_requirements: !ruby/object:Gem::Requirement
|
79
93
|
requirements:
|
80
94
|
- - ">="
|
81
95
|
- !ruby/object:Gem::Version
|
82
|
-
version: 0.
|
96
|
+
version: 0.5.5
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
98
|
+
name: table_print
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
86
100
|
requirements:
|
87
|
-
- - "
|
101
|
+
- - ">="
|
88
102
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
103
|
+
version: 1.0.0
|
90
104
|
type: :runtime
|
91
105
|
prerelease: false
|
92
106
|
version_requirements: !ruby/object:Gem::Requirement
|
93
107
|
requirements:
|
94
|
-
- - "
|
108
|
+
- - ">="
|
95
109
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
110
|
+
version: 1.0.0
|
97
111
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
112
|
+
name: tty-pager
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
100
114
|
requirements:
|
101
|
-
- - "
|
115
|
+
- - "~>"
|
102
116
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
117
|
+
version: 0.13.0
|
104
118
|
type: :runtime
|
105
119
|
prerelease: false
|
106
120
|
version_requirements: !ruby/object:Gem::Requirement
|
107
121
|
requirements:
|
108
|
-
- - "
|
122
|
+
- - "~>"
|
109
123
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
124
|
+
version: 0.13.0
|
111
125
|
- !ruby/object:Gem::Dependency
|
112
126
|
name: rdoc
|
113
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -184,6 +198,7 @@ files:
|
|
184
198
|
- lib/plugins/puppet-debugger/input_responders/reset.rb
|
185
199
|
- lib/plugins/puppet-debugger/input_responders/resources.rb
|
186
200
|
- lib/plugins/puppet-debugger/input_responders/set.rb
|
201
|
+
- lib/plugins/puppet-debugger/input_responders/stacktrace.rb
|
187
202
|
- lib/plugins/puppet-debugger/input_responders/types.rb
|
188
203
|
- lib/plugins/puppet-debugger/input_responders/vars.rb
|
189
204
|
- lib/plugins/puppet-debugger/input_responders/whereami.rb
|
@@ -208,6 +223,7 @@ files:
|
|
208
223
|
- lib/puppet-debugger/trollop.rb
|
209
224
|
- lib/puppet-debugger/version.rb
|
210
225
|
- lib/puppet/application/debugger.rb
|
226
|
+
- output.json
|
211
227
|
- puppet-debugger.gemspec
|
212
228
|
- run_container_test.sh
|
213
229
|
- spec/awesome_print/ext/awesome_puppet_spec.rb
|
@@ -275,6 +291,7 @@ files:
|
|
275
291
|
- spec/input_responders/reset_spec.rb
|
276
292
|
- spec/input_responders/resources_spec.rb
|
277
293
|
- spec/input_responders/set_spec.rb
|
294
|
+
- spec/input_responders/stacktrace_spec.rb
|
278
295
|
- spec/input_responders/types_spec.rb
|
279
296
|
- spec/input_responders/vars_spec.rb
|
280
297
|
- spec/input_responders/whereami_spec.rb
|
@@ -298,7 +315,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
298
315
|
requirements:
|
299
316
|
- - ">="
|
300
317
|
- !ruby/object:Gem::Version
|
301
|
-
version: '2.
|
318
|
+
version: '2.4'
|
302
319
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
303
320
|
requirements:
|
304
321
|
- - ">="
|