ripl-debug 0.1.1 → 0.2.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/.gemspec +0 -1
- data/CHANGELOG.rdoc +4 -0
- data/README.rdoc +11 -2
- data/deps.rip +1 -2
- data/lib/ripl/debug.rb +14 -2
- metadata +5 -19
data/.gemspec
CHANGED
@@ -14,7 +14,6 @@ Gem::Specification.new do |s|
|
|
14
14
|
s.rubyforge_project = 'tagaholic'
|
15
15
|
s.executables = ['ripl-debug']
|
16
16
|
s.add_dependency 'ripl', '>= 0.3.1'
|
17
|
-
s.add_dependency 'ruby-debug'
|
18
17
|
s.files = Dir.glob(%w[{lib,test}/**/*.rb bin/* [A-Z]*.{txt,rdoc} ext/**/*.{rb,c} **/deps.rip]) + %w{Rakefile .gemspec}
|
19
18
|
s.extra_rdoc_files = ["README.rdoc", "LICENSE.txt"]
|
20
19
|
s.license = 'MIT'
|
data/CHANGELOG.rdoc
CHANGED
data/README.rdoc
CHANGED
@@ -3,9 +3,13 @@ This ripl plugin automatically starts the debugger whenever an evaled input thro
|
|
3
3
|
The debugger is started at the source of the exception.
|
4
4
|
|
5
5
|
== Install
|
6
|
-
|
6
|
+
If on ruby 1.8, install the gem with:
|
7
7
|
|
8
|
-
gem install ripl-debug
|
8
|
+
gem install ripl-debug ruby-debug
|
9
|
+
|
10
|
+
If on ruby 1.9, install the gem with:
|
11
|
+
|
12
|
+
gem install ripl-debug ruby-debug19
|
9
13
|
|
10
14
|
== Usage
|
11
15
|
|
@@ -16,3 +20,8 @@ To debug some suspect code
|
|
16
20
|
This plugin can be turned off in the console at any time with:
|
17
21
|
|
18
22
|
>> Ripl.config[:debug] = false
|
23
|
+
|
24
|
+
== Limitations
|
25
|
+
|
26
|
+
This gem doesn't have ruby-debug as a dependency since ruby-debug is split across two gems
|
27
|
+
(ruby-debug and ruby-debug19), dependent on ruby versions. This gem will work with either one.
|
data/deps.rip
CHANGED
@@ -1,2 +1 @@
|
|
1
|
-
ripl >=0.3.1
|
2
|
-
ruby-debug >=0
|
1
|
+
ripl >=0.3.1
|
data/lib/ripl/debug.rb
CHANGED
@@ -2,7 +2,7 @@ require 'ripl'
|
|
2
2
|
|
3
3
|
module Ripl
|
4
4
|
module Debug
|
5
|
-
VERSION = '0.
|
5
|
+
VERSION = '0.2.0'
|
6
6
|
|
7
7
|
def before_loop
|
8
8
|
super
|
@@ -10,8 +10,20 @@ module Ripl
|
|
10
10
|
Debugger.run_init_script(StringIO.new)
|
11
11
|
end
|
12
12
|
|
13
|
+
def _capture_stds(&block)
|
14
|
+
original_stdout, original_stderr = $stdout, $stderr
|
15
|
+
$stdout = fake = StringIO.new
|
16
|
+
$stderr = fake2 = StringIO.new
|
17
|
+
begin
|
18
|
+
yield
|
19
|
+
ensure
|
20
|
+
$stdout, $stderr = original_stdout, original_stderr
|
21
|
+
end
|
22
|
+
fake.string + fake2.string
|
23
|
+
end
|
24
|
+
|
13
25
|
def _valid_syntax?(input)
|
14
|
-
eval(input, @binding, "ripl-debug syntax check", @line)
|
26
|
+
_capture_stds { eval(input, @binding, "ripl-debug syntax check", @line) }
|
15
27
|
rescue SyntaxError
|
16
28
|
false
|
17
29
|
rescue Exception
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ripl-debug
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 2
|
9
|
+
- 0
|
10
|
+
version: 0.2.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Gabriel Horner
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-03-11 00:00:00 -05:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -34,20 +34,6 @@ dependencies:
|
|
34
34
|
version: 0.3.1
|
35
35
|
type: :runtime
|
36
36
|
version_requirements: *id001
|
37
|
-
- !ruby/object:Gem::Dependency
|
38
|
-
name: ruby-debug
|
39
|
-
prerelease: false
|
40
|
-
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
|
-
requirements:
|
43
|
-
- - ">="
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
hash: 3
|
46
|
-
segments:
|
47
|
-
- 0
|
48
|
-
version: "0"
|
49
|
-
type: :runtime
|
50
|
-
version_requirements: *id002
|
51
37
|
description: This ripl plugin automatically starts the debugger whenever an evaled input throws an exception. The debugger is started at the source of the exception.
|
52
38
|
email: gabriel.horner@gmail.com
|
53
39
|
executables:
|