ripl-debug 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gemspec +1 -1
- data/CHANGELOG.rdoc +3 -0
- data/README.rdoc +1 -4
- data/deps.rip +1 -1
- data/lib/ripl/debug.rb +14 -4
- metadata +8 -8
data/.gemspec
CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
|
|
13
13
|
s.required_rubygems_version = ">= 1.3.6"
|
14
14
|
s.rubyforge_project = 'tagaholic'
|
15
15
|
s.executables = ['ripl-debug']
|
16
|
-
s.add_dependency 'ripl', '>= 0.
|
16
|
+
s.add_dependency 'ripl', '>= 0.3.1'
|
17
17
|
s.add_dependency 'ruby-debug'
|
18
18
|
s.files = Dir.glob(%w[{lib,test}/**/*.rb bin/* [A-Z]*.{txt,rdoc} ext/**/*.{rb,c} **/deps.rip]) + %w{Rakefile .gemspec}
|
19
19
|
s.extra_rdoc_files = ["README.rdoc", "LICENSE.txt"]
|
data/CHANGELOG.rdoc
CHANGED
data/README.rdoc
CHANGED
@@ -5,7 +5,7 @@ The debugger is started at the source of the exception.
|
|
5
5
|
== Install
|
6
6
|
Install the gem with:
|
7
7
|
|
8
|
-
|
8
|
+
gem install ripl-debug
|
9
9
|
|
10
10
|
== Usage
|
11
11
|
|
@@ -16,6 +16,3 @@ To debug some suspect code
|
|
16
16
|
This plugin can be turned off in the console at any time with:
|
17
17
|
|
18
18
|
>> Ripl.config[:debug] = false
|
19
|
-
|
20
|
-
== Limitations
|
21
|
-
* Doesn't currently work for multi-line evaluation
|
data/deps.rip
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
ripl >=0.
|
1
|
+
ripl >=0.3.1
|
2
2
|
ruby-debug >=0
|
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.1.
|
5
|
+
VERSION = '0.1.1'
|
6
6
|
|
7
7
|
def before_loop
|
8
8
|
super
|
@@ -10,8 +10,18 @@ module Ripl
|
|
10
10
|
Debugger.run_init_script(StringIO.new)
|
11
11
|
end
|
12
12
|
|
13
|
+
def _valid_syntax?(input)
|
14
|
+
eval(input, @binding, "ripl-debug syntax check", @line)
|
15
|
+
rescue SyntaxError
|
16
|
+
false
|
17
|
+
rescue Exception
|
18
|
+
true
|
19
|
+
else
|
20
|
+
true
|
21
|
+
end
|
22
|
+
|
13
23
|
def loop_eval(input)
|
14
|
-
if config[:debug]
|
24
|
+
if config[:debug] && _valid_syntax?(input)
|
15
25
|
# move local variables outside of with_post_mortem
|
16
26
|
input = (set_var_string = input.to_s[/^\s*\w+\s*=\s+/]) ?
|
17
27
|
"#{set_var_string} with_post_mortem { #{input.sub(set_var_string, '')} }" :
|
@@ -35,6 +45,6 @@ module Ripl
|
|
35
45
|
end
|
36
46
|
end
|
37
47
|
|
38
|
-
Ripl::Shell.
|
39
|
-
Ripl::Commands.
|
48
|
+
Ripl::Shell.include Ripl::Debug
|
49
|
+
Ripl::Commands.include Ripl::Debug::Commands
|
40
50
|
Ripl.config[:debug] = true
|
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: 25
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 1
|
10
|
+
version: 0.1.1
|
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:
|
18
|
+
date: 2011-01-11 00:00:00 -05:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -26,12 +26,12 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
hash:
|
29
|
+
hash: 17
|
30
30
|
segments:
|
31
31
|
- 0
|
32
|
-
-
|
33
|
-
-
|
34
|
-
version: 0.
|
32
|
+
- 3
|
33
|
+
- 1
|
34
|
+
version: 0.3.1
|
35
35
|
type: :runtime
|
36
36
|
version_requirements: *id001
|
37
37
|
- !ruby/object:Gem::Dependency
|