debugger-pry 0.1.0
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.
- data/.gitignore +1 -0
- data/Gemfile +7 -0
- data/LICENSE +26 -0
- data/README.md +14 -0
- data/examples/foo.rb +17 -0
- data/lib/debugger/pry.rb +34 -0
- metadata +86 -0
data/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
*.gem
|
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
License
|
2
|
+
-------
|
3
|
+
|
4
|
+
(The MIT License)
|
5
|
+
|
6
|
+
Copyright (c) 2011 Andrew O'Brien
|
7
|
+
Copyright (c) 2012 John Mair
|
8
|
+
|
9
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
10
|
+
a copy of this software and associated documentation files (the
|
11
|
+
'Software'), to deal in the Software without restriction, including
|
12
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
13
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
14
|
+
permit persons to whom the Software is furnished to do so, subject to
|
15
|
+
the following conditions:
|
16
|
+
|
17
|
+
The above copyright notice and this permission notice shall be
|
18
|
+
included in all copies or substantial portions of the Software.
|
19
|
+
|
20
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
21
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
22
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
23
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
24
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
25
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
26
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
This gem adds a "pry" command to debugger.
|
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 "debugger-pry", :require => "debugger/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
|
+
Credits
|
12
|
+
-------
|
13
|
+
|
14
|
+
Based on the work of Andrew O'Brien
|
data/examples/foo.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler'
|
3
|
+
Bundler.require
|
4
|
+
$:.unshift(File.dirname(__FILE__) + "/../lib")
|
5
|
+
require "debugger/pry"
|
6
|
+
|
7
|
+
class Foo
|
8
|
+
attr_accessor :bar
|
9
|
+
|
10
|
+
def initialize(bar)
|
11
|
+
@bar = bar
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
foo = Foo.new(5)
|
16
|
+
debugger
|
17
|
+
foo.bar += 10
|
data/lib/debugger/pry.rb
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'pry'
|
2
|
+
require 'debugger'
|
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 a Pry session.
|
29
|
+
}
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
34
|
+
end
|
metadata
ADDED
@@ -0,0 +1,86 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: debugger-pry
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Andrew O'Brien
|
9
|
+
- John Mair
|
10
|
+
autorequire:
|
11
|
+
bindir: bin
|
12
|
+
cert_chain: []
|
13
|
+
date: 2012-06-08 00:00:00.000000000 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: pry
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
18
|
+
none: false
|
19
|
+
requirements:
|
20
|
+
- - ! '>='
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 0.9.9
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
27
|
+
requirements:
|
28
|
+
- - ! '>='
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
version: 0.9.9
|
31
|
+
- !ruby/object:Gem::Dependency
|
32
|
+
name: debugger
|
33
|
+
requirement: !ruby/object:Gem::Requirement
|
34
|
+
none: false
|
35
|
+
requirements:
|
36
|
+
- - ~>
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: '1'
|
39
|
+
type: :runtime
|
40
|
+
prerelease: false
|
41
|
+
version_requirements: !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
43
|
+
requirements:
|
44
|
+
- - ~>
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '1'
|
47
|
+
description: This gem adds a 'pry' command to invoke Pry in the current context.
|
48
|
+
email:
|
49
|
+
- obrien.andrew@gmail.com
|
50
|
+
- jrmair@gmail.com
|
51
|
+
executables: []
|
52
|
+
extensions: []
|
53
|
+
extra_rdoc_files: []
|
54
|
+
files:
|
55
|
+
- .gitignore
|
56
|
+
- Gemfile
|
57
|
+
- LICENSE
|
58
|
+
- README.md
|
59
|
+
- examples/foo.rb
|
60
|
+
- lib/debugger/pry.rb
|
61
|
+
homepage: http://github.com/pry/debugger-pry
|
62
|
+
licenses: []
|
63
|
+
post_install_message:
|
64
|
+
rdoc_options: []
|
65
|
+
require_paths:
|
66
|
+
- lib
|
67
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
68
|
+
none: false
|
69
|
+
requirements:
|
70
|
+
- - ! '>='
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: '0'
|
73
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
74
|
+
none: false
|
75
|
+
requirements:
|
76
|
+
- - ! '>='
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: '0'
|
79
|
+
requirements: []
|
80
|
+
rubyforge_project:
|
81
|
+
rubygems_version: 1.8.24
|
82
|
+
signing_key:
|
83
|
+
specification_version: 3
|
84
|
+
summary: Adds a 'pry' command to debugger
|
85
|
+
test_files: []
|
86
|
+
has_rdoc:
|