Skip to content

Instantly share code, notes, and snippets.

@dbussink
Created October 8, 2009 20:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dbussink/205323 to your computer and use it in GitHub Desktop.
Save dbussink/205323 to your computer and use it in GitHub Desktop.
diff --git a/kernel/common/compiled_method.rb b/kernel/common/compiled_method.rb
index 4828aeb..11b3ca1 100644
--- a/kernel/common/compiled_method.rb
+++ b/kernel/common/compiled_method.rb
@@ -274,7 +274,7 @@ module Rubinius
i += 2
end
- return -1
+ -1
end
##
@@ -282,11 +282,11 @@ module Rubinius
#
# @return [String]
def first_line
- @lines.each do |ent|
- return ent[2] if ent[2] > 0
+ if @lines.size > 1
+ @lines[1]
+ else
+ -1
end
-
- return -1
end
##
diff --git a/kernel/common/method.rb b/kernel/common/method.rb
index 254e7aa..729f016 100644
--- a/kernel/common/method.rb
+++ b/kernel/common/method.rb
@@ -86,8 +86,8 @@ class Method
# Location gives the file and line number of the start of this method's
# definition.
- def location()
- "#{@compiled_method.file}, near line #{@compiled_method.first_line}"
+ def source_location
+ [@compiled_method.file.to_s, @compiled_method.first_line]
end
def owner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment