pry-nav 0.0.4 → 0.1.0
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.
- data/CHANGELOG.md +6 -0
 - data/lib/pry-nav.rb +1 -1
 - data/lib/pry-nav/commands.rb +5 -5
 - data/lib/pry-nav/pry_ext.rb +1 -1
 - data/lib/pry-nav/pry_remote_ext.rb +2 -2
 - data/lib/pry-nav/tracer.rb +4 -4
 - data/lib/pry-nav/version.rb +1 -1
 - data/pry-nav.gemspec +2 -2
 - metadata +8 -7
 
    
        data/CHANGELOG.md
    CHANGED
    
    
    
        data/lib/pry-nav.rb
    CHANGED
    
    | 
         @@ -7,7 +7,7 @@ require 'pry-nav/tracer' 
     | 
|
| 
       7 
7 
     | 
    
         
             
            require 'pry-nav/pry_remote_ext' if defined? PryRemote
         
     | 
| 
       8 
8 
     | 
    
         | 
| 
       9 
9 
     | 
    
         
             
            module PryNav
         
     | 
| 
       10 
     | 
    
         
            -
              TRACE_IGNORE_FILES = Dir[File.join(File.dirname(__FILE__), '**', '*.rb')]
         
     | 
| 
      
 10 
     | 
    
         
            +
              TRACE_IGNORE_FILES = Dir[File.join(File.dirname(__FILE__), '**', '*.rb')].map { |f| File.expand_path(f) }
         
     | 
| 
       11 
11 
     | 
    
         | 
| 
       12 
12 
     | 
    
         
             
              extend self
         
     | 
| 
       13 
13 
     | 
    
         | 
    
        data/lib/pry-nav/commands.rb
    CHANGED
    
    | 
         @@ -2,17 +2,17 @@ require 'pry' 
     | 
|
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            module PryNav
         
     | 
| 
       4 
4 
     | 
    
         
             
              Commands = Pry::CommandSet.new do
         
     | 
| 
       5 
     | 
    
         
            -
                 
     | 
| 
      
 5 
     | 
    
         
            +
                block_command 'step', 'Step execution into the next line or method.' do |steps|
         
     | 
| 
       6 
6 
     | 
    
         
             
                  check_file_context
         
     | 
| 
       7 
7 
     | 
    
         
             
                  breakout_navigation :step, steps
         
     | 
| 
       8 
8 
     | 
    
         
             
                end
         
     | 
| 
       9 
9 
     | 
    
         | 
| 
       10 
     | 
    
         
            -
                 
     | 
| 
      
 10 
     | 
    
         
            +
                block_command 'next', 'Execute the next line within the same stack frame.' do |lines|
         
     | 
| 
       11 
11 
     | 
    
         
             
                  check_file_context
         
     | 
| 
       12 
12 
     | 
    
         
             
                  breakout_navigation :next, lines
         
     | 
| 
       13 
13 
     | 
    
         
             
                end
         
     | 
| 
       14 
14 
     | 
    
         | 
| 
       15 
     | 
    
         
            -
                 
     | 
| 
      
 15 
     | 
    
         
            +
                block_command 'continue', 'Continue program execution and end the Pry session.' do
         
     | 
| 
       16 
16 
     | 
    
         
             
                  check_file_context
         
     | 
| 
       17 
17 
     | 
    
         
             
                  run 'exit-all'
         
     | 
| 
       18 
18 
     | 
    
         
             
                end
         
     | 
| 
         @@ -25,8 +25,8 @@ module PryNav 
     | 
|
| 
       25 
25 
     | 
    
         
             
                  def breakout_navigation(action, times)
         
     | 
| 
       26 
26 
     | 
    
         
             
                    _pry_.binding_stack.clear     # Clear the binding stack.
         
     | 
| 
       27 
27 
     | 
    
         
             
                    throw :breakout_nav, {        # Break out of the REPL loop and
         
     | 
| 
       28 
     | 
    
         
            -
                      action 
     | 
| 
       29 
     | 
    
         
            -
                      times 
     | 
| 
      
 28 
     | 
    
         
            +
                      :action => action,          #   signal the tracer.
         
     | 
| 
      
 29 
     | 
    
         
            +
                      :times =>  times
         
     | 
| 
       30 
30 
     | 
    
         
             
                    }
         
     | 
| 
       31 
31 
     | 
    
         
             
                  end
         
     | 
| 
       32 
