dbussink (owner)

Revisions

gist: 205323 Download_button fork
public
Public Clone URL: git://gist.github.com/205323.git
Embed All Files: show embed
Text only #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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