Skip to content

Commit 40b4652

Browse files
committed
adding 'more' command; raising version to beta2
1 parent 545e07e commit 40b4652

File tree

2 files changed

+36
-2
lines changed

2 files changed

+36
-2
lines changed

lib/ruby-debug-ide/commands/inspect.rb

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,38 @@ def execute
2222
end
2323
end
2424

25-
end
25+
class MoreCommand < Command
26+
def regexp
27+
/^\s*more\s+/
28+
end
29+
30+
def execute
31+
require 'stringio'
32+
require 'irb/ruby-lex'
33+
34+
string_to_parse = @match.post_match.gsub("\\n", "\n") + "\n\n\n"
35+
36+
lexer = RubyLex.new
37+
io = StringIO.new(string_to_parse)
38+
# for passing to the lexer
39+
def io.encoding
40+
"utf-8"
41+
end
42+
lexer.set_input(io)
43+
lexer.set_prompt {|ltype, indent, continue, lineno| }
44+
45+
last_statement = '',0
46+
lexer.each_top_level_statement do |line, line_no|
47+
last_statement = line, line_no
48+
end
49+
50+
result = 1
51+
if /\A\s*\Z/m =~ last_statement[0]
52+
result = 0
53+
end
54+
55+
@printer.print_pp("<more value=\"#{result.to_s}\"></more>")
56+
end
57+
end
58+
59+
end

lib/ruby-debug-ide/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module Debugger
2-
IDE_VERSION='0.4.23.beta1'
2+
IDE_VERSION='0.4.23.beta2'
33
end

0 commit comments

Comments
 (0)