puppet-debugger 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b0845f8505468609c82c613211f0c59d6c209782b6298a3828d1f6458fe7196e
4
- data.tar.gz: a312b6f8a6268086dde82cf69698227fb510383934e53c19d61133526b750c02
3
+ metadata.gz: b42685da91441b7bff1494b4be01e91ebfb9e5e291e1483c129fff536fd2c75c
4
+ data.tar.gz: 3746ddb94008917e9394800a2c1553986128af574f68368865d509e0b9d60343
5
5
  SHA512:
6
- metadata.gz: 88c8428a4d75371639f614391b4ed71881c03a4a961b79a9ba413313ab7f6f1968e17da42fffdfb795da467b8ec6ef41ab3b3425d7a924e4e698cbcd51774166
7
- data.tar.gz: 13dddc3c84e90cb2c873d60d400546109c0020eda7c913741ba874d19d23f8e0e88c682ddcf7f4dc84612f8468add43315698cd888e68380609e3226d10f96dd
6
+ metadata.gz: 04dccda493638a6834d285edc4d79d4871181349ef9e57bfabe6ff8106bc2c371a1ab9ae76e052aca90c8cc1a3cdf76b7f6b3813f54931f9e3b363acfd3e94cf
7
+ data.tar.gz: d60dd7a5fd14c6258a2a1c85612f3475e1b72081c0c1e9c6ca5cd3c777fd764caedacf18082abd0b2c5a5b863f78960e016f4086fc3e3b1ae3e23bf2a1f3b905
data/CHANGELOG.md CHANGED
@@ -1,7 +1,13 @@
1
+ # Puppet Debugger Changelog
2
+
3
+ ## Unreleased
4
+
5
+ ## 1.1
6
+ - Catch signals and allow control-d for quitting.
1
7
  ## 1.0
2
8
  Released: 8/3/2020
3
9
 
4
- This is a major revision with breaking changes, notibly the requirement of ruby 2.4 and puppet 5.5.
10
+ This is a major revision with breaking changes, notably the requirement of ruby 2.4 and puppet 5.5.
5
11
 
6
12
  - Bump required ruby version to 2.4
7
13
  - Bump required puppet version to puppet 5.5
@@ -9,7 +15,7 @@ This is a major revision with breaking changes, notibly the requirement of ruby
9
15
  - Add a pager for long output
10
16
  - Remove puppet4 and older work arounds
11
17
  - Use rubocop for better code quality
12
- - Fix issue when the debugger was not loading the manfiest properely
18
+ - Fix issue when the debugger was not loading the manifest properly
13
19
 
14
20
  ## 0.19.0
15
21
  - Search datatypes with filter
@@ -5,7 +5,7 @@ module PuppetDebugger
5
5
  module InputResponders
6
6
  class Exit < InputResponderPlugin
7
7
  COMMAND_WORDS = %w[exit].freeze
8
- SUMMARY = 'Quit Puppet Debugger.'
8
+ SUMMARY = 'Quit Puppet Debugger, or use control-d'
9
9
  COMMAND_GROUP = :help
10
10
 
11
11
  def run(_args = [])
@@ -14,9 +14,17 @@ module PuppetDebugger
14
14
  s.empty? ? 'stacktrace not available'.warning : s.ai
15
15
  end
16
16
 
17
- # @return [Array] - an array of files
17
+ # @return [Array] - an array of files with line numbers
18
+ # @example
19
+ # [
20
+ # "/nwops/puppetlabs-peadm/spec/fixtures/modules/peadm/plans/status.pp:23",
21
+ # "/nwops/puppetlabs-peadm/spec/fixtures/modules/peadm/plans/status.pp:20"
22
+ # ]
18
23
  def stacktrace
19
- Puppet::Pops::PuppetStack.stacktrace.find_all { |line| !line.include?('unknown') }
24
+ stack = Puppet::Pops::PuppetStack.stacktrace.find_all { |line| !line.include?('unknown') }
25
+ stack.each_with_object([]) do |item, acc|
26
+ acc << item.join(':')
27
+ end
20
28
  end
21
29
  end
22
30
  end
@@ -42,6 +42,15 @@ module PuppetDebugger
42
42
  sort_keys: true,
43
43
  indent: 2
44
44
  }
45
+ # Catch control-c sequences
46
+ trap('SIGINT') do
47
+ # control-d
48
+ exit 0
49
+ end
50
+ trap('INT') do
51
+ # control-c
52
+ # handle_output('Type exit or use control-d')
53
+ end
45
54
  end
46
55
 
47
56
  # @return [Proc] the proc used in the command completion for readline
@@ -145,7 +154,8 @@ module PuppetDebugger
145
154
  # Disabled if CI or testing is being done
146
155
  def handle_output(output)
147
156
  return if output.nil?
148
- if pager_enabled? && output.lines.count >= TTY::Screen.height
157
+
158
+ if pager_enabled? && output.lines.count >= TTY::Screen.height
149
159
  output << "\n"
150
160
  pager.page(output)
151
161
  else
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PuppetDebugger
4
- VERSION = '1.0.0'
4
+ VERSION = '1.1.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet-debugger
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Corey Osman
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-03 00:00:00.000000000 Z
11
+ date: 2021-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: awesome_print
@@ -307,7 +307,7 @@ licenses:
307
307
  - MIT
308
308
  metadata:
309
309
  allowed_push_host: https://rubygems.org
310
- post_install_message:
310
+ post_install_message:
311
311
  rdoc_options: []
312
312
  require_paths:
313
313
  - lib
@@ -323,7 +323,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
323
323
  version: '0'
324
324
  requirements: []
325
325
  rubygems_version: 3.0.3
326
- signing_key:
326
+ signing_key:
327
327
  specification_version: 4
328
328
  summary: A repl based debugger for the puppet language
329
329
  test_files: []