-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add #source_location method to methods and procs
- Loading branch information
Showing
12 changed files
with
46 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class Method | ||
def to_proc | ||
Proc.new { |*args, &blk| self.call(*args, &blk) } | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,6 @@ | ||
fails:Method#source_location returns nil for built-in methods | ||
fails:Method#source_location returns an Array | ||
fails:Method#source_location sets the first value to the path of the file in which the method was defined | ||
fails:Method#source_location sets the last value to a Fixnum representing the line on which the method was defined | ||
fails:Method#source_location returns the last place the method was defined | ||
fails:Method#source_location returns the location of the original method even if it was aliased | ||
fails:Method#source_location works for methods defined with a block | ||
fails:Method#source_location works for methods defined with a Method | ||
fails:Method#source_location works for methods defined with an UnboundMethod | ||
fails:Method#source_location works for methods whose visibility has been overridden in a subclass | ||
fails:Method#source_location for a Method generated by respond_to_missing? it returns nil | ||
fails:Method#source_location for a Method generated by respond_to_missing? returns nil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,2 @@ | ||
fails:Proc#source_location returns an Array | ||
fails:Proc#source_location sets the first value to the path of the file in which the proc was defined | ||
fails:Proc#source_location sets the last value to a Fixnum representing the line on which the proc was defined | ||
fails:Proc#source_location works even if the proc was created on the same line | ||
fails:Proc#source_location returns the first line of a multi-line proc (i.e. the line containing 'proc do') | ||
fails:Proc#source_location returns the location of the proc's body; not necessarily the proc itself |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,2 @@ | ||
fails:UnboundMethod#source_location sets the first value to the path of the file in which the method was defined | ||
fails:UnboundMethod#source_location sets the last value to a Fixnum representing the line on which the method was defined | ||
fails:UnboundMethod#source_location returns the last place the method was defined | ||
fails:UnboundMethod#source_location returns the location of the original method even if it was aliased | ||
fails:UnboundMethod#source_location works for define_method methods | ||
fails:UnboundMethod#source_location works for define_singleton_method methods |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters