pry-stack_explorer 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +26 -40
- data/lib/pry-stack_explorer/version.rb +1 -1
- data/lib/pry-stack_explorer/when_started_hook.rb +2 -0
- metadata +8 -27
- data/.gemtest +0 -0
- data/.gitignore +0 -9
- data/.travis.yml +0 -26
- data/.yardopts +0 -1
- data/CHANGELOG +0 -9
- data/Gemfile +0 -2
- data/Rakefile +0 -112
- data/examples/example.rb +0 -45
- data/examples/example2.rb +0 -18
- data/examples/example3.rb +0 -46
- data/pry-stack_explorer.gemspec +0 -29
- data/test/helper.rb +0 -85
- data/test/test_commands.rb +0 -358
- data/test/test_frame_manager.rb +0 -65
- data/test/test_stack_explorer.rb +0 -393
- data/tester.rb +0 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b9a35f3f16a578dfe681562179beaaf5007c4f022510aeebd4e4cfffa167984
|
4
|
+
data.tar.gz: aa1ea9e43daffc284c731be4900ef522b1ef7b8eb49e4eb19aa395e8afce48b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 443cf425db06704c33ad85b5dc79140c3f0318543012067773442cc63a933d62469e9383581609895a66a974de470bb74f822f0468ae392a7596c1465fffcbf8
|
7
|
+
data.tar.gz: 37138108eec94b9f8705c5c2473b7ec92b27bc2224a58940a4fb9ef1fe013f2480940ec1b6c4ea8294fdc0ea431d0998775c3690f36f3d622fba3f89c5a2286b
|
data/README.md
CHANGED
@@ -1,10 +1,12 @@
|
|
1
1
|
pry-stack_explorer
|
2
2
|
===========
|
3
3
|
|
4
|
-
(C) John Mair (banisterfiend) 2011
|
5
|
-
|
6
4
|
_Walk the stack in a Pry session_
|
7
5
|
|
6
|
+
Ruby versions: **Branch v0.5 requires Ruby 2.6+**. Branch v0.4.11+ will remain for Ruby 2.5 users until its EOL in March 2021.
|
7
|
+
|
8
|
+
---
|
9
|
+
|
8
10
|
pry-stack_explorer is a plugin for the [Pry](http://pry.github.com)
|
9
11
|
REPL that enables the user to navigate the call-stack.
|
10
12
|
|
@@ -15,20 +17,30 @@ Unlike `ruby-debug`, pry-stack_explorer incurs no runtime cost and
|
|
15
17
|
enables navigation right up the call-stack to the birth of the
|
16
18
|
program.
|
17
19
|
|
18
|
-
pry-stack_explorer is currently designed to work on **Rubinius and MRI
|
19
|
-
Ruby 1.9.2+ (including 1.9.3)**. Support for other Ruby versions and
|
20
|
-
implementations is planned for the future.
|
21
|
-
|
22
20
|
The `up`, `down`, `frame` and `show-stack` commands are provided. See
|
23
21
|
Pry's in-session help for more information on any of these commands.
|
24
22
|
|
25
|
-
|
23
|
+
## Usage
|
24
|
+
Provides commands available in Pry sessions.
|
25
|
+
|
26
|
+
Commands:
|
27
|
+
* `up`/`down` - Move up or down the call stack
|
28
|
+
* `frame [n]` - Go to frame *n*
|
29
|
+
* `show-stack` - Show call stack
|
26
30
|
|
27
|
-
After installing `pry-stack_explorer`, just start Pry as normal (typically via a `binding.pry`), the stack_explorer plugin will be detected and used automatically.
|
28
31
|
|
29
|
-
|
32
|
+
## Install
|
33
|
+
|
34
|
+
In Gemfile:
|
35
|
+
```rb
|
36
|
+
gem 'pry-stack_explorer', '~> 0.5.0'
|
37
|
+
```
|
38
|
+
|
39
|
+
```
|
40
|
+
gem install pry-stack_explorer
|
41
|
+
```
|
42
|
+
|
30
43
|
* Read the [documentation](http://rdoc.info/github/banister/pry-stack_explorer/master/file/README.md)
|
31
|
-
* See the [source code](http://github.com/pry/pry-stack_explorer)
|
32
44
|
* See the [wiki](https://github.com/pry/pry-stack_explorer/wiki) for in-depth usage information.
|
33
45
|
|
34
46
|
Example:
|
@@ -59,38 +71,12 @@ Output from above is `Goodbye` as we changed the `x` local inside the `alpha` (c
|
|
59
71
|
Compatible versions
|
60
72
|
-------------------
|
61
73
|
* v0.5: Ruby 2.6+, Pry 0.13+
|
62
|
-
* v0.4.
|
63
|
-
* v0.4.9.3:
|
64
|
-
|
65
|
-
|
66
|
-
Contact
|
67
|
-
-------
|
68
|
-
|
69
|
-
Problems or questions contact me at [github](http://github.com/banister)
|
74
|
+
* v0.4.11: Ruby 2.5, Pry 0.12+ (branch `works-with-ruby-2-5`)
|
75
|
+
* v0.4.9.3: Older versions
|
70
76
|
|
71
77
|
|
72
78
|
License
|
73
79
|
-------
|
80
|
+
Released under the [MIT License](https://github.com/pry/pry-stack_explorer/blob/master/LICENSE) by John Mair (banisterfiend) and contributors
|
74
81
|
|
75
|
-
|
76
|
-
|
77
|
-
Copyright (c) 2011 John Mair (banisterfiend)
|
78
|
-
|
79
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
80
|
-
a copy of this software and associated documentation files (the
|
81
|
-
'Software'), to deal in the Software without restriction, including
|
82
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
83
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
84
|
-
permit persons to whom the Software is furnished to do so, subject to
|
85
|
-
the following conditions:
|
86
|
-
|
87
|
-
The above copyright notice and this permission notice shall be
|
88
|
-
included in all copies or substantial portions of the Software.
|
89
|
-
|
90
|
-
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
91
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
92
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
93
|
-
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
94
|
-
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
95
|
-
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
96
|
-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
82
|
+
Contributions to this gem are released under the same license.
|
@@ -47,6 +47,8 @@ module PryStackExplorer
|
|
47
47
|
# remove internal frames related to setting up the session
|
48
48
|
def remove_internal_frames(bindings)
|
49
49
|
start_frames = internal_frames_with_indices(bindings)
|
50
|
+
return bindings if start_frames.empty?
|
51
|
+
|
50
52
|
start_frame_index = start_frames.first.last
|
51
53
|
|
52
54
|
if start_frames.size >= 2
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pry-stack_explorer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Mair (banisterfiend)
|
@@ -39,19 +39,19 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0.13'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: '3.9'
|
48
48
|
type: :development
|
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:
|
54
|
+
version: '3.9'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -67,34 +67,19 @@ dependencies:
|
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0.9'
|
69
69
|
description:
|
70
|
-
email:
|
70
|
+
email:
|
71
|
+
- jrmair@gmail.com
|
71
72
|
executables: []
|
72
73
|
extensions: []
|
73
74
|
extra_rdoc_files: []
|
74
75
|
files:
|
75
|
-
- ".gemtest"
|
76
|
-
- ".gitignore"
|
77
|
-
- ".travis.yml"
|
78
|
-
- ".yardopts"
|
79
|
-
- CHANGELOG
|
80
|
-
- Gemfile
|
81
76
|
- LICENSE
|
82
77
|
- README.md
|
83
|
-
- Rakefile
|
84
|
-
- examples/example.rb
|
85
|
-
- examples/example2.rb
|
86
|
-
- examples/example3.rb
|
87
78
|
- lib/pry-stack_explorer.rb
|
88
79
|
- lib/pry-stack_explorer/commands.rb
|
89
80
|
- lib/pry-stack_explorer/frame_manager.rb
|
90
81
|
- lib/pry-stack_explorer/version.rb
|
91
82
|
- lib/pry-stack_explorer/when_started_hook.rb
|
92
|
-
- pry-stack_explorer.gemspec
|
93
|
-
- test/helper.rb
|
94
|
-
- test/test_commands.rb
|
95
|
-
- test/test_frame_manager.rb
|
96
|
-
- test/test_stack_explorer.rb
|
97
|
-
- tester.rb
|
98
83
|
homepage: https://github.com/pry/pry-stack_explorer
|
99
84
|
licenses:
|
100
85
|
- MIT
|
@@ -114,12 +99,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
114
99
|
- !ruby/object:Gem::Version
|
115
100
|
version: '0'
|
116
101
|
requirements: []
|
117
|
-
rubygems_version: 3.
|
102
|
+
rubygems_version: 3.0.3
|
118
103
|
signing_key:
|
119
104
|
specification_version: 4
|
120
105
|
summary: Walk the stack in a Pry session
|
121
|
-
test_files:
|
122
|
-
- test/helper.rb
|
123
|
-
- test/test_commands.rb
|
124
|
-
- test/test_frame_manager.rb
|
125
|
-
- test/test_stack_explorer.rb
|
106
|
+
test_files: []
|
data/.gemtest
DELETED
File without changes
|
data/.gitignore
DELETED
data/.travis.yml
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
|
3
|
-
script:
|
4
|
-
rake test --trace
|
5
|
-
|
6
|
-
before_install:
|
7
|
-
- gem update --system
|
8
|
-
|
9
|
-
rvm:
|
10
|
-
- 2.6.6
|
11
|
-
- 2.7.1
|
12
|
-
- ruby-head
|
13
|
-
|
14
|
-
matrix:
|
15
|
-
allow_failures:
|
16
|
-
- rvm: ruby-head
|
17
|
-
fast_finish: true
|
18
|
-
|
19
|
-
notifications:
|
20
|
-
irc: "irc.freenode.org#pry"
|
21
|
-
email:
|
22
|
-
- jrmair@gmail.com
|
23
|
-
|
24
|
-
branches:
|
25
|
-
only:
|
26
|
-
- master
|
data/.yardopts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
--markup markdown
|
data/CHANGELOG
DELETED
@@ -1,9 +0,0 @@
|
|
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
|
data/Gemfile
DELETED
data/Rakefile
DELETED
@@ -1,112 +0,0 @@
|
|
1
|
-
$:.unshift 'lib'
|
2
|
-
|
3
|
-
dlext = RbConfig::CONFIG['DLEXT']
|
4
|
-
direc = File.dirname(__FILE__)
|
5
|
-
|
6
|
-
PROJECT_NAME = "pry-stack_explorer"
|
7
|
-
|
8
|
-
require 'rake/clean'
|
9
|
-
require 'rubygems/package_task'
|
10
|
-
require "#{PROJECT_NAME}/version"
|
11
|
-
|
12
|
-
CLOBBER.include("**/*~", "**/*#*", "**/*.log")
|
13
|
-
CLEAN.include("**/*#*", "**/*#*.*", "**/*_flymake*.*", "**/*_flymake",
|
14
|
-
"**/*.rbc", "**/.#*.*")
|
15
|
-
|
16
|
-
def apply_spec_defaults(s)
|
17
|
-
s.name = PROJECT_NAME
|
18
|
-
s.summary = "Walk the stack in a Pry session"
|
19
|
-
s.version = PryStackExplorer::VERSION
|
20
|
-
s.date = Time.now.strftime '%Y-%m-%d'
|
21
|
-
s.author = "John Mair (banisterfiend)"
|
22
|
-
s.email = 'jrmair@gmail.com'
|
23
|
-
s.description = s.summary
|
24
|
-
s.require_path = 'lib'
|
25
|
-
s.add_dependency("binding_of_caller",">= 0.7")
|
26
|
-
s.add_dependency("pry",">=0.9.11")
|
27
|
-
s.add_development_dependency("bacon","~>1.1.0")
|
28
|
-
s.add_development_dependency('rake', '~> 0.9')
|
29
|
-
s.homepage = "https://github.com/pry/pry-stack_explorer"
|
30
|
-
s.files = `git ls-files`.split("\n")
|
31
|
-
s.test_files = `git ls-files -- test/*`.split("\n")
|
32
|
-
end
|
33
|
-
|
34
|
-
desc "run pry with plugin enabled"
|
35
|
-
task :pry do
|
36
|
-
exec("pry -I#{direc}/lib/ -r #{direc}/lib/#{PROJECT_NAME}")
|
37
|
-
end
|
38
|
-
|
39
|
-
desc "Run example"
|
40
|
-
task :example do
|
41
|
-
sh "ruby -I#{direc}/lib/ #{direc}/examples/example.rb "
|
42
|
-
end
|
43
|
-
|
44
|
-
desc "Run example2"
|
45
|
-
task :example2 do
|
46
|
-
sh "ruby -I#{direc}/lib/ #{direc}/examples/example2.rb "
|
47
|
-
end
|
48
|
-
|
49
|
-
desc "Run example3"
|
50
|
-
task :example3 do
|
51
|
-
sh "ruby -I#{direc}/lib/ #{direc}/examples/example3.rb "
|
52
|
-
end
|
53
|
-
|
54
|
-
desc "Show version"
|
55
|
-
task :version do
|
56
|
-
puts "PryStackExplorer version: #{PryStackExplorer::VERSION}"
|
57
|
-
end
|
58
|
-
|
59
|
-
desc "run tests"
|
60
|
-
task :default => :test
|
61
|
-
|
62
|
-
desc "run tests"
|
63
|
-
task :test do
|
64
|
-
sh "bacon -Itest -a -q"
|
65
|
-
end
|
66
|
-
|
67
|
-
desc "generate gemspec"
|
68
|
-
task :gemspec => "ruby:gemspec"
|
69
|
-
|
70
|
-
namespace :ruby do
|
71
|
-
spec = Gem::Specification.new do |s|
|
72
|
-
apply_spec_defaults(s)
|
73
|
-
s.platform = Gem::Platform::RUBY
|
74
|
-
end
|
75
|
-
|
76
|
-
Gem::PackageTask.new(spec) do |pkg|
|
77
|
-
pkg.need_zip = false
|
78
|
-
pkg.need_tar = false
|
79
|
-
end
|
80
|
-
|
81
|
-
desc "Generate gemspec file"
|
82
|
-
task :gemspec do
|
83
|
-
File.open("#{spec.name}.gemspec", "w") do |f|
|
84
|
-
f << spec.to_ruby
|
85
|
-
end
|
86
|
-
end
|
87
|
-
end
|
88
|
-
|
89
|
-
desc "build all platform gems at once"
|
90
|
-
task :gems => [:clean, :rmgems, :gemspec, "ruby:gem"]
|
91
|
-
|
92
|
-
desc "remove all platform gems"
|
93
|
-
task :rmgems => ["ruby:clobber_package"]
|
94
|
-
|
95
|
-
desc "reinstall gem"
|
96
|
-
task :reinstall => :gems do
|
97
|
-
sh "gem uninstall pry-stack_explorer" rescue nil
|
98
|
-
sh "gem install -l #{direc}/pkg/#{PROJECT_NAME}-#{PryStackExplorer::VERSION}.gem"
|
99
|
-
end
|
100
|
-
|
101
|
-
task :install => :reinstall
|
102
|
-
|
103
|
-
desc "build and push latest gems"
|
104
|
-
task :pushgems => :gems do
|
105
|
-
chdir("#{File.dirname(__FILE__)}/pkg") do
|
106
|
-
Dir["*.gem"].each do |gemfile|
|
107
|
-
sh "gem push #{gemfile}"
|
108
|
-
end
|
109
|
-
end
|
110
|
-
end
|
111
|
-
|
112
|
-
task :pushgem => :pushgems
|
data/examples/example.rb
DELETED
@@ -1,45 +0,0 @@
|
|
1
|
-
unless Object.const_defined? :PryStackExplorer
|
2
|
-
$:.unshift File.expand_path '../../lib', __FILE__
|
3
|
-
require 'pry'
|
4
|
-
end
|
5
|
-
|
6
|
-
require 'pry-stack_explorer'
|
7
|
-
|
8
|
-
def alphabet(y)
|
9
|
-
x = 20
|
10
|
-
b
|
11
|
-
end
|
12
|
-
|
13
|
-
def b
|
14
|
-
x = 30
|
15
|
-
proc {
|
16
|
-
c
|
17
|
-
}.call
|
18
|
-
end
|
19
|
-
|
20
|
-
def c
|
21
|
-
u = 50
|
22
|
-
binding.pry
|
23
|
-
end
|
24
|
-
|
25
|
-
# hello
|
26
|
-
def beta
|
27
|
-
gamma
|
28
|
-
end
|
29
|
-
|
30
|
-
def gamma
|
31
|
-
zeta
|
32
|
-
end
|
33
|
-
|
34
|
-
def zeta
|
35
|
-
vitamin = 100
|
36
|
-
binding.pry
|
37
|
-
end
|
38
|
-
#
|
39
|
-
|
40
|
-
proc {
|
41
|
-
class J
|
42
|
-
alphabet(22)
|
43
|
-
end
|
44
|
-
}.call
|
45
|
-
|
data/examples/example2.rb
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
unless Object.const_defined? :PryStackExplorer
|
2
|
-
$:.unshift File.expand_path '../../lib', __FILE__
|
3
|
-
require 'pry'
|
4
|
-
end
|
5
|
-
|
6
|
-
require 'pry-stack_explorer'
|
7
|
-
|
8
|
-
def alpha
|
9
|
-
x = "hello"
|
10
|
-
beta
|
11
|
-
puts x
|
12
|
-
end
|
13
|
-
|
14
|
-
def beta
|
15
|
-
binding.pry
|
16
|
-
end
|
17
|
-
|
18
|
-
alpha
|
data/examples/example3.rb
DELETED
@@ -1,46 +0,0 @@
|
|
1
|
-
unless Object.const_defined? :PryStackExplorer
|
2
|
-
$:.unshift File.expand_path '../../lib', __FILE__
|
3
|
-
require 'pry'
|
4
|
-
end
|
5
|
-
|
6
|
-
require 'pry-stack_explorer'
|
7
|
-
|
8
|
-
def b
|
9
|
-
x = 30
|
10
|
-
proc {
|
11
|
-
c
|
12
|
-
}.call
|
13
|
-
end
|
14
|
-
|
15
|
-
def c
|
16
|
-
u = 50
|
17
|
-
V.new.beta
|
18
|
-
end
|
19
|
-
|
20
|
-
# hello
|
21
|
-
class V
|
22
|
-
def beta
|
23
|
-
gamma
|
24
|
-
end
|
25
|
-
|
26
|
-
def gamma
|
27
|
-
zeta
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
def zeta
|
32
|
-
vitamin = 100
|
33
|
-
binding.pry
|
34
|
-
end
|
35
|
-
#
|
36
|
-
|
37
|
-
proc {
|
38
|
-
class J
|
39
|
-
def alphabet(y)
|
40
|
-
x = 20
|
41
|
-
b
|
42
|
-
end
|
43
|
-
end
|
44
|
-
}.call
|
45
|
-
|
46
|
-
J.new.alphabet(122)
|