pry-byebug 3.6.0 → 3.9.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: de411ccdb95cec93b9878ef090fe3febbe16976441a214811b669eabdf7f5e1e
4
- data.tar.gz: a582767d71b7de5af71cdfbe7709de2ab4a06f577eda5648ecda5522829ea120
3
+ metadata.gz: 5a9be5ab97e10c1247774626e9dee655956d904dfcbdb0e601af7eabcee668a4
4
+ data.tar.gz: a151143361a89b102f85102c95c7b86a4743413822e69fefcf67087a93cd29cf
5
5
  SHA512:
6
- metadata.gz: 49e9fc633e175d2752e1453e79b3b2ec987604375528fd606b8a8c681e7264689a229072e498607e33d1bf1348c5f2daffcfa25233692c9d28b75e5a1339ef87
7
- data.tar.gz: db5efdc17be1e2b6c0e62a15e5935e9dbf156724859b3542104ddecaa9af96c99ba02caf730c68194d97479e313be434528c65ca005148da59555f6f365849c5
6
+ metadata.gz: 75a234974314f675ba12d4c435897541c40e63b67807f03239665c31f6ecef9b06a3456ba9d577b9d255e0b59efd55b9486280884c788519a63e783920226a7d
7
+ data.tar.gz: bc5e1fcc9a82f7ed703d9b9e6272e8f8026300398e4f9265f3e72e9d84d066fa861492ee2e7a6a35c91345444160bdf39bab957c6b638d9b33ab735059b722c9
data/CHANGELOG.md CHANGED
@@ -2,6 +2,35 @@
2
2
 
3
3
  ## Master (Unreleased)
4
4
 
