pry-stack_explorer 0.4.9.3 → 0.6.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 +5 -5
 - data/README.md +47 -49
 - data/lib/pry-stack_explorer/commands.rb +73 -21
 - data/lib/pry-stack_explorer/version.rb +3 -3
 - data/lib/pry-stack_explorer/when_started_hook.rb +3 -1
 - data/lib/pry-stack_explorer.rb +3 -3
 - metadata +28 -44
 - data/.gemtest +0 -0
 - data/.gitignore +0 -7
 - data/.travis.yml +0 -29
 - data/.yardopts +0 -1
 - data/CHANGELOG +0 -0
 - data/Gemfile +0 -2
 - data/Rakefile +0 -112
 - data/examples/example.rb +0 -45
 - data/examples/example2.rb +0 -18
 - data/examples/example3.rb +0 -46
 - data/pry-stack_explorer.gemspec +0 -36
 - data/test/helper.rb +0 -87
 - data/test/test_commands.rb +0 -358
 - data/test/test_frame_manager.rb +0 -65
 - data/test/test_stack_explorer.rb +0 -393
 - data/tester.rb +0 -27
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
     | 
    
         
            -
             
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 2 
     | 
    
         
            +
            SHA256:
         
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 53b80cf3c06d7bdfaec826bed2ad1963a7bc69331d656e73b84d00e97a500197
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 1942e6ad4fd0b43279d860aa06b2ca354b64eac8b713d426996b9a93a12f48d9
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 2c51eb15eb17f9edff667c93fbead5a7ffe7fa1c4cd3114e516a2057e37ab728e8436f5123908d0fac07a823b2a61fbcc50072429fc8f5081c3c85be5bcaf1d2
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 24dc58f1bfda481a2eddee4e294c953e7ead4bee736da3f07bc142f237e7fcb8b41da9a1bd39517ae53fb34a892b7cd9f2faae3240c2e382031b09ba31eced21
         
     | 
    
        data/README.md
    CHANGED
    
    | 
         @@ -1,12 +1,12 @@ 
     | 
|
| 
       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 
     | 
    
         | 
| 
       8 
     | 
    
         
            -
             
     | 
| 
       9 
     | 
    
         
            -
             
     | 
