Skip to content

Commit bf46576

Browse files
authored
Merge pull request #49 from joallard/proposed-v0-5-0
Fixes for Ruby 2.6/2.7 and Pry 0.13
2 parents 02d18dc + 2d8df86 commit bf46576

File tree

12 files changed

+43
-44
lines changed

12 files changed

+43
-44
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ Makefile
55
doc/
66
pkg/
77
.yardoc/
8+
Gemfile.lock

.travis.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,8 @@ before_install:
77
- gem update --system
88

99
rvm:
10-
- 1.9.3
11-
- 2.0
12-
- 2.1.10
13-
- 2.2.9
14-
- 2.3.6
15-
- 2.4.3
16-
- 2.5.0
10+
- 2.6.6
11+
- 2.7.1
1712
- ruby-head
1813

1914
matrix:

CHANGELOG

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
## v0.5.0 (X May 2020)
2+
* Should fix most deprecation warnings as of release
3+
* Require Pry 0.13
4+
* Fix Pry#_pry_ => #pry_instance deprecation
5+
6+
## v0.4.10 (X May 2020)
7+
* Require Ruby 2.6
8+
* Fix broken `show-stack` in Pry 0.13+
9+
* Fix Binding.source_location deprecations

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
source :rubygems
1+
source 'https://rubygems.org'
22
gemspec

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ After installing `pry-stack_explorer`, just start Pry as normal (typically via a
3333

3434
Example:
3535
--------
36-
Here we run the following ruby script:
36+
Here we run the following ruby script:
3737
```Ruby
3838
require 'pry-stack_explorer'
3939

@@ -62,6 +62,13 @@ Limitations
6262
* First release, so may have teething problems.
6363
* Limited to Rubinius, and MRI 1.9.2+ at this stage.
6464

65+
Compatible versions
66+
-------------------
67+
* v0.5: Ruby 2.6+, Pry 0.13+
68+
* v0.4.10: Ruby 2.6+, Pry 0.12+
69+
* v0.4.9.3: Ruby 2.5 and older
70+
71+
6572
Contact
6673
-------
6774

Rakefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ end
3333

3434
desc "run pry with plugin enabled"
3535
task :pry do
36-
exec("pry -rubygems -I#{direc}/lib/ -r #{direc}/lib/#{PROJECT_NAME}")
36+
exec("pry -I#{direc}/lib/ -r #{direc}/lib/#{PROJECT_NAME}")
3737
end
3838

3939
desc "Run example"
4040
task :example do
41-
sh "ruby -rubygems -I#{direc}/lib/ #{direc}/examples/example.rb "
41+
sh "ruby -I#{direc}/lib/ #{direc}/examples/example.rb "
4242
end
4343

4444
desc "Run example2"
@@ -61,7 +61,7 @@ task :default => :test
6161

6262
desc "run tests"
6363
task :test do
64-
sh "bacon -Itest -rubygems -a -q"
64+
sh "bacon -Itest -a -q"
6565
end
6666

6767
desc "generate gemspec"

lib/pry-stack_explorer.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,9 @@ def bindings_equal?(b1, b2)
127127
# monkey-patch the whereami command to show some frame information,
128128
# useful for navigating stack.
129129
Pry.config.hooks.add_hook(:before_whereami, :stack_explorer) do
130-
if PryStackExplorer.frame_manager(_pry_) && !internal_binding?(target)
131-
bindings = PryStackExplorer.frame_manager(_pry_).bindings
132-
binding_index = PryStackExplorer.frame_manager(_pry_).binding_index
130+
if PryStackExplorer.frame_manager(pry_instance) && !internal_binding?(target)
131+
bindings = PryStackExplorer.frame_manager(pry_instance).bindings
132+
binding_index = PryStackExplorer.frame_manager(pry_instance).binding_index
133133

134134
output.puts "\n"
135135
output.puts "#{Pry::Helpers::Text.bold('Frame number:')} #{binding_index}/#{bindings.size - 1}"

lib/pry-stack_explorer/commands.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ module FrameHelpers
55
# @return [PryStackExplorer::FrameManager] The active frame manager for
66
# the current `Pry` instance.
77
def frame_manager
8-
PryStackExplorer.frame_manager(_pry_)
8+
PryStackExplorer.frame_manager(pry_instance)
99
end
1010

1111
# @return [Array<PryStackExplorer::FrameManager>] All the frame
1212
# managers for the current `Pry` instance.
1313
def frame_managers
14-
PryStackExplorer.frame_managers(_pry_)
14+
PryStackExplorer.frame_managers(pry_instance)
1515
end
1616

1717
# @return [Boolean] Whether there is a context to return to once
@@ -55,7 +55,7 @@ def frame_info(b, verbose = false)
5555
sig = meth_obj ? "<#{signature_with_owner(meth_obj)}>" : ""
5656

5757
self_clipped = "#{Pry.view_clip(b_self)}"
58-
path = "@ #{b.eval('__FILE__')}:#{b.eval('__LINE__')}"
58+
path = '@ ' + b.source_location.join(':')
5959

6060
if !verbose
6161
"#{type} #{desc} #{sig}"
@@ -292,7 +292,7 @@ def process
292292
output.puts "No caller stack available!"
293293
else
294294
content = ""
295-
content << "\n#{text.bold("Showing all accessible frames in stack (#{frame_manager.bindings.size} in total):")}\n--\n"
295+
content << "\n#{bold("Showing all accessible frames in stack (#{frame_manager.bindings.size} in total):")}\n--\n"
296296

297297
base_frame_index, frames = selected_stack_frames
298298
frames.each_with_index do |b, index|

lib/pry-stack_explorer/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module PryStackExplorer
2-
VERSION = '0.4.9.3'
2+
VERSION = '0.5.0'
33
end

lib/pry-stack_explorer/when_started_hook.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def remove_internal_frames(bindings)
6060

6161
# remove pry-nav / pry-debugger / pry-byebug frames
6262
def remove_debugger_frames(bindings)
63-
bindings.drop_while { |b| b.eval("__FILE__") =~ /pry-(?:nav|debugger|byebug)/ }
63+
bindings.drop_while { |b| b.source_location[0] =~ /pry-(?:nav|debugger|byebug)/ }
6464
end
6565

6666
# binding.pry frame

0 commit comments

Comments
 (0)