5
+ ## 3.9.0 (2020-03-21)
6
+
7
+ ### Fixed
8
+
9
+ * Dependency on pry being too loose. Now breaking minor releases of pry won't affect pry-byebug users (#289).
10
+
11
+ ### Added
12
+
13
+ * Support for pry 0.13.0 (#266).
14
+
15
+ ### Removed
16
+
17
+ * Support for pry older than 0.13.0 (#289).
18
+
19
+ ## 3.8.0 (2020-01-22)
20
+
21
+ ### Fixed
22
+
23
+ * Use `Binding#source_location` instead of evaluating `__FILE__` to avoid
24
+ warnings on Ruby 2.7 and on Ruby 2.6 in verbose mode (#221).
25
+
26
+ ### Removed
27
+
28
+ * Support for Ruby 2.3. Pry-byebug no longer installs on this platform.
29
+
30
+ ## 3.7.0 (2019-02-21)
31
+
32
+ * Byebug 11 compatibility, with ruby 2.6 support.
33
+
5
34
  ## 3.6.0 (2018-02-07)
6
35
 
7
36
  ### Added
@@ -12,7 +41,7 @@
12
41
 
13
42
  ### Fixed
14
43
 
15
- * Allow other threads like Pry. (#142)
44
+ * Allow other threads like Pry (#142).
16
45
 
17
46
  ## 3.5.0 (2017-08-23)
18
47
 
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
- MIT/Expat License
1
+ MIT License
2
2
 
3
- Copyright (c) David Rodríguez <deivid.rodriguez@gmail.com>
3
+ Copyright (c) 2018 David Rodríguez <deivid.rodriguez@riseup.net>
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy of
6
6
  this software and associated documentation files (the "Software"), to deal in
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # pry-byebug
2
2
 
3
3
  [![Version][VersionBadge]][VersionURL]
4
- [![Build][TravisBadge]][TravisURL]
4
+ [![Build][CIBadge]][CIURL]
5
5
  [![Inline docs][InchCIBadge]][InchCIURL]
6
6
  [![Coverage][CoverageBadge]][CoverageURL]
7
7
 
@@ -23,9 +23,7 @@ puts 'Goodbye World' # Run 'next' in the console to move here.
23
23
 
24
24
  ## Requirements
25
25
 
26
- * Required: MRI 2.2.0 or higher.
27
-
28
- * Recommended: MRI 2.3.0 or higher.
26
+ MRI 2.4.0 or higher.
29
27
 
30
28
  ## Installation
31
29
 
@@ -37,7 +35,9 @@ gem 'pry-byebug'
37
35
 
38
36
  to your Gemfile and run
39
37
 
40
- bundle install
38
+ ```console
39
+ bundle install
40
+ ```
41
41
 
42
42
  Make sure you include the gem globally or inside the `:test` group if you plan
43
43
  to use it to debug your tests!
@@ -149,14 +149,23 @@ mentioned here if they are present in your Gemfile.
149
149
 
150
150
  See [Getting Started with Development](CONTRIBUTING.md).
151
151
 
152
- You can also help `pry-byebug` by leaving a small (or big) tip through
153
- [Liberapay][liberapay.com].
152
+ ## Funding
153
+
154
+ Subscribe to [Tidelift] to ensure pry-byebug stays actively maintained, and at
155
+ the same time get licensing assurances and timely security notifications for
156
+ your open source dependencies.
157
+
158
+ You can also help `pry-byebug` by leaving a small (or big) tip through [Liberapay].
159
+
160
+ [Tidelift]: https://tidelift.com/subscription/pkg/rubygems-pry-byebug?utm_source=rubygems-pry-byebug&utm_medium=referral&utm_campaign=readme
161
+ [Liberapay]: https://liberapay.com/pry-byebug/donate
162
+
163
+ ## Security contact information
154
164
 
155
- [![Support via Liberapay][liberapay-button]][liberapay-donate]
165
+ Please use the Tidelift security contact to [report a security vulnerability].
166
+ Tidelift will coordinate the fix and disclosure.
156
167
 
157
- [liberapay.com]: https://liberapay.com
158
- [liberapay-button]: https://liberapay.com/assets/widgets/donate.svg
159
- [liberapay-donate]: https://liberapay.com/pry-byebug/donate
168
+ [report a security vulnerability]: https://tidelift.com/security
160
169
 
161
170
  ## Credits
162
171
 
@@ -175,9 +184,9 @@ Patches and bug reports are welcome.
175
184
 
176
185
  [VersionBadge]: https://badge.fury.io/rb/pry-byebug.svg
177
186
  [VersionURL]: http://badge.fury.io/rb/pry-byebug
178
- [TravisBadge]: https://secure.travis-ci.org/deivid-rodriguez/pry-byebug.svg
179
- [TravisURL]: http://travis-ci.org/deivid-rodriguez/pry-byebug
187
+ [CIBadge]: https://github.com/deivid-rodriguez/pry-byebug/workflows/ubuntu/badge.svg?branch=master
188
+ [CIURL]: https://github.com/deivid-rodriguez/pry-byebug/actions?query=workflow%3Aubuntu
180
189
  [InchCIBadge]: http://inch-ci.org/github/deivid-rodriguez/pry-byebug.svg?branch=master
181
190
  [InchCIURL]: http://inch-ci.org/github/deivid-rodriguez/pry-byebug
182
- [CoverageBadge]: https://img.shields.io/codeclimate/coverage/github/deivid-rodriguez/pry-byebug.svg
183
- [CoverageURL]: https://codeclimate.com/github/deivid-rodriguez/pry-byebug
191
+ [CoverageBadge]: https://api.codeclimate.com/v1/badges/a88e27809329c03af017/test_coverage
192
+ [CoverageURL]: https://codeclimate.com/github/deivid-rodriguez/pry-byebug/test_coverage
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "byebug/core"
2
4
 
3
5
  module Byebug
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class Pry
2
4
  module Byebug
3
5
  #
@@ -61,6 +63,7 @@ class Pry
61
63
  def add_file(file, line, expression = nil)
62
64
  real_file = (file != Pry.eval_path)
63
65
  raise(ArgumentError, "Invalid file!") if real_file && !File.exist?(file)
66
+
64
67
  validate_expression expression
65
68
 
66
69
  path = (real_file ? File.expand_path(file) : file)
@@ -85,7 +88,6 @@ class Pry
85
88
  #
86
89
  def delete(id)
87
90
  deleted =
88
- ::Byebug.started? &&
89
91
  ::Byebug::Breakpoint.remove(id) &&
90
92
  breakpoints.delete(find_by_id(id))
91
93
 
@@ -97,7 +99,7 @@ class Pry
97
99
  #
98
100
  def delete_all
99
101
  @breakpoints = []
100
- ::Byebug.breakpoints.clear if ::Byebug.started?
102
+ ::Byebug.breakpoints.clear
101
103
  end
102
104
 
103
105
  #
@@ -142,6 +144,7 @@ class Pry
142
144
  def find_by_id(id)
143
145
  breakpoint = find { |b| b.id == id }
144
146
  raise(ArgumentError, "No breakpoint ##{id}!") unless breakpoint
147
+
145
148
  breakpoint
146
149
  end
147
150
 
@@ -1,25 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "pry-byebug/helpers/location"
4
+
1
5
  #
2
6
  # Main container module for Pry-Byebug functionality
3
7
  #
4
8
  module PryByebug
9
+ # Reference to currently running pry-remote server. Used by the processor.
10
+ attr_accessor :current_remote_server
11
+
12
+ module_function
13
+
5
14
  #
6
15
  # Checks that a target binding is in a local file context.
7
16
  #
8
17
  def file_context?(target)
9
- file = target.eval("__FILE__")
18
+ file = Helpers::Location.current_file(target)
10
19
  file == Pry.eval_path || !Pry::Helpers::BaseHelpers.not_a_real_file?(file)
11
20
  end
12
- module_function :file_context?
13
21
 
14
22
  #
15
23
  # Ensures that a command is executed in a local file context.
16
24
  #
17
- def check_file_context(target, e = nil)
18
- e ||= "Cannot find local context. Did you use `binding.pry`?"
19
- raise(Pry::CommandError, e) unless file_context?(target)
25
+ def check_file_context(target, msg = nil)
26
+ msg ||= "Cannot find local context. Did you use `binding.pry`?"
27
+ raise(Pry::CommandError, msg) unless file_context?(target)
20
28
  end
21
- module_function :check_file_context
22
-
23
- # Reference to currently running pry-remote server. Used by the processor.
24
- attr_accessor :current_remote_server
25
29
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "pry-byebug/base"
2
4
  require "pry-byebug/pry_ext"
3
5
  require "pry-byebug/commands"
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "pry-byebug/helpers/navigation"
2
4
 
3
5
  module PryByebug
@@ -1,5 +1,8 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "pry/byebug/breakpoints"
2
4
  require "pry-byebug/helpers/breakpoints"
5
+ require "pry-byebug/helpers/location"
3
6
  require "pry-byebug/helpers/multiline"
4
7
 
5
8
  module PryByebug
@@ -8,6 +11,7 @@ module PryByebug
8
11
  #
9
12
  class BreakCommand < Pry::ClassCommand
10
13
  include Helpers::Breakpoints
14
+ include Helpers::Location
11
15
  include Helpers::Multiline
12
16
 
13
17
  match "break"
@@ -1,5 +1,8 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "pry-byebug/helpers/navigation"
2
4
  require "pry-byebug/helpers/breakpoints"
5
+ require "pry-byebug/helpers/location"
3
6
 
4
7
  module PryByebug
5
8
  #
@@ -8,6 +11,7 @@ module PryByebug
8
11
  class ContinueCommand < Pry::ClassCommand
9
12
  include Helpers::Navigation
10
13
  include Helpers::Breakpoints
14
+ include Helpers::Location
11
15
 
12
16
  match "continue"
13
17
  group "Byebug"
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "pry-byebug/helpers/navigation"
2
4
 
3
5
  module PryByebug
@@ -1,3 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "pry/commands/exit_all"
4
+
1
5
  module PryByebug
2
6
  #
3
7
  # Exit pry REPL with Byebug.stop
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "pry-byebug/helpers/navigation"
2
4
 
3
5
  module PryByebug
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "pry-byebug/helpers/navigation"
2
4
 
3
5
  module PryByebug
@@ -20,7 +22,7 @@ module PryByebug
20
22
  Examples:
21
23
  frame #=> Show current frame #.
22
24
  frame 5 #=> Move to frame 5.
23
- BANNER
25
+ BANNER
24
26
 
25
27
  def process
26
28
  PryByebug.check_file_context(target)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "pry-byebug/helpers/navigation"
2
4
  require "pry-byebug/helpers/multiline"
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "pry-byebug/helpers/navigation"
2
4
 
3
5
  module PryByebug
@@ -19,7 +21,7 @@ module PryByebug
19
21
  Examples:
20
22
  step #=> Move a single step forward.
21
23
  step 5 #=> Execute the next 5 steps.
22
- BANNER
24
+ BANNER
23
25
 
24
26
  def process
25
27
  PryByebug.check_file_context(target)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "pry-byebug/helpers/navigation"
2
4
 
3
5
  module PryByebug
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "pry-byebug/commands/backtrace"
2
4
  require "pry-byebug/commands/next"
3
5
  require "pry-byebug/commands/step"
@@ -1,7 +1,9 @@
1
+ # frozen_string_literal: true
2
+
1
3
  original_handler = Pry.config.control_d_handler
2
4
 
3
- Pry.config.control_d_handler = proc do |eval_string, pry_instance|
5
+ Pry.config.control_d_handler = proc do |pry_instance|
4
6
  Byebug.stop if Byebug.stoppable?
5
7
 
6
- original_handler.call(eval_string, pry_instance)
8
+ original_handler.call(pry_instance)
7
9
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "byebug"
2
4
 
3
5
  module PryByebug
@@ -13,19 +15,11 @@ module PryByebug
13
15
  Pry::Byebug::Breakpoints
14
16
  end
15
17
 
16
- #
17
- # Current file in the target binding. Used as the default breakpoint
18
- # location.
19
- #
20
- def current_file
21
- target.eval("__FILE__")
22
- end
23
-
24
18
  #
25
19
  # Prints a message with bold font.
26
20
  #
27
21
  def bold_puts(msg)
28
- output.puts(text.bold(msg))
22
+ output.puts(bold(msg))
29
23
  end
30
24
 
31
25
  #
@@ -33,15 +27,19 @@ module PryByebug
33
27
  #
34
28
  # Includes surrounding code at that point.
35
29
  #
36
- def print_full_breakpoint(br)
37
- header = "Breakpoint #{br.id}:"
38
- status = br.enabled? ? "Enabled" : "Disabled"
39
- code = br.source_code.with_line_numbers.to_s
40
- condition = br.expr ? "#{text.bold('Condition:')} #{br.expr}\n" : ""
30
+ def print_full_breakpoint(breakpoint)
31
+ header = "Breakpoint #{breakpoint.id}:"
32
+ status = breakpoint.enabled? ? "Enabled" : "Disabled"
33
+ code = breakpoint.source_code.with_line_numbers.to_s
34
+ condition = if breakpoint.expr
35
+ "#{bold('Condition:')} #{breakpoint.expr}\n"
36
+ else
37
+ ""
38
+ end
41
39
 
42
40
  output.puts <<-BREAKPOINT.gsub(/ {8}/, "")
43
41
 
44
- #{text.bold(header)} #{br} (#{status}) #{condition}
42
+ #{bold(header)} #{breakpoint} (#{status}) #{condition}
45
43
 
46
44
  #{code}
47
45
 
@@ -67,8 +65,8 @@ module PryByebug
67
65
 
68
66
  output.puts <<-BREAKPOINTS.gsub(/ {8}/, "")
69
67
 
70
- #{text.bold(header)}
71
- #{text.bold('-' * header.size)}
68
+ #{bold(header)}
69
+ #{bold('-' * header.size)}
72
70
 
73
71
  BREAKPOINTS
74
72
  end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module PryByebug
4
+ module Helpers
5
+ #
6
+ # Compatibility helper to handle source location
7
+ #
8
+ module Location
9
+ module_function
10
+
11
+ #
12
+ # Current file in the target binding. Used as the default breakpoint
13
+ # location.
14
+ #
15
+ def current_file(source = target)
16
+ # Guard clause for Ruby >= 2.6 providing now Binding#source_location ...
17
+ return source.source_location[0] if source.respond_to?(:source_location)
18
+
19
+ # ... to avoid warning: 'eval may not return location in binding'
20
+ source.eval("__FILE__")
21
+ end
22
+ end
23
+ end
24
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module PryByebug
2
4
  module Helpers
3
5
  #
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module PryByebug
2
4
  module Helpers
3
5
  #
@@ -8,9 +10,9 @@ module PryByebug
8
10
  # Breaks out of the REPL loop and signals tracer
9
11
  #
10
12
  def breakout_navigation(action, options = {})
11
- _pry_.binding_stack.clear
13
+ pry_instance.binding_stack.clear
12
14
 
13
- throw :breakout_nav, action: action, options: options, pry: _pry_
15
+ throw :breakout_nav, action: action, options: options, pry: pry_instance
14
16
  end
15
17
  end
16
18
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "byebug/processors/pry_processor"
2
4
 
3
5
  class << Pry
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "pry-remote"
2
4
 
3
5
  module PryRemote
@@ -38,5 +40,5 @@ end
38
40
  # 'next' on the last line of a program won't hit Byebug::PryProcessor#run,
39
41
  # which normally handles cleanup.
40
42
  at_exit do
41
- PryByebug.current_remote_server.teardown if PryByebug.current_remote_server
43
+ PryByebug.current_remote_server&.teardown
42
44
  end
@@ -1,6 +1,8 @@
1
+ # frozen_string_literal: true
2
+
1
3
  #
2
4
  # Main container module for Pry-Byebug functionality
3
5
  #
4
6
  module PryByebug
5
- VERSION = "3.6.0".freeze
7
+ VERSION = "3.9.0"
6
8
  end
data/lib/pry-byebug.rb CHANGED
@@ -1,2 +1,4 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "pry"
2
4
  require "pry-byebug/cli"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pry-byebug
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.6.0
4
+ version: 3.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Rodríguez
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-02-07 00:00:00.000000000 Z
12
+ date: 2020-03-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: byebug
@@ -17,28 +17,28 @@ dependencies:
17
17
  requirements:
18
18
  - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: '10.0'
20
+ version: '11.0'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - "~>"
26
26
  - !ruby/object:Gem::Version
27
- version: '10.0'
27
+ version: '11.0'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: pry
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
32
  - - "~>"
33
33
  - !ruby/object:Gem::Version
34
- version: '0.10'
34
+ version: 0.13.0
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - "~>"
40
40
  - !ruby/object:Gem::Version
41
- version: '0.10'
41
+ version: 0.13.0
42
42
  description: |-
43
43
  Combine 'pry' with 'byebug'. Adds 'step', 'next', 'finish',
44
44
  'continue' and 'break' commands to control execution.
@@ -69,6 +69,7 @@ files:
69
69
  - lib/pry-byebug/commands/up.rb
70
70
  - lib/pry-byebug/control_d_handler.rb
71
71
  - lib/pry-byebug/helpers/breakpoints.rb
72
+ - lib/pry-byebug/helpers/location.rb
72
73
  - lib/pry-byebug/helpers/multiline.rb
73
74
  - lib/pry-byebug/helpers/navigation.rb
74
75
  - lib/pry-byebug/pry_ext.rb
@@ -87,15 +88,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
87
88
  requirements:
88
89
  - - ">="
89
90
  - !ruby/object:Gem::Version
90
- version: 2.2.0
91
+ version: 2.4.0
91
92
  required_rubygems_version: !ruby/object:Gem::Requirement
92
93
  requirements:
93
94
  - - ">="
94
95
  - !ruby/object:Gem::Version
95
96
  version: '0'
96
97
  requirements: []
97
- rubyforge_project:
98
- rubygems_version: 2.7.4
98
+ rubygems_version: 3.2.0.pre1
99
99
  signing_key:
100
100
  specification_version: 4
101
101
  summary: Fast debugging with Pry.