pry-moves 0.1.0 → 0.1.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 +17 -25
- data/lib/pry-moves/commands.rb +4 -1
- data/lib/pry-moves/version.rb +1 -1
- data/lib/pry-moves.rb +1 -0
- data/playground/Gemfile +0 -2
- data/playground/README.md +0 -11
- data/playground/demo.rb +0 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0f79cd377ce0604df7803f55544d00d04f2e8342
|
4
|
+
data.tar.gz: fcff3fd9d786930d8468dc2f5d81912702cb1b70
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ccc6ebb0b80454c784cfb7ef9e27b22fb1f700f42c0abfdc2f7eeca89bfc9cf5796b6c809fc76e9dd3641ec333c4b1dd878e50aebf660f3ddc139355e22c924
|
7
|
+
data.tar.gz: 92dbe779b01e9fdaee2f48291c37e0e22d5ed9e3197ae75e370d085a3ac11e3bd044a3167ac3fc7165c6b732bdf6bd4bccfce8d0f39fca739eb23ff308577517
|
data/README.md
CHANGED
@@ -4,6 +4,8 @@
|
|
4
4
|
|
5
5
|
_An execution control add-on for [Pry][pry]._
|
6
6
|
|
7
|
+
* Install: `gem 'pry-moves'`
|
8
|
+
* For non-rails (without auto-require), add to your script: `require 'pry-moves'`
|
7
9
|
|
8
10
|
## Commands:
|
9
11
|
|
@@ -12,7 +14,10 @@ _An execution control add-on for [Pry][pry]._
|
|
12
14
|
* `s func_name` - steps into first method called by name `func_name`
|
13
15
|
* `f` - **finish** execution of current frame and stop at next line on higher level
|
14
16
|
* `c` - **continue**
|
15
|
-
* `bt` - backtrace
|
17
|
+
* `bt` - shows latest 5 lines from backtrace
|
18
|
+
* `bt 10` - latest 10 lines
|
19
|
+
* `bt all`- full backtrace
|
20
|
+
* `up`/`down` - move over call stack
|
16
21
|
* `!` - exit
|
17
22
|
|
18
23
|
|
@@ -29,37 +34,23 @@ end
|
|
29
34
|
|
30
35
|
### Advanced example
|
31
36
|
|
32
|
-
|
33
|
-
class A
|
37
|
+
<img src="https://user-images.githubusercontent.com/2452269/27320748-37afe7de-55a0-11e7-8b8f-ae05bcb02f37.jpg" width="377">
|
34
38
|
|
35
|
-
|
36
|
-
b = :some_code
|
37
|
-
end
|
39
|
+
_Demo class source [here](https://github.com/garmoshka-mo/pry-moves/issues/1)_
|
38
40
|
|
39
|
-
|
40
|
-
self
|
41
|
-
end
|
41
|
+
## Configuration
|
42
42
|
|
43
|
-
|
44
|
-
block do
|
45
|
-
c = :some_code
|
46
|
-
end
|
47
|
-
d = :some_code
|
48
|
-
e = :some_code
|
49
|
-
self
|
50
|
-
end
|
43
|
+
Here is default configuration, you can override it:
|
51
44
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
45
|
+
```ruby
|
46
|
+
PryMoves::Backtrace::filter =
|
47
|
+
/(\/gems\/|\/rubygems\/|\/bin\/|\/lib\/ruby\/|\/pry-moves\/)/
|
48
|
+
|
49
|
+
PryMoves::Backtrace::format do |line|
|
50
|
+
defined?(Rails) : line.gsub( /^#{Rails.root.to_s}/, '') : line
|
56
51
|
end
|
57
|
-
|
58
|
-
end
|
59
52
|
```
|
60
53
|
|
61
|
-
<img src="https://user-images.githubusercontent.com/2452269/27320748-37afe7de-55a0-11e7-8b8f-ae05bcb02f37.jpg" width="377">
|
62
|
-
|
63
54
|
## Technical info
|
64
55
|
|
65
56
|
`pry-moves` is not yet thread-safe, so only use in single-threaded environments.
|
@@ -93,6 +84,7 @@ file an [issue][issues]. [Project changelog][changelog].
|
|
93
84
|
## Acknowledgments
|
94
85
|
|
95
86
|
* Gopal Patel's [pry-nav](https://github.com/nixme/pry-nav)
|
87
|
+
* John Mair's [pry-stack_explorer](https://github.com/pry/pry-stack_explorer)
|
96
88
|
* Ruby stdlib's [debug.rb][debug.rb]
|
97
89
|
* [@Mon-Ouie][Mon-Ouie]'s [pry_debug][pry_debug]
|
98
90
|
|
data/lib/pry-moves/commands.rb
CHANGED
@@ -22,6 +22,10 @@ module PryMoves
|
|
22
22
|
run 'exit-all'
|
23
23
|
end
|
24
24
|
|
25
|
+
block_command 'bt', 'Backtrace' do |param|
|
26
|
+
PryMoves::Backtrace.new(target).print param
|
27
|
+
end
|
28
|
+
|
25
29
|
alias_command 'c', 'continue'
|
26
30
|
alias_command 's', 'step'
|
27
31
|
alias_command 'n', 'next'
|
@@ -54,5 +58,4 @@ end
|
|
54
58
|
|
55
59
|
Pry.commands.import PryMoves::Commands
|
56
60
|
|
57
|
-
Pry.commands.alias_command 'bt', 'pry-backtrace'
|
58
61
|
Pry.commands.alias_command '!', '!!!'
|
data/lib/pry-moves/version.rb
CHANGED
data/lib/pry-moves.rb
CHANGED
data/playground/Gemfile
CHANGED
data/playground/README.md
CHANGED
@@ -6,17 +6,6 @@ be ruby sand.rb
|
|
6
6
|
|
7
7
|
## Conditions to be met
|
8
8
|
|
9
|
-
- publish to gems, reset version, add to readme how to install
|
10
|
-
- Publish on Stakcoverflow
|
11
|
-
-- в своем посте
|
12
|
-
-- поискать вопросов про дебаг в руби, посоветовать эту либу как удобнее чем все другое
|
13
|
-
- есть ли какой-то плейграунд на вебе?
|
14
|
-
|
15
|
-
|
16
|
-
-------------------
|
17
|
-
-------------------
|
18
|
-
|
19
|
-
|
20
9
|
- `binding.pry if debug? :resolve`
|
21
10
|
3 раза просит одно и то же
|
22
11
|
- recursions.rb
|
data/playground/demo.rb
CHANGED