Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
drewski371-bot committed Apr 26, 2011
0 parents commit b253a0e
Show file tree
Hide file tree
Showing 4 changed files with 105 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
source "http://rubygems.org"

gem "pry", "~> 0.8.3"

platform :mri_18 do
gem "ruby-debug", "~> 0.10.4"
end

platform :mri_19 do
gem "ruby-debug19", "~> 0.11.6", :require => "ruby-debug"
end
43 changes: 43 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
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
ruby-debug
ruby-debug19
17 changes: 17 additions & 0 deletions examples/foo.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
require 'rubygems'
require 'bundler'
Bundler.require
$:.unshift(File.dirname(__FILE__) + "/../lib")
require "ruby-debug/pry"

class Foo
attr_accessor :bar

def initialize(bar)
@bar = bar
end
end

foo = Foo.new(5)
debugger
foo.bar += 10
34 changes: 34 additions & 0 deletions lib/ruby-debug/pry.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
require 'pry'
require 'ruby-debug'

module Debugger
class PryCommand < Command
def regexp
/^\s* pry
(?:\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'
end

def help(cmd)
%{
pry\tstarts an Pry session.
}
end
end

end
end

0 comments on commit b253a0e

Please sign in to comment.