32 
     | 
    
         | 
    
        data/lib/pry-nav/pry_ext.rb
    CHANGED
    
    | 
         @@ -7,7 +7,7 @@ class << Pry 
     | 
|
| 
       7 
7 
     | 
    
         
             
              def start(target = TOPLEVEL_BINDING, options = {})
         
     | 
| 
       8 
8 
     | 
    
         
             
                old_options = options.reject { |k, _| k == :pry_remote }
         
     | 
| 
       9 
9 
     | 
    
         | 
| 
       10 
     | 
    
         
            -
                if PryNav.check_file_context(target)
         
     | 
| 
      
 10 
     | 
    
         
            +
                if target.is_a?(Binding) && PryNav.check_file_context(target)
         
     | 
| 
       11 
11 
     | 
    
         
             
                  # Wrap the tracer around the usual Pry.start
         
     | 
| 
       12 
12 
     | 
    
         
             
                  PryNav::Tracer.new(options).run do
         
     | 
| 
       13 
13 
     | 
    
         
             
                    start_existing(target, old_options)
         
     | 
| 
         @@ -90,7 +90,7 @@ end 
     | 
|
| 
       90 
90 
     | 
    
         
             
            # Ensure cleanup when a program finishes without another break. For example,
         
     | 
| 
       91 
91 
     | 
    
         
             
            # 'next' on the last line of a program never hits the tracer proc, and thus
         
     | 
| 
       92 
92 
     | 
    
         
             
            # PryNav::Tracer#run doesn't have a chance to cleanup.
         
     | 
| 
       93 
     | 
    
         
            -
             
     | 
| 
      
 93 
     | 
    
         
            +
            at_exit do
         
     | 
| 
       94 
94 
     | 
    
         
             
              set_trace_func nil
         
     | 
| 
       95 
95 
     | 
    
         
             
              PryRemote::Server.stop
         
     | 
| 
       96 
     | 
    
         
            -
             
     | 
| 
      
 96 
     | 
    
         
            +
            end
         
     | 
    
        data/lib/pry-nav/tracer.rb
    CHANGED
    
    | 
         @@ -11,9 +11,9 @@ module PryNav 
     | 
|
| 
       11 
11 
     | 
    
         | 
| 
       12 
12 
     | 
    
         
             
                def run(&block)
         
     | 
| 
       13 
13 
     | 
    
         
             
                  # For performance, disable any tracers while in the console.
         
     | 
| 
       14 
     | 
    
         
            -
                  # Unfortunately 
     | 
| 
       15 
     | 
    
         
            -
                  # http://redmine.ruby-lang.org/issues/3921
         
     | 
| 
       16 
     | 
    
         
            -
                  stop  
     | 
| 
      
 14 
     | 
    
         
            +
                  # Unfortunately doesn't work in 1.9.2 because of
         
     | 
| 
      
 15 
     | 
    
         
            +
                  # http://redmine.ruby-lang.org/issues/3921. Works fine in 1.8.7 and 1.9.3.
         
     | 
| 
      
 16 
     | 
    
         
            +
                  stop unless RUBY_VERSION == '1.9.2'
         
     | 
| 
       17 
17 
     | 
    
         | 
| 
       18 
18 
     | 
    
         
             
                  return_value = nil
         
     | 
| 
       19 
19 
     | 
    
         
             
                  command = catch(:breakout_nav) do      # Coordinates with PryNav::Commands
         
     | 
| 
         @@ -25,7 +25,7 @@ module PryNav 
     | 
|
| 
       25 
25 
     | 
    
         
             
                  if process_command(command)
         
     | 
| 
       26 
26 
     | 
    
         
             
                    start
         
     | 
| 
       27 
27 
     | 
    
         
             
                  else
         
     | 
| 
       28 
     | 
    
         
            -
                    stop  
     | 
| 
      
 28 
     | 
    
         
            +
                    stop if RUBY_VERSION == '1.9.2'
         
     | 
| 
       29 
29 
     | 
    
         
             
                    PryRemote::Server.stop if @pry_start_options[:pry_remote]
         
     | 
| 
       30 
30 
     | 
    
         
             
                  end
         
     | 
| 
       31 
31 
     | 
    
         | 
    
        data/lib/pry-nav/version.rb
    CHANGED
    
    
    
        data/pry-nav.gemspec
    CHANGED
    
    | 
         @@ -18,6 +18,6 @@ Gem::Specification.new do |gem| 
     | 
