README.md in pry-moves-1.0.2 vs README.md in pry-moves-1.0.3
- old
+ new
@@ -16,29 +16,31 @@
* `s` - **step** into function execution
* `s method_name` - step into method `method_name` (For example from `User.new.method_name`). Partial name match supported.
* `s +` - step into function, including hidden frames
* `f` - **finish** execution of current frame (block or method) and stop at next line on higher level
* `c` - **continue**
-* `b` - go to next breakpoint (breakpoints currently are methods which contain "debug" in their name)
-* `iterate` - go to next iteration of current block
+* `b` - go to next breakpoint (methods marked with `pry_breakpoint = :some_scope` variable)
+* `add-bp var_name [line_number]` - add to script in this place conditional breakpoint: `debug if var_name == <it's value>`
+* `ir` - **iterate**, go to next iteration of current block
* `g 10` - **goto** line 10
* `bt` - show backtrace, excluding hidden frames
* `bt +` `bt hidden` - show backtrace including hidden frames
* `bt a` `bt all` - full backtrace with system and hidden frames
* `bt 10` - go to backtrace line 10
- * `bt save` - save backtrace to memory
- * `bt diff` - diff with saved backtrace
+ * `bt diff` - diff of backtraces (`bt save` for persistent save of 1st backtrace)
* `bt > foo` - write backtrace to file `log/backtrace_foo.log`
+ * `bt ::ClassName` - list objects in backtrace which class name contains "ClassName"
* `up`/`down`/`top`/`bottom` (`bm`) - move over call stack
* `up +` - move up, including vapid frames (block callers, hidden frames)
* `up pattern` - move up till first frame which method name or file position in format `folder/script.rb:12` matches regexp pattern
* `%` - print current frame of call stack (alias to `whereami`)
* `$` - fully print current function without line numbers
* `debug some_method(some_param)` - call `some_method(some_param)` and interactively step into it. This way you can virtually "step back" by executing previous pieces of code from current method
* `.method` or `123` or `:hash_key` - Continue traversing of last object in history. E.g. `orders` will list array, then `3` will enter `orders[3]`, then `.price` will enter `orders[3].price`
* `watch variable` - display variable's value on each step
-* `@` - restart. Set config `PryMoves.reload_rake_tasks = true` to automatically reload rake tasks
+* `diff expression` - display difference between saved expression (on first run) and expression 2
+* `@` - restart and reload scripts (in app/ & spec/ by default), reload rake tasks. Configurable.
* `#` - exit with code 3, can be wrapped in bash script to fully reload ruby scripts
* `!` - exit
Variable & methods names takes precedence over commands.
So if you have variable named `step`, to execute command `step` type `cmd step` or command's alias, e.g. `s`
@@ -77,16 +79,26 @@
* `pry_moves_stack_end` - limits stack from bottom, not possible to step below this frame
## Configuration
Here is default configuration, you can reassign it:
-
```ruby
+PryMoves.reload_ruby_scripts = {
+ monitor: %w(app spec),
+ except: %w(app/assets app/views)
+}
+PryMoves.reload_rake_tasks = true
PryMoves::Backtrace::filter =
/(\/gems\/|\/rubygems\/|\/bin\/|\/lib\/ruby\/|\/pry-moves\/)/
```
+Turn off features with environment variables:
+```bash
+PRY_MOVES_DEBUG_MISSING=off
+PRY_MOVES_RELOADER=off
+```
+
## Threads, helpers
To allow traveling to parent thread, use:
```ruby
@@ -133,13 +145,14 @@
# Development
## Testing
```
-bundle exec rspec
+bin/rspec
+bin/rspec -f d # Output result of each spec example
-DEBUG=true bundle exec rspec -e 'backtrace should backtrace'
+DEBUG=true bin/rspec -e 'backtrace should backtrace'
```
## ToDo
* `iterate` - steps in into child sub-block - should skip
@@ -166,10 +179,9 @@
[pry]: http://pryrepl.org/
[pry-remote]: https://github.com/Mon-Ouie/pry-remote
[set_trace_func]: http://www.ruby-doc.org/core-1.9.3/Kernel.html#method-i-set_trace_func
[pullrequests]: https://github.com/garmoshka-mo/pry-moves/pulls
[issues]: https://github.com/garmoshka-mo/pry-moves/issues
-[changelog]: https://github.com/garmoshka-mo/pry-moves/blob/master/CHANGELOG.md
[debug.rb]: https://github.com/ruby/ruby/blob/trunk/lib/debug.rb
[Mon-Ouie]: https://github.com/Mon-Ouie
[pry_debug]: https://github.com/Mon-Ouie/pry_debug
[pry-byebug]: https://github.com/deivid-rodriguez/pry-byebug