pry-moves 0.1.0 → 0.1.1

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
  SHA1:
3
- metadata.gz: db3ea1e074ab85725b2cba35fb6e15a756f4aa6c
4
- data.tar.gz: 0c1db4f7b08122e52bea1633658f53f7423c409a
3
+ metadata.gz: 0f79cd377ce0604df7803f55544d00d04f2e8342
4
+ data.tar.gz: fcff3fd9d786930d8468dc2f5d81912702cb1b70
5
5
  SHA512:
6
- metadata.gz: 69e3e09438e94413f4bc53b5e275b37166dc3acbf57ac1e2147740d816a41beb4149c9267b758a4afba227c97dab6fb377511a47338841095c3552d5b3e06366
7
- data.tar.gz: 0ea9be1eb417f3b9d44cc3c4685cdba4fde71f2777989985586e7c6e39915687dbcd8167b125961c2de478b341af4a5946798fb65a389a2c2fc770a1de21622c
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
- ```ruby
33
- class A
37
+ <img src="https://user-images.githubusercontent.com/2452269/27320748-37afe7de-55a0-11e7-8b8f-ae05bcb02f37.jpg" width="377">
34
38
 
35
- def initialize
36
- b = :some_code
37
- end
39
+ _Demo class source [here](https://github.com/garmoshka-mo/pry-moves/issues/1)_
38
40
 
39
- def aa
40
- self
41
- end
41
+ ## Configuration
42
42
 
43
- def bb
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
- def block
53
- e = :some_code
54
- yield
55
- f = :other_code
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
 
@@ -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 '!', '!!!'
@@ -1,3 +1,3 @@
1
1
  module PryMoves
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
data/lib/pry-moves.rb CHANGED
@@ -2,6 +2,7 @@ require 'pry-moves/version'
2
2
  require 'pry-moves/pry_ext'
3
3
  require 'pry-moves/commands'
4
4
  require 'pry-moves/tracer'
5
+ require 'pry-moves/backtrace'
5
6
 
6
7
  # Optionally load pry-remote monkey patches
7
8
  require 'pry-moves/pry_remote_ext' if defined? PryRemote
data/playground/Gemfile CHANGED
@@ -1,6 +1,4 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem 'pry'
4
- gem 'pry-stack_explorer'
5
3
  gem 'pry-moves', path: '../'
6
4
 
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
@@ -1,4 +1,3 @@
1
- require 'pry'
2
1
  require 'pry-moves'
3
2
 
4
3
  class A
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pry-moves
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garmoshka Mo