|
| 
       18 
18 
     | 
    
         
             
              gem.require_paths = ["lib"]
         
     | 
| 
       19 
19 
     | 
    
         | 
| 
       20 
20 
     | 
    
         
             
              # Dependencies
         
     | 
| 
       21 
     | 
    
         
            -
              gem.required_ruby_version = '>= 1. 
     | 
| 
       22 
     | 
    
         
            -
              gem.add_runtime_dependency 'pry', '~> 0.9. 
     | 
| 
      
 21 
     | 
    
         
            +
              gem.required_ruby_version = '>= 1.8.7'
         
     | 
| 
      
 22 
     | 
    
         
            +
              gem.add_runtime_dependency 'pry', '~> 0.9.8.1'
         
     | 
| 
       23 
23 
     | 
    
         
             
            end
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: pry-nav
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.0 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.1.0
         
     | 
| 
       5 
5 
     | 
    
         
             
              prerelease: 
         
     | 
| 
       6 
6 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       7 
7 
     | 
    
         
             
            authors:
         
     | 
| 
         @@ -9,19 +9,19 @@ authors: 
     | 
|
| 
       9 
9 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       10 
10 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       11 
11 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       12 
     | 
    
         
            -
            date:  
     | 
| 
      
 12 
     | 
    
         
            +
            date: 2012-02-03 00:00:00.000000000 Z
         
     | 
| 
       13 
13 
     | 
    
         
             
            dependencies:
         
     | 
| 
       14 
14 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       15 
15 
     | 
    
         
             
              name: pry
         
     | 
| 
       16 
     | 
    
         
            -
              requirement: & 
     | 
| 
      
 16 
     | 
    
         
            +
              requirement: &70283139020540 !ruby/object:Gem::Requirement
         
     | 
| 
       17 
17 
     | 
    
         
             
                none: false
         
     | 
| 
       18 
18 
     | 
    
         
             
                requirements:
         
     | 
| 
       19 
19 
     | 
    
         
             
                - - ~>
         
     | 
| 
       20 
20 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       21 
     | 
    
         
            -
                    version: 0.9. 
     | 
| 
      
 21 
     | 
    
         
            +
                    version: 0.9.8.1
         
     | 
| 
       22 
22 
     | 
    
         
             
              type: :runtime
         
     | 
| 
       23 
23 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       24 
     | 
    
         
            -
              version_requirements: * 
     | 
| 
      
 24 
     | 
    
         
            +
              version_requirements: *70283139020540
         
     | 
| 
       25 
25 
     | 
    
         
             
            description: Turn Pry into a primitive debugger. Adds 'step' and 'next' commands to
         
     | 
| 
       26 
26 
     | 
    
         
             
              control execution.
         
     | 
| 
       27 
27 
     | 
    
         
             
            email: nixme@stillhope.com
         
     | 
| 
         @@ -54,7 +54,7 @@ required_ruby_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       54 
54 
     | 
    
         
             
              requirements:
         
     | 
| 
       55 
55 
     | 
    
         
             
              - - ! '>='
         
     | 
| 
       56 
56 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       57 
     | 
    
         
            -
                  version: 1. 
     | 
| 
      
 57 
     | 
    
         
            +
                  version: 1.8.7
         
     | 
| 
       58 
58 
     | 
    
         
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         
     | 
| 
       59 
59 
     | 
    
         
             
              none: false
         
     | 
| 
       60 
60 
     | 
    
         
             
              requirements:
         
     | 
| 
         @@ -63,8 +63,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       63 
63 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       64 
64 
     | 
    
         
             
            requirements: []
         
     | 
| 
       65 
65 
     | 
    
         
             
            rubyforge_project: 
         
     | 
| 
       66 
     | 
    
         
            -
            rubygems_version: 1.8. 
     | 
| 
      
 66 
     | 
    
         
            +
            rubygems_version: 1.8.11
         
     | 
| 
       67 
67 
     | 
    
         
             
            signing_key: 
         
     | 
| 
       68 
68 
     | 
    
         
             
            specification_version: 3
         
     | 
| 
       69 
69 
     | 
    
         
             
            summary: Simple execution navigation for Pry.
         
     | 
| 
       70 
70 
     | 
    
         
             
            test_files: []
         
     | 
| 
      
 71 
     | 
    
         
            +
            has_rdoc: 
         
     |