pry-stack_explorer 0.4.9.3 → 0.4.11
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 +5 -5
- data/.gitignore +2 -0
- data/.travis.yml +7 -9
- data/CHANGELOG +8 -0
- data/Gemfile +1 -1
- data/README.md +44 -46
- data/Rakefile +3 -3
- data/lib/pry-stack_explorer.rb +3 -3
- data/lib/pry-stack_explorer/commands.rb +3 -3
- data/lib/pry-stack_explorer/version.rb +1 -1
- data/pry-stack_explorer.gemspec +18 -26
- data/test/helper.rb +0 -2
- metadata +13 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 69b3c43b4da5446c7b79e367309e6b193105c5590f5973ea4cd0761857d621d6
|
4
|
+
data.tar.gz: 0c3071f239ddfe47f30d1dae39f5aea12915ea0adab75de6798185c93a6a6ae9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 99b8615293d09922f305a11f33b8938c9bdd465e3888c59f3e7c24b2150d2ff2619c322bad2454cf07692a24f36b5ae2da56decbd2191d2d087c1d6dcdf7985b
|
7
|
+
data.tar.gz: b3a9e68bf0a391d59330a6e2a4b09419f84da0ea131b22254c9bf4f617afd0c9eed114402d1b40071cb5ad741988d6c16fd5a75d3bf1d6ad918804c5eb8ce6bf
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
language: ruby
|
2
|
+
|
1
3
|
script:
|
2
4
|
rake test --trace
|
3
5
|
|
@@ -5,23 +7,19 @@ before_install:
|
|
5
7
|
- gem update --system
|
6
8
|
|
7
9
|
rvm:
|
8
|
-
-
|
9
|
-
- 2.
|
10
|
-
- 2.1
|
11
|
-
- 2.2.9
|
12
|
-
- 2.3.6
|
13
|
-
- 2.4.3
|
14
|
-
- 2.5.0
|
10
|
+
- 2.5.3
|
11
|
+
- 2.6.6
|
12
|
+
- 2.7.1
|
15
13
|
- ruby-head
|
16
14
|
|
17
15
|
matrix:
|
18
16
|
allow_failures:
|
19
|
-
-
|
17
|
+
- rvm: ruby-head
|
20
18
|
fast_finish: true
|
21
19
|
|
22
20
|
notifications:
|
23
21
|
irc: "irc.freenode.org#pry"
|
24
|
-
|
22
|
+
email:
|
25
23
|
- jrmair@gmail.com
|
26
24
|
|
27
25
|
branches:
|
data/CHANGELOG
CHANGED
data/Gemfile
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
source
|
1
|
+
source 'https://rubygems.org'
|
2
2
|
gemspec
|
data/README.md
CHANGED
@@ -1,10 +1,10 @@
|
|
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
|
+
Note: **Requires Ruby 2.6+ as of version 0.5.0.**
|
7
|
+
|
8
8
|
pry-stack_explorer is a plugin for the [Pry](http://pry.github.com)
|
9
9
|
REPL that enables the user to navigate the call-stack.
|
10
10
|
|
@@ -15,68 +15,66 @@ Unlike `ruby-debug`, pry-stack_explorer incurs no runtime cost and
|
|
15
15
|
enables navigation right up the call-stack to the birth of the
|
16
16
|
program.
|
17
17
|
|
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
18
|
The `up`, `down`, `frame` and `show-stack` commands are provided. See
|
23
19
|
Pry's in-session help for more information on any of these commands.
|
24
20
|
|
25
|
-
|
21
|
+
## Usage
|
22
|
+
Provides commands available in Pry sessions.
|
23
|
+
|
24
|
+
Commands:
|
25
|
+
* `up`/`down` - Move up or down the call stack
|
26
|
+
* `frame [n]` - Go to frame *n*
|
27
|
+
* `show-stack` - Show call stack
|
28
|
+
|
29
|
+
|
30
|
+
## Install
|
31
|
+
|
32
|
+
In Gemfile:
|
33
|
+
```rb
|
34
|
+
gem 'pry-stack_explorer', '~> 0.5.0'
|
35
|
+
```
|
26
36
|
|
27
|
-
|
37
|
+
```
|
38
|
+
gem install pry-stack_explorer
|
39
|
+
```
|
28
40
|
|
29
|
-
* Install the [gem](https://rubygems.org/gems/pry-stack_explorer): `gem install pry-stack_explorer`
|
30
41
|
* 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
42
|
* See the [wiki](https://github.com/pry/pry-stack_explorer/wiki) for in-depth usage information.
|
33
43
|
|
34
|
-
Example:
|
44
|
+
Example:
|
35
45
|
--------
|
46
|
+
Here we run the following ruby script:
|
47
|
+
```Ruby
|
48
|
+
require 'pry-stack_explorer'
|
36
49
|
|
37
|
-
|
50
|
+
def alpha
|
51
|
+
x = "hello"
|
52
|
+
beta
|
53
|
+
puts x
|
54
|
+
end
|
38
55
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
[](https://asciinema.org/a/0KtCL9HB1bP08wNHLfIeOMa8K)
|
56
|
+
def beta
|
57
|
+
binding.pry
|
58
|
+
end
|
43
59
|
|
44
|
-
|
60
|
+
alpha
|
61
|
+
```
|
45
62
|
|
46
|
-
|
47
|
-
-------------------------
|
63
|
+
We wander around the stack a little bit, and modify the state of a frame above the one we `binding.pry`'d at.
|
48
64
|
|
49
|
-
|
50
|
-
* Limited to Rubinius, and MRI 1.9.2+ at this stage.
|
65
|
+
[](https://asciinema.org/a/257713)
|
51
66
|
|
52
|
-
|
53
|
-
-------
|
67
|
+
Output from above is `Goodbye` as we changed the `x` local inside the `alpha` (caller) stack frame.
|
54
68
|
|
55
|
-
|
69
|
+
Compatible versions
|
70
|
+
-------------------
|
71
|
+
* v0.5: Ruby 2.6+, Pry 0.13+
|
72
|
+
* v0.4.10: Ruby 2.6+, Pry 0.12+
|
73
|
+
* v0.4.9.3: Ruby 2.5 and older
|
56
74
|
|
57
75
|
|
58
76
|
License
|
59
77
|
-------
|
78
|
+
Released under the [MIT License](https://github.com/pry/pry-stack_explorer/blob/master/LICENSE) by John Mair (banisterfiend) and contributors
|
60
79
|
|
61
|
-
|
62
|
-
|
63
|
-
Copyright (c) 2011 John Mair (banisterfiend)
|
64
|
-
|
65
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
66
|
-
a copy of this software and associated documentation files (the
|
67
|
-
'Software'), to deal in the Software without restriction, including
|
68
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
69
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
70
|
-
permit persons to whom the Software is furnished to do so, subject to
|
71
|
-
the following conditions:
|
72
|
-
|
73
|
-
The above copyright notice and this permission notice shall be
|
74
|
-
included in all copies or substantial portions of the Software.
|
75
|
-
|
76
|
-
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
77
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
78
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
79
|
-
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
80
|
-
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
81
|
-
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
82
|
-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
80
|
+
Contributions to this gem are released under the same license.
|
data/Rakefile
CHANGED
@@ -33,12 +33,12 @@ end
|
|
33
33
|
|
34
34
|
desc "run pry with plugin enabled"
|
35
35
|
task :pry do
|
36
|
-
exec("pry -
|
36
|
+
exec("pry -I#{direc}/lib/ -r #{direc}/lib/#{PROJECT_NAME}")
|
37
37
|
end
|
38
38
|
|
39
39
|
desc "Run example"
|
40
40
|
task :example do
|
41
|
-
sh "ruby -
|
41
|
+
sh "ruby -I#{direc}/lib/ #{direc}/examples/example.rb "
|
42
42
|
end
|
43
43
|
|
44
44
|
desc "Run example2"
|
@@ -61,7 +61,7 @@ task :default => :test
|
|
61
61
|
|
62
62
|
desc "run tests"
|
63
63
|
task :test do
|
64
|
-
sh "bacon -Itest -
|
64
|
+
sh "bacon -Itest -a -q"
|
65
65
|
end
|
66
66
|
|
67
67
|
desc "generate gemspec"
|
data/lib/pry-stack_explorer.rb
CHANGED
@@ -127,9 +127,9 @@ Pry.config.commands.import PryStackExplorer::Commands
|
|
127
127
|
# monkey-patch the whereami command to show some frame information,
|
128
128
|
# useful for navigating stack.
|
129
129
|
Pry.config.hooks.add_hook(:before_whereami, :stack_explorer) do
|
130
|
-
if PryStackExplorer.frame_manager(
|
131
|
-
bindings = PryStackExplorer.frame_manager(
|
132
|
-
binding_index = PryStackExplorer.frame_manager(
|
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
|
133
133
|
|
134
134
|
output.puts "\n"
|
135
135
|
output.puts "#{Pry::Helpers::Text.bold('Frame number:')} #{binding_index}/#{bindings.size - 1}"
|
@@ -5,13 +5,13 @@ module PryStackExplorer
|
|
5
5
|
# @return [PryStackExplorer::FrameManager] The active frame manager for
|
6
6
|
# the current `Pry` instance.
|
7
7
|
def frame_manager
|
8
|
-
PryStackExplorer.frame_manager(
|
8
|
+
PryStackExplorer.frame_manager(pry_instance)
|
9
9
|
end
|
10
10
|
|
11
11
|
# @return [Array<PryStackExplorer::FrameManager>] All the frame
|
12
12
|
# managers for the current `Pry` instance.
|
13
13
|
def frame_managers
|
14
|
-
PryStackExplorer.frame_managers(
|
14
|
+
PryStackExplorer.frame_managers(pry_instance)
|
15
15
|
end
|
16
16
|
|
17
17
|
# @return [Boolean] Whether there is a context to return to once
|
@@ -292,7 +292,7 @@ module PryStackExplorer
|
|
292
292
|
output.puts "No caller stack available!"
|
293
293
|
else
|
294
294
|
content = ""
|
295
|
-
content << "\n#{
|
295
|
+
content << "\n#{bold("Showing all accessible frames in stack (#{frame_manager.bindings.size} in total):")}\n--\n"
|
296
296
|
|
297
297
|
base_frame_index, frames = selected_stack_frames
|
298
298
|
frames.each_with_index do |b, index|
|
data/pry-stack_explorer.gemspec
CHANGED
@@ -1,36 +1,28 @@
|
|
1
|
+
require File.expand_path('../lib/pry-stack_explorer/version', __FILE__)
|
2
|
+
|
1
3
|
Gem::Specification.new do |s|
|
2
4
|
s.name = "pry-stack_explorer"
|
3
|
-
s.version =
|
5
|
+
s.version = PryStackExplorer::VERSION
|
4
6
|
|
5
|
-
s.
|
7
|
+
s.required_ruby_version = ">= 2.0.0"
|
6
8
|
s.authors = ["John Mair (banisterfiend)"]
|
7
|
-
s.date = Time.now.strftime('%Y-%m-%d')
|
8
|
-
s.description = "Walk the stack in a Pry session"
|
9
9
|
s.email = "jrmair@gmail.com"
|
10
|
+
|
11
|
+
s.license = "MIT"
|
12
|
+
|
13
|
+
s.summary = "Walk the stack in a Pry session"
|
14
|
+
|
10
15
|
s.files = [".gemtest", ".gitignore", ".travis.yml", ".yardopts", "CHANGELOG", "Gemfile", "LICENSE", "README.md", "Rakefile", "examples/example.rb", "examples/example2.rb", "examples/example3.rb", "lib/pry-stack_explorer.rb", "lib/pry-stack_explorer/commands.rb", "lib/pry-stack_explorer/frame_manager.rb", "lib/pry-stack_explorer/version.rb", "lib/pry-stack_explorer/when_started_hook.rb", "pry-stack_explorer.gemspec", "test/helper.rb", "test/test_commands.rb", "test/test_frame_manager.rb", "test/test_stack_explorer.rb", "tester.rb"]
|
11
|
-
s.homepage = "https://github.com/pry/pry-stack_explorer"
|
12
16
|
s.require_paths = ["lib"]
|
13
|
-
s.summary = "Walk the stack in a Pry session"
|
14
17
|
s.test_files = ["test/helper.rb", "test/test_commands.rb", "test/test_frame_manager.rb", "test/test_stack_explorer.rb"]
|
15
18
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
s.add_dependency(%q<binding_of_caller>, [">= 0.7"])
|
26
|
-
s.add_dependency(%q<pry>, [">= 0.9.11"])
|
27
|
-
s.add_dependency(%q<bacon>, ["~> 1.1.0"])
|
28
|
-
s.add_dependency(%q<rake>, ["~> 0.9"])
|
29
|
-
end
|
30
|
-
else
|
31
|
-
s.add_dependency(%q<binding_of_caller>, [">= 0.7"])
|
32
|
-
s.add_dependency(%q<pry>, [">= 0.9.11"])
|
33
|
-
s.add_dependency(%q<bacon>, ["~> 1.1.0"])
|
34
|
-
s.add_dependency(%q<rake>, ["~> 0.9"])
|
35
|
-
end
|
19
|
+
s.homepage = "https://github.com/pry/pry-stack_explorer"
|
20
|
+
|
21
|
+
s.specification_version = 4
|
22
|
+
|
23
|
+
s.add_runtime_dependency 'binding_of_caller', '~> 0.7'
|
24
|
+
s.add_runtime_dependency 'pry', '~> 0.13'
|
25
|
+
|
26
|
+
s.add_development_dependency 'bacon', '~> 1.1.0'
|
27
|
+
s.add_development_dependency 'rake', '~> 0.9'
|
36
28
|
end
|
data/test/helper.rb
CHANGED
@@ -23,8 +23,6 @@ class << Pry
|
|
23
23
|
Pry.pager = false
|
24
24
|
Pry.config.should_load_rc = false
|
25
25
|
Pry.config.should_load_plugins = false
|
26
|
-
Pry.config.history.should_load = false
|
27
|
-
Pry.config.history.should_save = false
|
28
26
|
Pry.config.auto_indent = false
|
29
27
|
Pry.config.hooks = Pry::Hooks.new
|
30
28
|
Pry.config.collision_warning = false
|
metadata
CHANGED
@@ -1,43 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pry-stack_explorer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Mair (banisterfiend)
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-05-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: binding_of_caller
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0.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
26
|
version: '0.7'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: pry
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: '0.13'
|
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: 0.
|
40
|
+
version: '0.13'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bacon
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,7 +66,7 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0.9'
|
69
|
-
description:
|
69
|
+
description:
|
70
70
|
email: jrmair@gmail.com
|
71
71
|
executables: []
|
72
72
|
extensions: []
|
@@ -96,7 +96,8 @@ files:
|
|
96
96
|
- test/test_stack_explorer.rb
|
97
97
|
- tester.rb
|
98
98
|
homepage: https://github.com/pry/pry-stack_explorer
|
99
|
-
licenses:
|
99
|
+
licenses:
|
100
|
+
- MIT
|
100
101
|
metadata: {}
|
101
102
|
post_install_message:
|
102
103
|
rdoc_options: []
|
@@ -106,15 +107,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
106
107
|
requirements:
|
107
108
|
- - ">="
|
108
109
|
- !ruby/object:Gem::Version
|
109
|
-
version:
|
110
|
+
version: 2.0.0
|
110
111
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
111
112
|
requirements:
|
112
113
|
- - ">="
|
113
114
|
- !ruby/object:Gem::Version
|
114
115
|
version: '0'
|
115
116
|
requirements: []
|
116
|
-
|
117
|
-
rubygems_version: 2.6.13
|
117
|
+
rubygems_version: 3.1.2
|
118
118
|
signing_key:
|
119
119
|
specification_version: 4
|
120
120
|
summary: Walk the stack in a Pry session
|