Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

ruby-debug -> debugger

  • Loading branch information...
commit c57f531552ec3c0e300baec8b96855811ea147ca 1 parent 61445cb
@banister banister authored
View
8 Gemfile
@@ -1,11 +1,7 @@
source "http://rubygems.org"
-gem "pry", ">= 0.8.3"
-
-platform :mri_18 do
- gem "ruby-debug", "~> 0.10.4"
-end
+ngem "pry", ">= 0.9.9"
platform :mri_19 do
- gem "ruby-debug19", "~> 0.11.6", :require => "ruby-debug"
+ gem "debugger", "~> 1", :require => "debugger"
end
View
43 Gemfile.lock
@@ -1,43 +0,0 @@
-GEM
- remote: http://rubygems.org/
- specs:
- archive-tar-minitar (0.5.2)
- coderay (0.9.7)
- columnize (0.3.2)
- linecache (0.43)
- linecache19 (0.5.12)
- ruby_core_source (>= 0.1.4)
- method_source (0.4.1)
- ruby_parser (>= 2.0.5)
- pry (0.8.3)
- coderay (>= 0.9.7)
- method_source (>= 0.4.0)
- ruby_parser (>= 2.0.5)
- slop (>= 1.5.3)
- ruby-debug (0.10.4)
- columnize (>= 0.1)
- ruby-debug-base (~> 0.10.4.0)
- ruby-debug-base (0.10.4)
- linecache (>= 0.3)
- ruby-debug-base19 (0.11.25)
- columnize (>= 0.3.1)
- linecache19 (>= 0.5.11)
- ruby_core_source (>= 0.1.4)
- ruby-debug19 (0.11.6)
- columnize (>= 0.3.1)
- linecache19 (>= 0.5.11)
- ruby-debug-base19 (>= 0.11.19)
- ruby_core_source (0.1.5)
- archive-tar-minitar (>= 0.5.2)
- ruby_parser (2.0.6)
- sexp_processor (~> 3.0)
- sexp_processor (3.0.5)
- slop (1.5.3)
-
-PLATFORMS
- ruby
-
-DEPENDENCIES
- pry (>= 0.8.3)
- ruby-debug (~> 0.10.4)
- ruby-debug19 (~> 0.11.6)
View
3  LICENSE
@@ -1,9 +1,10 @@
License
-------
-(The MIT License)
+(The MIT License)
Copyright (c) 2011 Andrew O'Brien
+Copyright (c) 2012 John Mair
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
View
15 README.md
@@ -1,19 +1,14 @@
-This gem adds a "pry" command to ruby-debug.
+This gem adds a "pry" command to debugger.
To see it in action, run `ruby examples/foo.rb` and type "pry" at the debug prompt.
To use it in a project, add this to your Gemfile:
- gem "ruby-debug-pry", :require => "ruby-debug/pry"
+ gem "debugger-pry", :require => "debugger/pry"
For more information on pry, read [this article](http://banisterfiend.wordpress.com/2011/01/27/turning-irb-on-its-head-with-pry/).
-This has been tested on Ruby 1.8.7 p334 and Ruby 1.9.2 p136 and seems to work.
+Credits
+-------
-# Future Steps #
-
-Right now I don't have any of the additional features that ruby-debug's IRB command has. I don't really use them, but it would be nice to have them.
-
-* `next`, `step`, and `cont` support
-* add `autopry` configuration variable
-* make debugger state accessible as a global variable
+Based on the work of Andrew O'Brien
View
6 examples/foo.rb
@@ -2,11 +2,11 @@
require 'bundler'
Bundler.require
$:.unshift(File.dirname(__FILE__) + "/../lib")
-require "ruby-debug/pry"
+require "debugger/pry"
class Foo
attr_accessor :bar
-
+
def initialize(bar)
@bar = bar
end
@@ -14,4 +14,4 @@ def initialize(bar)
foo = Foo.new(5)
debugger
-foo.bar += 10
+foo.bar += 10
View
14 lib/ruby-debug/pry.rb → lib/debugger/pry.rb
@@ -1,5 +1,5 @@
require 'pry'
-require 'ruby-debug'
+require 'debugger'
module Debugger
class PryCommand < Command
@@ -8,16 +8,16 @@ def regexp
(?:\s+(-d))?
\s*$/x
end
-
+
def execute
unless @state.interface.kind_of?(LocalInterface)
print "Command is available only in local mode.\n"
throw :debug_error
end
-
+
get_binding.pry
end
-
+
class << self
def help_command
'pry'
@@ -25,10 +25,10 @@ def help_command
def help(cmd)
%{
- pry\tstarts an Pry session.
+ pry\tstarts a Pry session.
}
end
end
-
+
end
-end
+end
View
25 ruby-debug-pry.gemspec
@@ -1,25 +0,0 @@
-# -*- encoding: utf-8 -*-
-lib = File.expand_path('../lib/', __FILE__)
-$:.unshift lib unless $:.include?(lib)
-
-Gem::Specification.new do |s|
- s.name = "ruby-debug-pry"
- s.version = "0.0.3"
- s.platform = Gem::Platform::RUBY
- s.authors = ["Andrew O'Brien"]
- s.email = ["obrien.andrew@gmail.com"]
- s.homepage = "http://github.com/AndrewO/ruby-debug-pry"
- s.summary = "Adds a 'pry' command to ruby-debug"
- s.description = "Pry is a featureful REPL that looks like it can work nicely with ruby-debug. This gem adds a 'pry' command to invoke Pry in the current context."
-
- s.required_rubygems_version = ">= 1.3.6"
-
-
- s.add_dependency("pry", ">= 0.8.3")
-
- # s.add_dependency("ruby-debug", "~> 0.10.4") if RUBY_VERSION < "1.9"
- # s.add_dependency("ruby-debug19", "~> 0.11.6") if RUBY_VERSION >= "1.9"
-
- s.files = Dir.glob("{lib}/**/*") + %w(LICENSE README.md)
- s.require_path = 'lib'
-end
Please sign in to comment.
Something went wrong with that request. Please try again.