ruby-debug-pry 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/LICENSE +25 -0
  2. data/README.md +19 -0
  3. data/lib/ruby-debug/pry.rb +34 -0
  4. metadata +80 -0
data/LICENSE ADDED
@@ -0,0 +1,25 @@
1
+ License
2
+ -------
3
+
4
+ (The MIT License)
5
+
6
+ Copyright (c) 2011 Andrew O'Brien
7
+
8
+ Permission is hereby granted, free of charge, to any person obtaining
9
+ a copy of this software and associated documentation files (the
10
+ 'Software'), to deal in the Software without restriction, including
11
+ without limitation the rights to use, copy, modify, merge, publish,
12
+ distribute, sublicense, and/or sell copies of the Software, and to
13
+ permit persons to whom the Software is furnished to do so, subject to
14
+ the following conditions:
15
+
16
+ The above copyright notice and this permission notice shall be
17
+ included in all copies or substantial portions of the Software.
18
+
19
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
20
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
22
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
23
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
24
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
25
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,19 @@
1
+ This gem adds a "pry" command to ruby-debug.
2
+
3
+ To see it in action, run `ruby examples/foo.rb` and type "pry" at the debug prompt.
4
+
5
+ To use it in a project, add this to your Gemfile:
6
+
7
+ gem "ruby-debug-pry", :require => "ruby-debug/pry"
8
+
9
+ For more information on pry, read [this article](http://banisterfiend.wordpress.com/2011/01/27/turning-irb-on-its-head-with-pry/).
10
+
11
+ This has been tested on Ruby 1.8.7 p334 and Ruby 1.9.2 p136 and seems to work.
12
+
13
+ # Future Steps #
14
+
15
+ 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.
16
+
17
+ * `next`, `step`, and `cont` support
18
+ * and `autopry` configuration varibale
19
+ * debugger state accessible as a global variable
@@ -0,0 +1,34 @@
1
+ require 'pry'
2
+ require 'ruby-debug'
3
+
4
+ module Debugger
5
+ class PryCommand < Command
6
+ def regexp
7
+ /^\s* pry
8
+ (?:\s+(-d))?
9
+ \s*$/x
10
+ end
11
+
12
+ def execute
13
+ unless @state.interface.kind_of?(LocalInterface)
14
+ print "Command is available only in local mode.\n"
15
+ throw :debug_error
16
+ end
17
+
18
+ get_binding.pry
19
+ end
20
+
21
+ class << self
22
+ def help_command
23
+ 'pry'
24
+ end
25
+
26
+ def help(cmd)
27
+ %{
28
+ pry\tstarts an Pry session.
29
+ }
30
+ end
31
+ end
32
+
33
+ end
34
+ end
metadata ADDED
@@ -0,0 +1,80 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ruby-debug-pry
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 0.0.1
6
+ platform: ruby
7
+ authors:
8
+ - Andrew O'Brien
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2011-04-26 00:00:00 -04:00
14
+ default_executable:
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: pry
18
+ prerelease: false
19
+ requirement: &id001 !ruby/object:Gem::Requirement
20
+ none: false
21
+ requirements:
22
+ - - ~>
23
+ - !ruby/object:Gem::Version
24
+ version: 0.8.3
25
+ type: :runtime
26
+ version_requirements: *id001
27
+ - !ruby/object:Gem::Dependency
28
+ name: ruby-debug19
29
+ prerelease: false
30
+ requirement: &id002 !ruby/object:Gem::Requirement
31
+ none: false
32
+ requirements:
33
+ - - ~>
34
+ - !ruby/object:Gem::Version
35
+ version: 0.11.6
36
+ type: :runtime
37
+ version_requirements: *id002
38
+ 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.
39
+ email:
40
+ - obrien.andrew@gmail.com
41
+ executables: []
42
+
43
+ extensions: []
44
+
45
+ extra_rdoc_files: []
46
+
47
+ files:
48
+ - lib/ruby-debug/pry.rb
49
+ - LICENSE
50
+ - README.md
51
+ has_rdoc: true
52
+ homepage: http://github.com/AndrewO/ruby-debug-pry
53
+ licenses: []
54
+
55
+ post_install_message:
56
+ rdoc_options: []
57
+
58
+ require_paths:
59
+ - lib
60
+ required_ruby_version: !ruby/object:Gem::Requirement
61
+ none: false
62
+ requirements:
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ version: "0"
66
+ required_rubygems_version: !ruby/object:Gem::Requirement
67
+ none: false
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ version: 1.3.6
72
+ requirements: []
73
+
74
+ rubyforge_project:
75
+ rubygems_version: 1.5.0
76
+ signing_key:
77
+ specification_version: 3
78
+ summary: Adds a 'pry' command to ruby-debug
79
+ test_files: []
80
+