Skip to content

Commit

Permalink
Merge pull request #22 from gfowley/clean-for-pr
Browse files Browse the repository at this point in the history
code changes for Ruboto compatibility...
  • Loading branch information
os97673 committed Sep 23, 2015
2 parents 3352120 + 578891c commit 4ffcd8d
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ Gemfile.lock
.ruby-gemset
.ruby-version
.idea/*
.*.un~
.*.swp
8 changes: 7 additions & 1 deletion cli/ruby-debug/commands/irb.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
begin # rescue ArgumentError

require 'irb'

module IRB # :nodoc:
Expand Down Expand Up @@ -153,7 +155,7 @@ def execute
else
file = @state.context.frame_file(0)
line = @state.context.frame_line(0)
CommandProcessor.print_location_and_text(file, line)
@state.processor.print_location_and_text(file, line)
@state.previous_line = nil
end

Expand Down Expand Up @@ -190,3 +192,7 @@ def help(cmd)
end
end

rescue ArgumentError
# (GF) require 'irb' raises ArgumentError attempting to load readline in JRuby on Android
end

4 changes: 2 additions & 2 deletions cli/ruby-debug/interface.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def initialize
require 'readline'
@have_readline = true
@history_save = true
rescue LoadError
rescue LoadError, ArgumentError
@have_readline = false
@history_save = false
end
Expand Down Expand Up @@ -132,7 +132,7 @@ class << Debugger
def readline(prompt, hist)
Readline::readline(prompt, hist)
end
rescue LoadError
rescue LoadError, ArgumentError
def readline(prompt, hist)
@histfile = ''
@hist_save = false
Expand Down
7 changes: 4 additions & 3 deletions cli/ruby-debug/processor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,9 @@ def self.canonic_file(filename)
end
end

def self.print_location_and_text(file, line)
file_line = "%s:%s\n%s" % [canonic_file(file), line,
# (GF) made this an instance method so #print calls @interface#print
def print_location_and_text(file, line)
file_line = "%s:%s\n%s" % [CommandProcessor.canonic_file(file), line,
Debugger.line_at(file, line)]
# FIXME: use annotations routines
if Debugger.annotate.to_i > 2
Expand Down Expand Up @@ -306,7 +307,7 @@ def process_commands(context, file, line)
end

preloop(@commands, context)
CommandProcessor.print_location_and_text(file, line)
print_location_and_text(file, line)
while !state.proceed?
input = if @interface.command_queue.empty?
@interface.read_command(prompt(context))
Expand Down
2 changes: 1 addition & 1 deletion ruby-debug.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ EOF
'rdbg.rb']

spec.add_dependency 'columnize', '>= 0.1'
spec.add_dependency 'linecache', '~> 0.46'
spec.add_dependency 'linecache', '~> 1.3.1'
spec.add_dependency 'ruby-debug-base', "~> #{Debugger::VERSION}.0"

spec.extra_rdoc_files = ['README']
Expand Down

0 comments on commit 4ffcd8d

Please sign in to comment.