[
  {
    "path": ".gitignore",
    "content": "*.gem\n*.rbc\n.bundle\n.config\n.yardoc\nGemfile.lock\nInstalledFiles\n_yardoc\ncoverage\ndoc/\nlib/bundler/man\npkg\nrdoc\nspec/reports\ntest/tmp\ntest/version_tmp\ntmp\n"
  },
  {
    "path": "CHANGELOG.md",
    "content": "## 0.2.3 (2014-07-02)\n\n* Support [pry] 0.10\n\n\n## 0.2.2 (2013-03-07)\n\n* Relaxed [debugger][debugger] dependency.\n\n\n## 0.2.1 (2012-12-26)\n\n* Support breakpoints on methods defined in the pry console. (@banister)\n* Fix support for specifying breakpoints by *file:line_number*. (@nviennot)\n* Validate breakpoint conditionals are real Ruby expressions.\n* Support for [debugger][debugger] ~> 1.2.0. (@jshou)\n* Safer `alias_method_chain`-style patching of `Pry.start` and\n  `PryRemote::Server#teardown`. (@benizi)\n\n\n## 0.2.0 (2012-06-11)\n\n* Breakpoints\n* **finish** command\n* Internal cleanup and bug fixes\n\n\n## 0.1.0 (2012-06-07)\n\n* First release. **step**, **next**, and **continue** commands.\n  [pry-remote 0.1.4][pry-remote] support.\n\n\n[pry]:         http://pryrepl.org/\n[pry-remote]:  https://github.com/Mon-Ouie/pry-remote\n[debugger]:    https://github.com/cldwalker/debugger\n"
  },
  {
    "path": "Gemfile",
    "content": "source 'http://rubygems.org'\n\ngemspec\n"
  },
  {
    "path": "LICENSE",
    "content": "MIT/Expat License\n\nCopyright (c) 2012 by Gopal Patel\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "### Using MRI 2.0.0+? Use [**pry-byebug**][pry-byebug].\n\n* * *\n\npry-debugger [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/nixme/pry-debugger/trend.png)](https://bitdeli.com/free \"Bitdeli Badge\")\n============\n\n_Fast execution control in Pry_\n\nAdds **step**, **next**, **finish**, and **continue** commands and\n**breakpoints** to [Pry][pry] using [debugger][debugger].\n\nTo use, invoke pry normally. No need to start your script or app differently.\n\n```ruby\ndef some_method\n  binding.pry          # Execution will stop here.\n  puts 'Hello World'   # Run 'step' or 'next' in the console to move here.\nend\n```\n\nFor a complete debugging environment, add\n[pry-stack_explorer][pry-stack_explorer] for call-stack frame navigation.\n\n\n## Execution Commands\n\n**step:** Step execution into the next line or method. Takes an optional numeric\nargument to step multiple times.\n\n**next:** Step over to the next line within the same frame. Also takes an\noptional numeric argument to step multiple lines.\n\n**finish:** Execute until current stack frame returns.\n\n**continue:** Continue program execution and end the Pry session.\n\n\n## Breakpoints\n\nYou can set and adjust breakpoints directly from a Pry session using the\nfollowing commands:\n\n**break:** Set a new breakpoint from a line number in the current file, a file\nand line number, or a method. Pass an optional expression to create a\nconditional breakpoint. Edit existing breakpoints via various flags.\n\nExamples:\n\n```\nbreak SomeClass#run            Break at the start of `SomeClass#run`.\nbreak Foo#bar if baz?          Break at `Foo#bar` only if `baz?`.\nbreak app/models/user.rb:15    Break at line 15 in user.rb.\nbreak 14                       Break at line 14 in the current file.\n\nbreak --condition 4 x > 2      Change condition on breakpoint #4 to 'x > 2'.\nbreak --condition 3            Remove the condition on breakpoint #3.\n\nbreak --delete 5               Delete breakpoint #5.\nbreak --disable-all            Disable all breakpoints.\n\nbreak                          List all breakpoints. (Same as `breakpoints`)\nbreak --show 2                 Show details about breakpoint #2.\n```\n\nType `break --help` from a Pry session to see all available options.\n\n\n**breakpoints**: List all defined breakpoints. Pass `-v` or `--verbose` to see\nthe source code around each breakpoint.\n\n\n## Caveats\n\n**pry-debugger** is not yet thread-safe, so only use in single-threaded\nenvironments.\n\nOnly supports MRI 1.9.2 and 1.9.3. For a pure ruby approach not reliant on\n[debugger][debugger], check out [pry-nav][pry-nav]. Note: *pry-nav* and\n*pry-debugger* cannot be loaded together.\n\n\n## Remote debugging\n\nSupport for [pry-remote][pry-remote] (>= 0.1.4) is also included. Requires\nexplicity requiring *pry-debugger*, not just relying on pry's plugin loader.\n\nWant to debug a Rails app running inside [foreman][foreman]? Add to your\nGemfile:\n\n```ruby\ngem 'pry'\ngem 'pry-remote'\ngem 'pry-stack_explorer'\ngem 'pry-debugger'\n```\n\nThen add `binding.remote_pry` where you want to pause:\n\n```ruby\nclass UsersController < ApplicationController\n  def index\n    binding.remote_pry\n    ...\n  end\nend\n```\n\nLoad a page that triggers the code. Connect to the session:\n\n```\n$ bundle exec pry-remote\n```\n\nUsing Pry with Rails? Check out [Jazz Hands][jazz_hands].\n\n\n## Tips\n\nStepping through code often? Add the following shortcuts to `~/.pryrc`:\n\n```ruby\nif defined?(PryDebugger)\n  Pry.commands.alias_command 'c', 'continue'\n  Pry.commands.alias_command 's', 'step'\n  Pry.commands.alias_command 'n', 'next'\n  Pry.commands.alias_command 'f', 'finish'\nend\n```\n\n\n## Contributors\n\n* Gopal Patel (@nixme)\n* John Mair (@banister)\n* Nicolas Viennot (@nviennot)\n* Benjamin R. Haskell (@benizi)\n* Joshua Hou (@jshou)\n* ...and others who helped with [pry-nav][pry-nav]\n\nPatches and bug reports are welcome. Just send a [pull request][pullrequests] or\nfile an [issue][issues]. [Project changelog][changelog].\n\n\n\n[pry]:                http://pry.github.com\n[debugger]:           https://github.com/cldwalker/debugger\n[pry-stack_explorer]: https://github.com/pry/pry-stack_explorer\n[pry-nav]:            https://github.com/nixme/pry-nav\n[pry-remote]:         https://github.com/Mon-Ouie/pry-remote\n[foreman]:            https://github.com/ddollar/foreman\n[jazz_hands]:         https://github.com/nixme/jazz_hands\n[pullrequests]:       https://github.com/nixme/pry-debugger/pulls\n[issues]:             https://github.com/nixme/pry-debugger/issues\n[changelog]:          https://github.com/nixme/pry-debugger/blob/master/CHANGELOG.md\n[pry-byebug]:         https://github.com/deivid-rodriguez/pry-byebug\n"
  },
  {
    "path": "Rakefile",
    "content": "#!/usr/bin/env rake\nrequire \"bundler/gem_tasks\"\n"
  },
  {
    "path": "lib/pry-debugger/base.rb",
    "content": "module PryDebugger\n  TRACE_IGNORE_FILES = Dir[File.join(File.dirname(__FILE__), '..', '**', '*.rb')].map { |f| File.expand_path(f) }\n\n  extend self\n\n  # Checks that a binding is in a local file context. Extracted from\n  # https://github.com/pry/pry/blob/master/lib/pry/default_commands/context.rb\n  def check_file_context(target)\n    file = target.eval('__FILE__')\n    file == Pry.eval_path || (file !~ /(\\(.*\\))|<.*>/ && file != '' && file != '-e')\n  end\n\n  # Reference to currently running pry-remote server. Used by the processor.\n  attr_accessor :current_remote_server\nend\n"
  },
  {
    "path": "lib/pry-debugger/breakpoints.rb",
    "content": "module PryDebugger\n\n  # Wrapper for Debugger.breakpoints that respects our Processor and has better\n  # failure behavior. Acts as an Enumerable.\n  #\n  module Breakpoints\n    extend Enumerable\n    extend self\n\n\n    # Add a new breakpoint.\n    def add(file, line, expression = nil)\n      real_file = (file != Pry.eval_path)\n      raise ArgumentError, 'Invalid file!' if real_file && !File.exist?(file)\n      validate_expression expression\n\n      Pry.processor.debugging = true\n\n      path = (real_file ? File.expand_path(file) : file)\n      Debugger.add_breakpoint(path, line, expression)\n    end\n\n    # Change the conditional expression for a breakpoint.\n    def change(id, expression = nil)\n      validate_expression expression\n\n      breakpoint = find_by_id(id)\n      breakpoint.expr = expression\n      breakpoint\n    end\n\n    # Delete an existing breakpoint with the given ID.\n    def delete(id)\n      unless Debugger.started? && Debugger.remove_breakpoint(id)\n        raise ArgumentError, \"No breakpoint ##{id}\"\n      end\n      Pry.processor.debugging = false if to_a.empty?\n    end\n\n    # Delete all breakpoints.\n    def clear\n      Debugger.breakpoints.clear if Debugger.started?\n      Pry.processor.debugging = false\n    end\n\n    # Enable a disabled breakpoint with the given ID.\n    def enable(id)\n      change_status id, true\n    end\n\n    # Disable a breakpoint with the given ID.\n    def disable(id)\n      change_status id, false\n    end\n\n    # Disable all breakpoints.\n    def disable_all\n      each do |breakpoint|\n        breakpoint.enabled = false\n      end\n    end\n\n    def to_a\n      Debugger.started? ? Debugger.breakpoints : []\n    end\n\n    def size\n      to_a.size\n    end\n\n    def each(&block)\n      to_a.each(&block)\n    end\n\n    def find_by_id(id)\n      breakpoint = find { |b| b.id == id }\n      raise ArgumentError, \"No breakpoint ##{id}!\" unless breakpoint\n      breakpoint\n    end\n\n\n   private\n\n    def change_status(id, enabled = true)\n      breakpoint = find_by_id(id)\n      breakpoint.enabled = enabled\n      breakpoint\n    end\n\n    def validate_expression(expression)\n      if expression &&   # `nil` implies no expression given, so pass\n          (expression.empty? || !Pry::Code.complete_expression?(expression))\n        raise \"Invalid breakpoint conditional: #{expression}\"\n      end\n    end\n  end\nend\n"
  },
  {
    "path": "lib/pry-debugger/cli.rb",
    "content": "# Pry's new plugin loading system ensures this file runs before pry-remote. So\n# attempting to load everything directly from lib/pry-debugger.rb and\n# referencing that here causes a circular dependency when running\n# bin/pry-remote.\n#\n# So delay loading our monkey-patch to when someone explicity does a:\n#\n#   require 'pry-debugger'\n#\n# Load everything else here.\n#\n\nrequire 'pry-debugger/base'\nrequire 'pry-debugger/pry_ext'\nrequire 'pry-debugger/commands'\n"
  },
  {
    "path": "lib/pry-debugger/commands.rb",
    "content": "require 'pry'\nrequire 'pry-debugger/breakpoints'\n\nmodule PryDebugger\n  Commands = Pry::CommandSet.new do\n    create_command 'step' do\n      description 'Step execution into the next line or method.'\n\n      banner <<-BANNER\n        Usage: step [TIMES]\n\n        Step execution forward. By default, moves a single step.\n\n        Examples:\n\n          step                           Move a single step forward.\n          step 5                         Execute the next 5 steps.\n      BANNER\n\n      def process\n        check_file_context\n        breakout_navigation :step, args.first\n      end\n    end\n\n\n    create_command 'next' do\n      description 'Execute the next line within the current stack frame.'\n\n      banner <<-BANNER\n        Usage: next [LINES]\n\n        Step over within the same frame. By default, moves forward a single\n        line.\n\n        Examples:\n\n          next                           Move a single line forward.\n          next 4                         Execute the next 4 lines.\n      BANNER\n\n      def process\n        check_file_context\n        breakout_navigation :next, args.first\n      end\n    end\n\n\n    create_command 'finish' do\n      description 'Execute until current stack frame returns.'\n\n      def process\n        check_file_context\n        breakout_navigation :finish\n      end\n    end\n\n\n    create_command 'continue' do\n      description 'Continue program execution and end the Pry session.'\n\n      def process\n        check_file_context\n        run 'exit-all'\n      end\n    end\n\n\n    create_command 'break' do\n      description 'Set or edit a breakpoint.'\n\n      banner <<-BANNER\n        Usage:   break <METHOD | FILE:LINE | LINE> [if CONDITION]\n                 break --condition N [CONDITION]\n                 break [--show | --delete | --enable | --disable] N\n                 break [--delete-all | --disable-all]\n        Aliases: breakpoint\n\n        Set a breakpoint. Accepts a line number in the current file, a file and\n        line number, or a method, and an optional condition.\n\n        Pass appropriate flags to manipulate existing breakpoints.\n\n        Examples:\n\n          break SomeClass#run            Break at the start of `SomeClass#run`.\n          break Foo#bar if baz?          Break at `Foo#bar` only if `baz?`.\n          break app/models/user.rb:15    Break at line 15 in user.rb.\n          break 14                       Break at line 14 in the current file.\n\n          break --condition 4 x > 2      Add/change condition on breakpoint #4.\n          break --condition 3            Remove the condition on breakpoint #3.\n\n          break --delete 5               Delete breakpoint #5.\n          break --disable-all            Disable all breakpoints.\n\n          break                          List all breakpoints. (Same as `breakpoints`)\n          break --show 2                 Show details about breakpoint #2.\n      BANNER\n\n      def options(opt)\n        opt.on :c, :condition,     'Change the condition of a breakpoint.', :argument => true, :as => Integer\n        opt.on :s, :show,          'Show breakpoint details and source.',   :argument => true, :as => Integer\n        opt.on :D, :delete,        'Delete a breakpoint.',                  :argument => true, :as => Integer\n        opt.on :d, :disable,       'Disable a breakpoint.',                 :argument => true, :as => Integer\n        opt.on :e, :enable,        'Enable a disabled breakpoint.',         :argument => true, :as => Integer\n        opt.on     :'disable-all', 'Disable all breakpoints.'\n        opt.on     :'delete-all',  'Delete all breakpoints.'\n        method_options(opt)\n      end\n\n      def process\n        Pry.processor.pry = _pry_\n\n        { :delete        => :delete,\n          :disable       => :disable,\n          :enable        => :enable,\n          :'disable-all' => :disable_all,\n          :'delete-all'  => :clear\n        }.each do |action, method|\n          if opts.present?(action)\n            Breakpoints.__send__ method, *(method == action ? [opts[action]] : [])\n            return run 'breakpoints'\n          end\n        end\n\n        if opts.present?(:condition)\n          Breakpoints.change(opts[:condition], args.empty? ? nil : args.join(' '))\n          run 'breakpoints'\n        elsif opts.present?(:show)\n          print_full_breakpoint Breakpoints.find_by_id(opts[:show])\n        elsif args.empty?\n          run 'breakpoints'\n        else\n          new_breakpoint\n        end\n      end\n\n      def new_breakpoint\n        place = args.shift\n        condition = args.join(' ') if 'if' == args.shift\n\n        file, line =\n          case place\n          when /^(\\d+)$/       # Line number only\n            line = $1\n            unless PryDebugger.check_file_context(target)\n              raise ArgumentError, 'Line number declaration valid only in a file context.'\n            end\n            [target.eval('__FILE__'), line]\n          when /^(.+):(\\d+)$/  # File and line number\n            [$1, $2]\n          else               # Method or class name\n            self.args = [place]\n            method_object.source_location\n          end\n\n        print_full_breakpoint Breakpoints.add(file, line.to_i, condition)\n      end\n    end\n    alias_command 'breakpoint', 'break'\n\n\n    create_command 'breakpoints' do\n      description 'List defined breakpoints.'\n\n      banner <<-BANNER\n        Usage:   breakpoints [OPTIONS]\n        Aliases: breaks\n\n        List registered breakpoints and their current status.\n      BANNER\n\n      def options(opt)\n        opt.on :v, :verbose, 'Print source around each breakpoint.'\n      end\n\n      def process\n        if Breakpoints.count > 0\n          if opts.verbose?   # Long-form with source output\n            Breakpoints.each { |b| print_full_breakpoint(b) }\n          else               # Simple table output\n            max_width = [Math.log10(Breakpoints.count).ceil, 1].max\n            header = \"#{' ' * (max_width - 1)}#  Enabled  At \"\n\n            output.puts\n            output.puts text.bold(header)\n            output.puts text.bold('-' * header.size)\n            Breakpoints.each do |breakpoint|\n              output.printf \"%#{max_width}d  \", breakpoint.id\n              output.print  breakpoint.enabled? ? 'Yes      ' : 'No       '\n              output.print  \"#{breakpoint.source}:#{breakpoint.pos}\"\n              output.print  \" (if #{breakpoint.expr})\" if breakpoint.expr\n              output.puts\n            end\n            output.puts\n          end\n        else\n          output.puts text.bold('No breakpoints defined.')\n        end\n      end\n    end\n    alias_command 'breaks', 'breakpoints'\n\n\n    helpers do\n      def breakout_navigation(action, times = nil)\n        _pry_.binding_stack.clear     # Clear the binding stack.\n        throw :breakout_nav, {        # Break out of the REPL loop and\n          :action => action,          #   signal the tracer.\n          :times  =>  times,\n          :pry    => _pry_\n        }\n      end\n\n      # Ensures that a command is executed in a local file context.\n      def check_file_context\n        unless PryDebugger.check_file_context(target)\n          raise Pry::CommandError, 'Cannot find local context. Did you use `binding.pry`?'\n        end\n      end\n\n      # Print out full information about a breakpoint including surrounding code\n      # at that point.\n      def print_full_breakpoint(breakpoint)\n        line = breakpoint.pos\n        output.print text.bold(\"Breakpoint #{breakpoint.id}: \")\n        output.print \"#{breakpoint.source} @ line #{line} \"\n        output.print breakpoint.enabled? ? '(Enabled)' : '(Disabled)'\n        output.puts  ' :'\n        if (expr = breakpoint.expr)\n          output.puts \"#{text.bold('Condition:')} #{expr}\"\n        end\n        output.puts\n        output.puts  Pry::Code.from_file(breakpoint.source).\n                       around(line, 3).\n                       with_line_numbers.\n                       with_marker(line).to_s\n        output.puts\n      end\n    end\n  end\nend\n\nPry.commands.import PryDebugger::Commands\n"
  },
  {
    "path": "lib/pry-debugger/processor.rb",
    "content": "require 'pry'\nrequire 'debugger'\n\nmodule PryDebugger\n  class Processor\n    attr_accessor :pry\n\n    def initialize\n      Debugger.handler = self\n      @always_enabled = false\n      @delayed = Hash.new(0)\n    end\n\n    # Wrap a Pry REPL to catch navigational commands and act on them.\n    def run(initial = true, &block)\n      return_value = nil\n      command = catch(:breakout_nav) do  # Throws from PryDebugger::Commands\n        return_value = yield\n        {}    # Nothing thrown == no navigational command\n      end\n\n      times = (command[:times] || 1).to_i   # Command argument\n      times = 1 if times <= 0\n\n      if [:step, :next, :finish].include? command[:action]\n        @pry = command[:pry]   # Pry instance to resume after stepping\n        Debugger.start unless Debugger.started?\n\n        if initial\n          # Movement when on the initial binding.pry line will have a frame\n          # inside Debugger. If we step normally, it'll stop inside this\n          # Processor. So jump out and stop at the above frame, then step/next\n          # from our callback.\n          Debugger.current_context.stop_frame = 1\n          @delayed[command[:action]] = times\n\n        elsif :next == command[:action]\n          step_over times\n\n        elsif :step == command[:action]\n          step times\n\n        elsif :finish == command[:action]\n          finish\n        end\n      else\n        stop\n      end\n\n      return_value\n    end\n\n    # Adjust debugging. When set to false, the Processor will manage enabling\n    # and disabling the debugger itself. When set to true, the debugger is\n    # always enabled.\n    def debugging=(enabled)\n      if enabled\n        @always_enabled = true\n        Debugger.start unless Debugger.started?\n      else\n        @always_enabled = false\n        # Debugger will get stopped if necessary in `stop` once the repl ends.\n      end\n    end\n\n\n    # --- Callbacks from debugger C extension ---\n\n    def at_line(context, file, line)\n      return if file && TRACE_IGNORE_FILES.include?(File.expand_path(file))\n\n      # If stopped for a breakpoint or catchpoint, can't play any delayed steps\n      # as they'll move away from the interruption point. (Unsure if scenario is\n      # possible, but just keeping assertions in check.)\n      @delayed = Hash.new(0) unless :step == context.stop_reason\n\n      if @delayed[:next] > 1     # If any delayed nexts/steps, do 'em.\n        step_over @delayed[:next] - 1\n        @delayed = Hash.new(0)\n\n      elsif @delayed[:step] > 1\n        step @delayed[:step] - 1\n        @delayed = Hash.new(0)\n\n      elsif @delayed[:finish] > 0\n        finish\n        @delayed = Hash.new(0)\n\n      else  # Otherwise, resume the pry session at the stopped line.\n        resume_pry context\n      end\n    end\n\n    # Called when a breakpoint is triggered. Note: `at_line`` is called\n    # immediately after with the context's `stop_reason == :breakpoint`.\n    def at_breakpoint(context, breakpoint)\n      @pry.output.print Pry::Helpers::Text.bold(\"\\nBreakpoint #{breakpoint.id}. \")\n      @pry.output.puts  (breakpoint.hit_count == 1 ?\n                           'First hit.' :\n                           \"Hit #{breakpoint.hit_count} times.\" )\n      if (expr = breakpoint.expr)\n        @pry.output.print Pry::Helpers::Text.bold(\"Condition: \")\n        @pry.output.puts  expr\n      end\n    end\n\n    def at_catchpoint(context, exception)\n      # TODO\n    end\n\n\n   private\n\n    # Resume an existing Pry REPL at the paused point. Binding extracted from\n    # the Debugger::Context.\n    def resume_pry(context)\n      new_binding = context.frame_binding(0)\n      Debugger.stop unless @always_enabled\n\n      @pry.binding_stack.clear\n      run(false) do\n        @pry.repl new_binding\n      end\n    end\n\n    # Move execution forward.\n    def step(times)\n      Debugger.current_context.step(times)\n    end\n\n    # Move execution forward a number of lines in the same frame.\n    def step_over(lines)\n      Debugger.current_context.step_over(lines, 0)\n    end\n\n    # Execute until current frame returns.\n    def finish\n      Debugger.current_context.stop_frame = 0\n    end\n\n    # Cleanup when debugging is stopped and execution continues.\n    def stop\n      Debugger.stop if !@always_enabled && Debugger.started?\n      if PryDebugger.current_remote_server   # Cleanup DRb remote if running\n        PryDebugger.current_remote_server.teardown\n      end\n    end\n  end\nend\n"
  },
  {
    "path": "lib/pry-debugger/pry_ext.rb",
    "content": "require 'pry'\nrequire 'pry-debugger/processor'\n\nclass << Pry\n  alias_method :start_without_pry_debugger, :start\n  attr_reader :processor\n\n  def start_with_pry_debugger(target = TOPLEVEL_BINDING, options = {})\n    @processor ||= PryDebugger::Processor.new\n\n    if target.is_a?(Binding) && PryDebugger.check_file_context(target)\n      # Wrap the processer around the usual Pry.start to catch navigation\n      # commands.\n      @processor.run(true) do\n        start_without_pry_debugger(target, options)\n      end\n    else\n      # No need for the tracer unless we have a file context to step through\n      start_without_pry_debugger(target, options)\n    end\n  end\n  alias_method :start, :start_with_pry_debugger\nend\n"
  },
  {
    "path": "lib/pry-debugger/pry_remote_ext.rb",
    "content": "require 'pry-remote'\n\nmodule PryRemote\n  class Server\n    # Override the call to Pry.start to save off current Server, and not\n    # teardown the server right after Pry.start finishes.\n    def run\n      if PryDebugger.current_remote_server\n        raise 'Already running a pry-remote session!'\n      else\n        PryDebugger.current_remote_server = self\n      end\n\n      setup\n      Pry.start @object, {\n        :input  => client.input_proxy,\n        :output => client.output\n      }\n    end\n\n    # Override to reset our saved global current server session.\n    alias_method :teardown_without_pry_debugger, :teardown\n    def teardown_with_pry_debugger\n      return if @torn\n\n      teardown_without_pry_debugger\n      PryDebugger.current_remote_server = nil\n      @torn = true\n    end\n    alias_method :teardown, :teardown_with_pry_debugger\n  end\nend\n\n# Ensure cleanup when a program finishes without another break. For example,\n# 'next' on the last line of a program won't hit PryDebugger::Processor#run,\n# which normally handles cleanup.\nat_exit do\n  if PryDebugger.current_remote_server\n    PryDebugger.current_remote_server.teardown\n  end\nend\n"
  },
  {
    "path": "lib/pry-debugger/version.rb",
    "content": "module PryDebugger\n  VERSION = '0.2.3'\nend\n"
  },
  {
    "path": "lib/pry-debugger.rb",
    "content": "require 'pry-debugger/cli'\n\n# Load pry-remote monkey patches if pry-remote's available\nbegin\n  require 'pry-debugger/pry_remote_ext'\nrescue LoadError\nend\n"
  },
  {
    "path": "pry-debugger.gemspec",
    "content": "# -*- encoding: utf-8 -*-\n\nrequire File.expand_path('../lib/pry-debugger/version', __FILE__)\n\nGem::Specification.new do |gem|\n  gem.name          = 'pry-debugger'\n  gem.version       = PryDebugger::VERSION\n  gem.author        = 'Gopal Patel'\n  gem.email         = 'nixme@stillhope.com'\n  gem.license       = 'MIT'\n  gem.homepage      = 'https://github.com/nixme/pry-debugger'\n  gem.summary       = 'Fast debugging with Pry.'\n  gem.description   = \"Combine 'pry' with 'debugger'. Adds 'step', 'next', and 'continue' commands to control execution.\"\n\n  gem.executables   = `git ls-files -- bin/*`.split(\"\\n\").map{ |f| File.basename(f) }\n  gem.files         = `git ls-files`.split(\"\\n\")\n  gem.test_files    = `git ls-files -- {test,spec,features}/*`.split(\"\\n\")\n  gem.require_paths = [\"lib\"]\n\n  # Dependencies\n  gem.required_ruby_version = '>= 1.9.2'\n  gem.add_runtime_dependency 'pry', '>= 0.9.10', '< 0.11.0'\n  gem.add_runtime_dependency 'debugger', '~> 1.3'\n  gem.add_development_dependency 'pry-remote', '~> 0.1.6'\nend\n"
  }
]