| 
      
 6 
     | 
    
         
            +
            ---
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
            Pry::StackExplorer is a plugin for [Pry](http://pry.github.com)
         
     | 
| 
      
 9 
     | 
    
         
            +
            that allows navigating the call stack.
         
     | 
| 
       10 
10 
     | 
    
         | 
| 
       11 
11 
     | 
    
         
             
            From the point a Pry session is started, the user can move up the stack
         
     | 
| 
       12 
12 
     | 
    
         
             
            through parent frames, examine state, and even evaluate code.
         
     | 
| 
         @@ -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 
     | 
    
         
            -
             
     | 
| 
       19 
     | 
    
         
            -
            Ruby 1.9.2+ (including 1.9.3)**. Support for other Ruby versions and
         
     | 
| 
       20 
     | 
    
         
            -
            implementations is planned for the future.
         
     | 
| 
       21 
     | 
    
         
            -
             
     | 
| 
       22 
     | 
    
         
            -
            The `up`, `down`, `frame` and `show-stack` commands are provided. See
         
     | 
| 
      
 18 
     | 
    
         
            +
            The `up`, `down`, `frame` and `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.
         
     | 
| 
       26 
23 
     | 
    
         | 
| 
       27 
     | 
    
         
            -
             
     | 
| 
      
 24 
     | 
    
         
            +
            Commands:
         
     | 
| 
      
 25 
     | 
    
         
            +
            * `up`/`down` - Move up or down the call stack
         
     | 
| 
      
 26 
     | 
    
         
            +
            * `frame [n]` - Go to frame *n*
         
     | 
| 
      
 27 
     | 
    
         
            +
            * `stack` - Show call stack
         
     | 
| 
       28 
28 
     | 
    
         | 
| 
       29 
     | 
    
         
            -
            * Install the [gem](https://rubygems.org/gems/pry-stack_explorer): `gem install pry-stack_explorer`
         
     | 
| 
       30 
     | 
    
         
            -
            * 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 
     | 
    
         
            -
            * See the [wiki](https://github.com/pry/pry-stack_explorer/wiki) for in-depth usage information.
         
     | 
| 
       33 
29 
     | 
    
         | 
| 
       34 
     | 
    
         
            -
             
     | 
| 
       35 
     | 
    
         
            -
            --------
         
     | 
| 
      
 30 
     | 
    
         
            +
            ## Install
         
     | 
| 
       36 
31 
     | 
    
         | 
| 
       37 
     | 
    
         
            -
             
     | 
| 
      
 32 
     | 
    
         
            +
            In Gemfile:
         
     | 
| 
      
 33 
     | 
    
         
            +
            ```rb
         
     | 
| 
      
 34 
     | 
    
         
            +
            gem 'pry-stack_explorer', '~> 0.6.0'
         
     | 
| 
      
 35 
     | 
    
         
            +
            ```
         
     | 
| 
       38 
36 
     | 
    
         | 
| 
       39 
     | 
    
         
            -
             
     | 
| 
       40 
     | 
    
         
            -
             
     | 
| 
      
 37 
     | 
    
         
            +
            ```
         
     | 
| 
      
 38 
     | 
    
         
            +
            gem install pry-stack_explorer
         
     | 
| 
      
 39 
     | 
    
         
            +
            ```
         
     | 
| 
       41 
40 
     | 
    
         | 
| 
       42 
     | 
    
         
            -
            [ 
     | 
| 
      
 41 
     | 
    
         
            +
            * Read the [documentation](http://rdoc.info/github/banister/pry-stack_explorer/master/file/README.md)
         
     | 
| 
      
 42 
     | 
    
         
            +
            * See the [wiki](https://github.com/pry/pry-stack_explorer/wiki) for in-depth usage information.
         
     | 
| 
       43 
43 
     | 
    
         | 
| 
       44 
     | 
    
         
            -
            Output from above is `goodbye` as we changed the `x` local inside the `alpha` (caller) stack frame.
         
     | 
| 
       45 
44 
     | 
    
         | 
| 
       46 
     | 
    
         
            -
             
     | 
| 
       47 
     | 
    
         
            -
             
     | 
| 
      
 45 
     | 
    
         
            +
            ### Branches and compatible Ruby versions
         
     | 
| 
      
 46 
     | 
    
         
            +
            * v0.5, v0.6: Ruby 2.6+, Pry 0.13+
         
     | 
| 
      
 47 
     | 
    
         
            +
            * v0.4.11+: Ruby 2.5, Pry 0.12+ (branch `0-4` – end-of-life in March 2021)
         
     | 
| 
      
 48 
     | 
    
         
            +
            * v0.4.9.3: Older versions (unsupported)
         
     | 
| 
       48 
49 
     | 
    
         | 
| 
       49 
     | 
    
         
            -
             
     | 
| 
       50 
     | 
    
         
            -
             
     | 
| 
      
 50 
     | 
    
         
            +
            Example:
         
     | 
| 
      
 51 
     | 
    
         
            +
            --------
         
     | 
| 
      
 52 
     | 
    
         
            +
            Here we run the following ruby script:
         
     | 
| 
      
 53 
     | 
    
         
            +
            ```Ruby
         
     | 
| 
      
 54 
     | 
    
         
            +
            require 'pry-stack_explorer'
         
     | 
| 
       51 
55 
     | 
    
         | 
| 
       52 
     | 
    
         
            -
             
     | 
| 
       53 
     | 
    
         
            -
             
     | 
| 
      
 56 
     | 
    
         
            +
            def alpha
         
     | 
| 
      
 57 
     | 
    
         
            +
              x = "hello"
         
     | 
| 
      
 58 
     | 
    
         
            +
              beta
         
     | 
| 
      
 59 
     | 
    
         
            +
              puts x
         
     | 
| 
      
 60 
     | 
    
         
            +
            end
         
     | 
| 
       54 
61 
     | 
    
         | 
| 
       55 
     | 
    
         
            -
             
     | 
| 
      
 62 
     | 
    
         
            +
            def beta
         
     | 
| 
      
 63 
     | 
    
         
            +
              binding.pry
         
     | 
| 
      
 64 
     | 
    
         
            +
            end
         
     | 
| 
       56 
65 
     | 
    
         | 
| 
      
 66 
     | 
    
         
            +
            alpha
         
     | 
| 
      
 67 
     | 
    
         
            +
            ```
         
     | 
| 
       57 
68 
     | 
    
         | 
| 
       58 
     | 
    
         
            -
             
     | 
| 
       59 
     | 
    
         
            -
            -------
         
     | 
| 
      
 69 
     | 
    
         
            +
            We wander around the stack a little bit, and modify the state of a frame above the one we `binding.pry`'d at.
         
     | 
| 
       60 
70 
     | 
    
         | 
| 
       61 
     | 
    
         
            -
            ( 
     | 
| 
      
 71 
     | 
    
         
            +
            [](https://asciinema.org/a/257713)
         
     | 
| 
       62 
72 
     | 
    
         | 
| 
       63 
     | 
    
         
            -
             
     | 
| 
      
 73 
     | 
    
         
            +
            Output from above is `Goodbye` as we changed the `x` local inside the `alpha` (caller) stack frame.
         
     | 
| 
       64 
74 
     | 
    
         | 
| 
       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 
75 
     | 
    
         | 
| 
       73 
     | 
    
         
            -
             
     | 
| 
       74 
     | 
    
         
            -
             
     | 
| 
      
 76 
     | 
    
         
            +
            License
         
     | 
| 
      
 77 
     | 
    
         
            +
            -------
         
     | 
| 
      
 78 
     | 
    
         
            +
            Released under the [MIT License](https://github.com/pry/pry-stack_explorer/blob/master/LICENSE) by John Mair (banisterfiend) and contributors
         
     | 
| 
       75 
79 
     | 
    
         | 
| 
       76 
     | 
    
         
            -
             
     | 
| 
       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.
         
     | 
| 
         @@ -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
         
     | 
| 
         @@ -55,7 +55,7 @@ module PryStackExplorer 
     | 
|
| 
       55 
55 
     | 
    
         
             
                  sig = meth_obj ? "<#{signature_with_owner(meth_obj)}>" : ""
         
     | 
| 
       56 
56 
     | 
    
         | 
| 
       57 
57 
     | 
    
         
             
                  self_clipped = "#{Pry.view_clip(b_self)}"
         
     | 
| 
       58 
     | 
    
         
            -
                  path =  
     | 
| 
      
 58 
     | 
    
         
            +
                  path = '@ ' + b.source_location.join(':')
         
     | 
| 
       59 
59 
     | 
    
         | 
| 
       60 
60 
     | 
    
         
             
                  if !verbose
         
     | 
| 
       61 
61 
     | 
    
         
             
                    "#{type} #{desc} #{sig}"
         
     | 
| 
         @@ -231,13 +231,15 @@ module PryStackExplorer 
     | 
|
| 
       231 
231 
     | 
    
         
             
                  end
         
     | 
| 
       232 
232 
     | 
    
         
             
                end
         
     | 
| 
       233 
233 
     | 
    
         | 
| 
       234 
     | 
    
         
            -
                create_command " 
     | 
| 
      
 234 
     | 
    
         
            +
                create_command "stack", "Show all frames" do
         
     | 
| 
       235 
235 
     | 
    
         
             
                  include FrameHelpers
         
     | 
| 
       236 
236 
     | 
    
         | 
| 
       237 
237 
     | 
    
         
             
                  banner <<-BANNER
         
     | 
| 
       238 
     | 
    
         
            -
                    Usage:  
     | 
| 
      
 238 
     | 
    
         
            +
                    Usage: stack [OPTIONS]
         
     | 
| 
       239 
239 
     | 
    
         
             
                      Show all accessible stack frames.
         
     | 
| 
       240 
     | 
    
         
            -
                      e.g:  
     | 
| 
      
 240 
     | 
    
         
            +
                      e.g: stack -v
         
     | 
| 
      
 241 
     | 
    
         
            +
             
     | 
| 
      
 242 
     | 
    
         
            +
                      alias: show-stack
         
     | 
| 
       241 
243 
     | 
    
         
             
                  BANNER
         
     | 
| 
       242 
244 
     | 
    
         | 
| 
       243 
245 
     | 
    
         
             
                  def options(opt)
         
     | 
| 
         @@ -245,6 +247,7 @@ module PryStackExplorer 
     | 
|
| 
       245 
247 
     | 
    
         
             
                    opt.on :H, :head, "Display the first N stack frames (defaults to 10).", :optional_argument => true, :as => Integer, :default => 10
         
     | 
| 
       246 
248 
     | 
    
         
             
                    opt.on :T, :tail, "Display the last N stack frames (defaults to 10).", :optional_argument => true, :as => Integer, :default => 10
         
     | 
| 
       247 
249 
     | 
    
         
             
                    opt.on :c, :current, "Display N frames either side of current frame (default to 5).", :optional_argument => true, :as => Integer, :default => 5
         
     | 
| 
      
 250 
     | 
    
         
            +
                    opt.on :a, :app, "Display application frames only", optional_argument: true
         
     | 
| 
       248 
251 
     | 
    
         
             
                  end
         
     | 
| 
       249 
252 
     | 
    
         | 
| 
       250 
253 
     | 
    
         
             
                  def memoized_info(index, b, verbose)
         
     | 
| 
         @@ -288,26 +291,75 @@ module PryStackExplorer 
     | 
|
| 
       288 
291 
     | 
    
         
             
                  private :selected_stack_frames
         
     | 
| 
       289 
292 
     | 
    
         | 
| 
       290 
293 
     | 
    
         
             
                  def process
         
     | 
| 
       291 
     | 
    
         
            -
                     
     | 
| 
       292 
     | 
    
         
            -
             
     | 
| 
      
 294 
     | 
    
         
            +
                    return no_stack_available! unless frame_manager
         
     | 
| 
      
 295 
     | 
    
         
            +
             
     | 
| 
      
 296 
     | 
    
         
            +
                    title = "Showing all accessible frames in stack (#{frame_manager.bindings.size} in total):"
         
     | 
| 
      
 297 
     | 
    
         
            +
             
     | 
| 
      
 298 
     | 
    
         
            +
                    content = [
         
     | 
| 
      
 299 
     | 
    
         
            +
                      bold(title),
         
     | 
| 
      
 300 
     | 
    
         
            +
                      "---",
         
     | 
| 
      
 301 
     | 
    
         
            +
                      make_stack_lines
         
     | 
| 
      
 302 
     | 
    
         
            +
                    ].join("\n")
         
     | 
| 
      
 303 
     | 
    
         
            +
             
     | 
| 
      
 304 
     | 
    
         
            +
                    stagger_output content
         
     | 
| 
      
 305 
     | 
    
         
            +
                  end
         
     | 
| 
      
 306 
     | 
    
         
            +
             
     | 
| 
      
 307 
     | 
    
         
            +
                  private
         
     | 
| 
      
 308 
     | 
    
         
            +
             
     | 
| 
      
 309 
     | 
    
         
            +
                  def make_stack_lines
         
     | 
| 
      
 310 
     | 
    
         
            +
                    frames_with_indices.map do |b, i|
         
     | 
| 
      
 311 
     | 
    
         
            +
                      make_stack_line(b, i, (i == frame_manager.binding_index))
         
     | 
| 
      
 312 
     | 
    
         
            +
                    end.join("\n")
         
     | 
| 
      
 313 
     | 
    
         
            +
                  end
         
     | 
| 
      
 314 
     | 
    
         
            +
             
     | 
| 
      
 315 
     | 
    
         
            +
                  def frames_with_indices
         
     | 
| 
      
 316 
     | 
    
         
            +
                    if opts.present?(:app) && defined?(ActiveSupport::BacktraceCleaner)
         
     | 
| 
      
 317 
     | 
    
         
            +
                      app_frames
         
     | 
| 
       293 
318 
     | 
    
         
             
                    else
         
     | 
| 
       294 
     | 
    
         
            -
                       
     | 
| 
       295 
     | 
    
         
            -
             
     | 
| 
       296 
     | 
    
         
            -
             
     | 
| 
       297 
     | 
    
         
            -
                      base_frame_index, frames = selected_stack_frames
         
     | 
| 
       298 
     | 
    
         
            -
                      frames.each_with_index do |b, index|
         
     | 
| 
       299 
     | 
    
         
            -
                        i = index + base_frame_index
         
     | 
| 
       300 
     | 
    
         
            -
                        if i == frame_manager.binding_index
         
     | 
| 
       301 
     | 
    
         
            -
                          content << "=> ##{i} #{memoized_info(i, b, opts[:v])}\n"
         
     | 
| 
       302 
     | 
    
         
            -
                        else
         
     | 
| 
       303 
     | 
    
         
            -
                          content << "   ##{i} #{memoized_info(i, b, opts[:v])}\n"
         
     | 
| 
       304 
     | 
    
         
            -
                        end
         
     | 
| 
       305 
     | 
    
         
            -
                      end
         
     | 
| 
      
 319 
     | 
    
         
            +
                      offset_frames
         
     | 
| 
      
 320 
     | 
    
         
            +
                    end
         
     | 
| 
      
 321 
     | 
    
         
            +
                  end
         
     | 
| 
       306 
322 
     | 
    
         | 
| 
       307 
     | 
    
         
            -
             
     | 
| 
      
 323 
     | 
    
         
            +
                  # "=> #0  method_name <Class#method(...)>"
         
     | 
| 
      
 324 
     | 
    
         
            +
                  def make_stack_line(b, i, active)
         
     | 
| 
      
 325 
     | 
    
         
            +
                    arw = active ? "=>" : "  "
         
     | 
| 
      
 326 
     | 
    
         
            +
             
     | 
| 
      
 327 
     | 
    
         
            +
                    "#{arw} ##{i} #{memoized_info(i, b, opts[:v])}"
         
     | 
| 
      
 328 
     | 
    
         
            +
                  end
         
     | 
| 
      
 329 
     | 
    
         
            +
             
     | 
| 
      
 330 
     | 
    
         
            +
                  def offset_frames
         
     | 
| 
      
 331 
     | 
    
         
            +
                    base_frame_index, frames = selected_stack_frames
         
     | 
| 
      
 332 
     | 
    
         
            +
             
     | 
| 
      
 333 
     | 
    
         
            +
                    frames.each_with_index.map do |frame, index|
         
     | 
| 
      
 334 
     | 
    
         
            +
                      [frame, index + base_frame_index]
         
     | 
| 
       308 
335 
     | 
    
         
             
                    end
         
     | 
| 
       309 
336 
     | 
    
         
             
                  end
         
     | 
| 
       310 
337 
     | 
    
         | 
| 
      
 338 
     | 
    
         
            +
                  def no_stack_available!
         
     | 
| 
      
 339 
     | 
    
         
            +
                    output.puts "No caller stack available!"
         
     | 
| 
      
 340 
     | 
    
         
            +
                  end
         
     | 
| 
      
 341 
     | 
    
         
            +
             
     | 
| 
      
 342 
     | 
    
         
            +
                  LOCATION_LAMBDA = ->(_binding){ _binding.source_location[0] }
         
     | 
| 
      
 343 
     | 
    
         
            +
             
     | 
| 
      
 344 
     | 
    
         
            +
                  def app_frames
         
     | 
| 
      
 345 
     | 
    
         
            +
                    locations = frame_manager.bindings.map(&LOCATION_LAMBDA)
         
     | 
| 
      
 346 
     | 
    
         
            +
                    filtered = backtrace_cleaner.clean(locations)
         
     | 
| 
      
 347 
     | 
    
         
            +
             
     | 
| 
      
 348 
     | 
    
         
            +
                    frame_manager.bindings
         
     | 
| 
      
 349 
     | 
    
         
            +
                      .each_with_index
         
     | 
| 
      
 350 
     | 
    
         
            +
                      .map
         
     | 
| 
      
 351 
     | 
    
         
            +
                      .select do |_binding, _index|
         
     | 
| 
      
 352 
     | 
    
         
            +
                        LOCATION_LAMBDA.call(_binding).in?(filtered)
         
     | 
| 
      
 353 
     | 
    
         
            +
                      end
         
     | 
| 
      
 354 
     | 
    
         
            +
                  end
         
     | 
| 
      
 355 
     | 
    
         
            +
             
     | 
| 
      
 356 
     | 
    
         
            +
                  # also see Rails::BacktraceCleaner
         
     | 
| 
      
 357 
     | 
    
         
            +
                  def backtrace_cleaner
         
     | 
| 
      
 358 
     | 
    
         
            +
                    @backtrace_cleaner ||= ActiveSupport::BacktraceCleaner.new
         
     | 
| 
      
 359 
     | 
    
         
            +
                  end
         
     | 
| 
       311 
360 
     | 
    
         
             
                end
         
     | 
| 
      
 361 
     | 
    
         
            +
             
     | 
| 
      
 362 
     | 
    
         
            +
                alias_command "show-stack", "stack"
         
     | 
| 
      
 363 
     | 
    
         
            +
             
     | 
| 
       312 
364 
     | 
    
         
             
              end
         
     | 
| 
       313 
365 
     | 
    
         
             
            end
         
     | 
| 
         @@ -1,3 +1,3 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            module PryStackExplorer
         
     | 
| 
       2 
     | 
    
         
            -
              VERSION = '0. 
     | 
| 
       3 
     | 
    
         
            -
            end
         
     | 
| 
      
 1 
     | 
    
         
            +
            module PryStackExplorer
         
     | 
| 
      
 2 
     | 
    
         
            +
              VERSION = '0.6.1'
         
     | 
| 
      
 3 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -47,6 +47,8 @@ module PryStackExplorer 
     | 
|
| 
       47 
47 
     | 
    
         
             
                # remove internal frames related to setting up the session
         
     | 
| 
       48 
48 
     | 
    
         
             
                def remove_internal_frames(bindings)
         
     | 
| 
       49 
49 
     | 
    
         
             
                  start_frames = internal_frames_with_indices(bindings)
         
     | 
| 
      
 50 
     | 
    
         
            +
                  return bindings if start_frames.empty?
         
     | 
| 
      
 51 
     | 
    
         
            +
             
     | 
| 
       50 
52 
     | 
    
         
             
                  start_frame_index = start_frames.first.last
         
     | 
| 
       51 
53 
     | 
    
         | 
| 
       52 
54 
     | 
    
         
             
                  if start_frames.size >= 2
         
     | 
| 
         @@ -60,7 +62,7 @@ module PryStackExplorer 
     | 
|
| 
       60 
62 
     | 
    
         | 
| 
       61 
63 
     | 
    
         
             
                # remove pry-nav / pry-debugger / pry-byebug frames
         
     | 
| 
       62 
64 
     | 
    
         
             
                def remove_debugger_frames(bindings)
         
     | 
| 
       63 
     | 
    
         
            -
                  bindings.drop_while { |b| b. 
     | 
| 
      
 65 
     | 
    
         
            +
                  bindings.drop_while { |b| b.source_location[0] =~ /pry-(?:nav|debugger|byebug)/ }
         
     | 
| 
       64 
66 
     | 
    
         
             
                end
         
     | 
| 
       65 
67 
     | 
    
         | 
| 
       66 
68 
     | 
    
         
             
                # binding.pry frame
         
     | 
    
        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}"
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,57 +1,57 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: pry-stack_explorer
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.6.1
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - John Mair (banisterfiend)
         
     | 
| 
       8 
     | 
    
         
            -
            autorequire: 
     | 
| 
      
 8 
     | 
    
         
            +
            autorequire:
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date:  
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2021-02-08 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 
     | 
    
         
            -
                    version: '0 
     | 
| 
      
 19 
     | 
    
         
            +
                    version: '1.0'
         
     | 
| 
       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 
     | 
    
         
            -
                    version: '0 
     | 
| 
      
 26 
     | 
    
         
            +
                    version: '1.0'
         
     | 
| 
       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 
     | 
    
         
            -
              name:  
     | 
| 
      
 42 
     | 
    
         
            +
              name: rspec
         
     | 
| 
       43 
43 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       44 
44 
     | 
    
         
             
                requirements:
         
     | 
| 
       45 
45 
     | 
    
         
             
                - - "~>"
         
     | 
| 
       46 
46 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       47 
     | 
    
         
            -
                    version:  
     | 
| 
      
 47 
     | 
    
         
            +
                    version: '3.9'
         
     | 
| 
       48 
48 
     | 
    
         
             
              type: :development
         
     | 
| 
       49 
49 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       50 
50 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       51 
51 
     | 
    
         
             
                requirements:
         
     | 
| 
       52 
52 
     | 
    
         
             
                - - "~>"
         
     | 
| 
       53 
53 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       54 
     | 
    
         
            -
                    version:  
     | 
| 
      
 54 
     | 
    
         
            +
                    version: '3.9'
         
     | 
| 
       55 
55 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       56 
56 
     | 
    
         
             
              name: rake
         
     | 
| 
       57 
57 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
         @@ -66,39 +66,28 @@ dependencies: 
     | 
|
| 
       66 
66 
     | 
    
         
             
                - - "~>"
         
     | 
| 
       67 
67 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       68 
68 
     | 
    
         
             
                    version: '0.9'
         
     | 
| 
       69 
     | 
    
         
            -
            description: 
     | 
| 
       70 
     | 
    
         
            -
            email: 
     | 
| 
      
 69 
     | 
    
         
            +
            description:
         
     | 
| 
      
 70 
     | 
    
         
            +
            email:
         
     | 
| 
      
 71 
     | 
    
         
            +
            - jrmair@gmail.com
         
     | 
| 
       71 
72 
     | 
    
         
             
            executables: []
         
     | 
| 
       72 
73 
     | 
    
         
             
            extensions: []
         
     | 
| 
       73 
74 
     | 
    
         
             
            extra_rdoc_files: []
         
     | 
| 
       74 
75 
     | 
    
         
             
            files:
         
     | 
| 
       75 
     | 
    
         
            -
            - ".gemtest"
         
     | 
| 
       76 
     | 
    
         
            -
            - ".gitignore"
         
     | 
| 
       77 
     | 
    
         
            -
            - ".travis.yml"
         
     | 
| 
       78 
     | 
    
         
            -
            - ".yardopts"
         
     | 
| 
       79 
     | 
    
         
            -
            - CHANGELOG
         
     | 
| 
       80 
     | 
    
         
            -
            - Gemfile
         
     | 
| 
       81 
76 
     | 
    
         
             
            - LICENSE
         
     | 
| 
       82 
77 
     | 
    
         
             
            - README.md
         
     | 
| 
       83 
     | 
    
         
            -
            - Rakefile
         
     | 
| 
       84 
     | 
    
         
            -
            - examples/example.rb
         
     | 
| 
       85 
     | 
    
         
            -
            - examples/example2.rb
         
     | 
| 
       86 
     | 
    
         
            -
            - examples/example3.rb
         
     | 
| 
       87 
78 
     | 
    
         
             
            - lib/pry-stack_explorer.rb
         
     | 
| 
       88 
79 
     | 
    
         
             
            - lib/pry-stack_explorer/commands.rb
         
     | 
| 
       89 
80 
     | 
    
         
             
            - lib/pry-stack_explorer/frame_manager.rb
         
     | 
| 
       90 
81 
     | 
    
         
             
            - lib/pry-stack_explorer/version.rb
         
     | 
| 
       91 
82 
     | 
    
         
             
            - lib/pry-stack_explorer/when_started_hook.rb
         
     | 
| 
       92 
     | 
    
         
            -
            - pry-stack_explorer.gemspec
         
     | 
| 
       93 
     | 
    
         
            -
            - test/helper.rb
         
     | 
| 
       94 
     | 
    
         
            -
            - test/test_commands.rb
         
     | 
| 
       95 
     | 
    
         
            -
            - test/test_frame_manager.rb
         
     | 
| 
       96 
     | 
    
         
            -
            - test/test_stack_explorer.rb
         
     | 
| 
       97 
     | 
    
         
            -
            - tester.rb
         
     | 
| 
       98 
83 
     | 
    
         
             
            homepage: https://github.com/pry/pry-stack_explorer
         
     | 
| 
       99 
     | 
    
         
            -
            licenses: 
     | 
| 
       100 
     | 
    
         
            -
             
     | 
| 
       101 
     | 
    
         
            -
             
     | 
| 
      
 84 
     | 
    
         
            +
            licenses:
         
     | 
| 
      
 85 
     | 
    
         
            +
            - MIT
         
     | 
| 
      
 86 
     | 
    
         
            +
            metadata:
         
     | 
| 
      
 87 
     | 
    
         
            +
              bug_tracker_uri: https://github.com/pry/pry-stack_explorer/issues
         
     | 
| 
      
 88 
     | 
    
         
            +
              source_code_uri: https://github.com/pry/pry-stack_explorer
         
     | 
| 
      
 89 
     | 
    
         
            +
              changelog_uri: https://github.com/pry/pry-stack_explorer/blob/master/CHANGELOG
         
     | 
| 
      
 90 
     | 
    
         
            +
            post_install_message:
         
     | 
| 
       102 
91 
     | 
    
         
             
            rdoc_options: []
         
     | 
| 
       103 
92 
     | 
    
         
             
            require_paths:
         
     | 
| 
       104 
93 
     | 
    
         
             
            - lib
         
     | 
| 
         @@ -106,20 +95,15 @@ required_ruby_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       106 
95 
     | 
    
         
             
              requirements:
         
     | 
| 
       107 
96 
     | 
    
         
             
              - - ">="
         
     | 
| 
       108 
97 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       109 
     | 
    
         
            -
                  version:  
     | 
| 
      
 98 
     | 
    
         
            +
                  version: 2.6.0
         
     | 
| 
       110 
99 
     | 
    
         
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         
     | 
| 
       111 
100 
     | 
    
         
             
              requirements:
         
     | 
| 
       112 
101 
     | 
    
         
             
              - - ">="
         
     | 
| 
       113 
102 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       114 
103 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       115 
104 
     | 
    
         
             
            requirements: []
         
     | 
| 
       116 
     | 
    
         
            -
             
     | 
| 
       117 
     | 
    
         
            -
             
     | 
| 
       118 
     | 
    
         
            -
            signing_key: 
         
     | 
| 
      
 105 
     | 
    
         
            +
            rubygems_version: 3.2.3
         
     | 
| 
      
 106 
     | 
    
         
            +
            signing_key:
         
     | 
| 
       119 
107 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       120 
108 
     | 
    
         
             
            summary: Walk the stack in a Pry session
         
     | 
| 
       121 
     | 
    
         
            -
            test_files:
         
     | 
| 
       122 
     | 
    
         
            -
            - test/helper.rb
         
     | 
| 
       123 
     | 
    
         
            -
            - test/test_commands.rb
         
     | 
| 
       124 
     | 
    
         
            -
            - test/test_frame_manager.rb
         
     | 
| 
       125 
     | 
    
         
            -
            - test/test_stack_explorer.rb
         
     | 
| 
      
 109 
     | 
    
         
            +
            test_files: []
         
     | 
    
        data/.gemtest
    DELETED
    
    | 
         
            File without changes
         
     | 
    
        data/.gitignore
    DELETED
    
    
    
        data/.travis.yml
    DELETED
    
    | 
         @@ -1,29 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            script:
         
     | 
| 
       2 
     | 
    
         
            -
              rake test --trace
         
     | 
| 
       3 
     | 
    
         
            -
             
     | 
| 
       4 
     | 
    
         
            -
            before_install:
         
     | 
| 
       5 
     | 
    
         
            -
              - gem update --system
         
     | 
| 
       6 
     | 
    
         
            -
             
     | 
| 
       7 
     | 
    
         
            -
            rvm:
         
     | 
| 
       8 
     | 
    
         
            -
              - 1.9.3
         
     | 
| 
       9 
     | 
    
         
            -
              - 2.0
         
     | 
| 
       10 
     | 
    
         
            -
              - 2.1.10
         
     | 
| 
       11 
     | 
    
         
            -
              - 2.2.9
         
     | 
| 
       12 
     | 
    
         
            -
              - 2.3.6
         
     | 
| 
       13 
     | 
    
         
            -
              - 2.4.3
         
     | 
| 
       14 
     | 
    
         
            -
              - 2.5.0
         
     | 
| 
       15 
     | 
    
         
            -
              - ruby-head
         
     | 
| 
       16 
     | 
    
         
            -
             
     | 
| 
       17 
     | 
    
         
            -
            matrix:
         
     | 
| 
       18 
     | 
    
         
            -
              allow_failures:
         
     | 
| 
       19 
     | 
    
         
            -
                - rmv: ruby-head
         
     | 
| 
       20 
     | 
    
         
            -
              fast_finish: true
         
     | 
| 
       21 
     | 
    
         
            -
             
     | 
| 
       22 
     | 
    
         
            -
            notifications:
         
     | 
| 
       23 
     | 
    
         
            -
              irc: "irc.freenode.org#pry"
         
     | 
| 
       24 
     | 
    
         
            -
              recipients:
         
     | 
| 
       25 
     | 
    
         
            -
                - jrmair@gmail.com
         
     | 
| 
       26 
     | 
    
         
            -
             
     | 
| 
       27 
     | 
    
         
            -
            branches:
         
     | 
| 
       28 
     | 
    
         
            -
              only:
         
     | 
| 
       29 
     | 
    
         
            -
                - master
         
     | 
    
        data/.yardopts
    DELETED
    
    | 
         @@ -1 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            --markup markdown
         
     | 
    
        data/CHANGELOG
    DELETED
    
    | 
         
            File without changes
         
     | 
    
        data/Gemfile
    DELETED
    
    
    
        data/Rakefile
    DELETED
    
    | 
         @@ -1,112 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            $:.unshift 'lib'
         
     | 
| 
       2 
     | 
    
         
            -
             
     | 
| 
       3 
     | 
    
         
            -
            dlext = RbConfig::CONFIG['DLEXT']
         
     | 
| 
       4 
     | 
    
         
            -
            direc = File.dirname(__FILE__)
         
     | 
| 
       5 
     | 
    
         
            -
             
     | 
| 
       6 
     | 
    
         
            -
            PROJECT_NAME = "pry-stack_explorer"
         
     | 
| 
       7 
     | 
    
         
            -
             
     | 
| 
       8 
     | 
    
         
            -
            require 'rake/clean'
         
     | 
| 
       9 
     | 
    
         
            -
            require 'rubygems/package_task'
         
     | 
| 
       10 
     | 
    
         
            -
            require "#{PROJECT_NAME}/version"
         
     | 
| 
       11 
     | 
    
         
            -
             
     | 
| 
       12 
     | 
    
         
            -
            CLOBBER.include("**/*~", "**/*#*", "**/*.log")
         
     | 
| 
       13 
     | 
    
         
            -
            CLEAN.include("**/*#*", "**/*#*.*", "**/*_flymake*.*", "**/*_flymake",
         
     | 
| 
       14 
     | 
    
         
            -
                          "**/*.rbc", "**/.#*.*")
         
     | 
| 
       15 
     | 
    
         
            -
             
     | 
| 
       16 
     | 
    
         
            -
            def apply_spec_defaults(s)
         
     | 
| 
       17 
     | 
    
         
            -
              s.name = PROJECT_NAME
         
     | 
| 
       18 
     | 
    
         
            -
              s.summary = "Walk the stack in a Pry session"
         
     | 
| 
       19 
     | 
    
         
            -
              s.version = PryStackExplorer::VERSION
         
     | 
| 
       20 
     | 
    
         
            -
              s.date = Time.now.strftime '%Y-%m-%d'
         
     | 
| 
       21 
     | 
    
         
            -
              s.author = "John Mair (banisterfiend)"
         
     | 
| 
       22 
     | 
    
         
            -
              s.email = 'jrmair@gmail.com'
         
     | 
| 
       23 
     | 
    
         
            -
              s.description = s.summary
         
     | 
| 
       24 
     | 
    
         
            -
              s.require_path = 'lib'
         
     | 
| 
       25 
     | 
    
         
            -
              s.add_dependency("binding_of_caller",">= 0.7")
         
     | 
| 
       26 
     | 
    
         
            -
              s.add_dependency("pry",">=0.9.11")
         
     | 
| 
       27 
     | 
    
         
            -
              s.add_development_dependency("bacon","~>1.1.0")
         
     | 
| 
       28 
     | 
    
         
            -
              s.add_development_dependency('rake', '~> 0.9')
         
     | 
| 
       29 
     | 
    
         
            -
              s.homepage = "https://github.com/pry/pry-stack_explorer"
         
     | 
| 
       30 
     | 
    
         
            -
              s.files = `git ls-files`.split("\n")
         
     | 
| 
       31 
     | 
    
         
            -
              s.test_files = `git ls-files -- test/*`.split("\n")
         
     | 
| 
       32 
     | 
    
         
            -
            end
         
     | 
| 
       33 
     | 
    
         
            -
             
     | 
| 
       34 
     | 
    
         
            -
            desc "run pry with plugin enabled"
         
     | 
| 
       35 
     | 
    
         
            -
            task :pry do
         
     | 
| 
       36 
     | 
    
         
            -
              exec("pry -rubygems -I#{direc}/lib/ -r #{direc}/lib/#{PROJECT_NAME}")
         
     | 
| 
       37 
     | 
    
         
            -
            end
         
     | 
| 
       38 
     | 
    
         
            -
             
     | 
| 
       39 
     | 
    
         
            -
            desc "Run example"
         
     | 
| 
       40 
     | 
    
         
            -
            task :example do
         
     | 
| 
       41 
     | 
    
         
            -
              sh "ruby -rubygems -I#{direc}/lib/ #{direc}/examples/example.rb "
         
     | 
| 
       42 
     | 
    
         
            -
            end
         
     | 
| 
       43 
     | 
    
         
            -
             
     | 
| 
       44 
     | 
    
         
            -
            desc "Run example2"
         
     | 
| 
       45 
     | 
    
         
            -
            task :example2 do
         
     | 
| 
       46 
     | 
    
         
            -
              sh "ruby -I#{direc}/lib/ #{direc}/examples/example2.rb "
         
     | 
| 
       47 
     | 
    
         
            -
            end
         
     | 
| 
       48 
     | 
    
         
            -
             
     | 
| 
       49 
     | 
    
         
            -
            desc "Run example3"
         
     | 
| 
       50 
     | 
    
         
            -
            task :example3 do
         
     | 
| 
       51 
     | 
    
         
            -
              sh "ruby -I#{direc}/lib/ #{direc}/examples/example3.rb "
         
     | 
| 
       52 
     | 
    
         
            -
            end
         
     | 
| 
       53 
     | 
    
         
            -
             
     | 
| 
       54 
     | 
    
         
            -
            desc "Show version"
         
     | 
| 
       55 
     | 
    
         
            -
            task :version do
         
     | 
| 
       56 
     | 
    
         
            -
              puts "PryStackExplorer version: #{PryStackExplorer::VERSION}"
         
     | 
| 
       57 
     | 
    
         
            -
            end
         
     | 
| 
       58 
     | 
    
         
            -
             
     | 
| 
       59 
     | 
    
         
            -
            desc "run tests"
         
     | 
| 
       60 
     | 
    
         
            -
            task :default => :test
         
     | 
| 
       61 
     | 
    
         
            -
             
     | 
| 
       62 
     | 
    
         
            -
            desc "run tests"
         
     | 
| 
       63 
     | 
    
         
            -
            task :test do
         
     | 
| 
       64 
     | 
    
         
            -
              sh "bacon -Itest -rubygems -a -q"
         
     | 
| 
       65 
     | 
    
         
            -
            end
         
     | 
| 
       66 
     | 
    
         
            -
             
     | 
| 
       67 
     | 
    
         
            -
            desc "generate gemspec"
         
     | 
| 
       68 
     | 
    
         
            -
            task :gemspec => "ruby:gemspec"
         
     | 
| 
       69 
     | 
    
         
            -
             
     | 
| 
       70 
     | 
    
         
            -
            namespace :ruby do
         
     | 
| 
       71 
     | 
    
         
            -
              spec = Gem::Specification.new do |s|
         
     | 
| 
       72 
     | 
    
         
            -
                apply_spec_defaults(s)
         
     | 
| 
       73 
     | 
    
         
            -
                s.platform = Gem::Platform::RUBY
         
     | 
| 
       74 
     | 
    
         
            -
              end
         
     | 
| 
       75 
     | 
    
         
            -
             
     | 
| 
       76 
     | 
    
         
            -
              Gem::PackageTask.new(spec) do |pkg|
         
     | 
| 
       77 
     | 
    
         
            -
                pkg.need_zip = false
         
     | 
| 
       78 
     | 
    
         
            -
                pkg.need_tar = false
         
     | 
| 
       79 
     | 
    
         
            -
              end
         
     | 
| 
       80 
     | 
    
         
            -
             
     | 
| 
       81 
     | 
    
         
            -
              desc  "Generate gemspec file"
         
     | 
| 
       82 
     | 
    
         
            -
              task :gemspec do
         
     | 
| 
       83 
     | 
    
         
            -
                File.open("#{spec.name}.gemspec", "w") do |f|
         
     | 
| 
       84 
     | 
    
         
            -
                  f << spec.to_ruby
         
     | 
| 
       85 
     | 
    
         
            -
                end
         
     | 
| 
       86 
     | 
    
         
            -
              end
         
     | 
| 
       87 
     | 
    
         
            -
            end
         
     | 
| 
       88 
     | 
    
         
            -
             
     | 
| 
       89 
     | 
    
         
            -
            desc "build all platform gems at once"
         
     | 
| 
       90 
     | 
    
         
            -
            task :gems => [:clean, :rmgems, :gemspec, "ruby:gem"]
         
     | 
| 
       91 
     | 
    
         
            -
             
     | 
| 
       92 
     | 
    
         
            -
            desc "remove all platform gems"
         
     | 
| 
       93 
     | 
    
         
            -
            task :rmgems => ["ruby:clobber_package"]
         
     | 
| 
       94 
     | 
    
         
            -
             
     | 
| 
       95 
     | 
    
         
            -
            desc "reinstall gem"
         
     | 
| 
       96 
     | 
    
         
            -
            task :reinstall => :gems do
         
     | 
| 
       97 
     | 
    
         
            -
              sh "gem uninstall pry-stack_explorer" rescue nil
         
     | 
| 
       98 
     | 
    
         
            -
              sh "gem install -l #{direc}/pkg/#{PROJECT_NAME}-#{PryStackExplorer::VERSION}.gem"
         
     | 
| 
       99 
     | 
    
         
            -
            end
         
     | 
| 
       100 
     | 
    
         
            -
             
     | 
| 
       101 
     | 
    
         
            -
            task :install => :reinstall
         
     | 
| 
       102 
     | 
    
         
            -
             
     | 
| 
       103 
     | 
    
         
            -
            desc "build and push latest gems"
         
     | 
| 
       104 
     | 
    
         
            -
            task :pushgems => :gems do
         
     | 
| 
       105 
     | 
    
         
            -
              chdir("#{File.dirname(__FILE__)}/pkg") do
         
     | 
| 
       106 
     | 
    
         
            -
                Dir["*.gem"].each do |gemfile|
         
     | 
| 
       107 
     | 
    
         
            -
                  sh "gem push #{gemfile}"
         
     | 
| 
       108 
     | 
    
         
            -
                end
         
     | 
| 
       109 
     | 
    
         
            -
              end
         
     | 
| 
       110 
     | 
    
         
            -
            end
         
     | 
| 
       111 
     | 
    
         
            -
             
     | 
| 
       112 
     | 
    
         
            -
            task :pushgem => :pushgems
         
     | 
    
        data/examples/example.rb
    DELETED
    
    | 
         @@ -1,45 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            unless Object.const_defined? :PryStackExplorer
         
     | 
| 
       2 
     | 
    
         
            -
              $:.unshift File.expand_path '../../lib', __FILE__
         
     | 
| 
       3 
     | 
    
         
            -
              require 'pry'
         
     | 
| 
       4 
     | 
    
         
            -
            end
         
     | 
| 
       5 
     | 
    
         
            -
             
     | 
| 
       6 
     | 
    
         
            -
            require 'pry-stack_explorer'
         
     | 
| 
       7 
     | 
    
         
            -
             
     | 
| 
       8 
     | 
    
         
            -
            def alphabet(y)
         
     | 
| 
       9 
     | 
    
         
            -
              x = 20
         
     | 
| 
       10 
     | 
    
         
            -
              b
         
     | 
| 
       11 
     | 
    
         
            -
            end
         
     | 
| 
       12 
     | 
    
         
            -
             
     | 
| 
       13 
     | 
    
         
            -
            def b
         
     | 
| 
       14 
     | 
    
         
            -
              x = 30
         
     | 
| 
       15 
     | 
    
         
            -
              proc {
         
     | 
| 
       16 
     | 
    
         
            -
                c
         
     | 
| 
       17 
     | 
    
         
            -
              }.call
         
     | 
| 
       18 
     | 
    
         
            -
            end
         
     | 
| 
       19 
     | 
    
         
            -
             
     | 
| 
       20 
     | 
    
         
            -
            def c
         
     | 
| 
       21 
     | 
    
         
            -
              u = 50
         
     | 
| 
       22 
     | 
    
         
            -
              binding.pry
         
     | 
| 
       23 
     | 
    
         
            -
            end
         
     | 
| 
       24 
     | 
    
         
            -
             
     | 
| 
       25 
     | 
    
         
            -
            # hello
         
     | 
| 
       26 
     | 
    
         
            -
            def beta
         
     | 
| 
       27 
     | 
    
         
            -
              gamma
         
     | 
| 
       28 
     | 
    
         
            -
            end
         
     | 
| 
       29 
     | 
    
         
            -
             
     | 
| 
       30 
     | 
    
         
            -
            def gamma
         
     | 
| 
       31 
     | 
    
         
            -
              zeta
         
     | 
| 
       32 
     | 
    
         
            -
            end
         
     | 
| 
       33 
     | 
    
         
            -
             
     | 
| 
       34 
     | 
    
         
            -
            def zeta
         
     | 
| 
       35 
     | 
    
         
            -
              vitamin = 100
         
     | 
| 
       36 
     | 
    
         
            -
              binding.pry
         
     | 
| 
       37 
     | 
    
         
            -
            end
         
     | 
| 
       38 
     | 
    
         
            -
            #
         
     | 
| 
       39 
     | 
    
         
            -
             
     | 
| 
       40 
     | 
    
         
            -
            proc {
         
     | 
| 
       41 
     | 
    
         
            -
              class J
         
     | 
| 
       42 
     | 
    
         
            -
                alphabet(22)
         
     | 
| 
       43 
     | 
    
         
            -
              end
         
     | 
| 
       44 
     | 
    
         
            -
            }.call
         
     | 
| 
       45 
     | 
    
         
            -
             
     |