method_introspection 0.0.2 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of method_introspection might be problematic. Click here for more details.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9aa2ca916fce1bc7710c586cd3834aa0ffb59ff6
|
4
|
+
data.tar.gz: dabc5d96f3fe52181515a192353558e401b47dee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 87dea15bd1eb0ebd945291d3e316b5fd4409b8d46c804e39c5d097cae06c1321826873a04be56a80b34cdfefc9048f8e3eb2f392f3ac08cda111a9801973e6e5
|
7
|
+
data.tar.gz: 1094e9a859abaabc41e3ee2304d87b4017db98f2e74f8c40e91d3ae819596e606759b4a4515a93aa1f8e0c4f458c5f913c51d9e8afee9181783c46f16f0e9ecb
|
@@ -69,8 +69,10 @@ module MethodIntrospection # The top namespace of this project.
|
|
69
69
|
# ========================================================================= #
|
70
70
|
def self.source_helper(source_location, name = nil)
|
71
71
|
raise_this(name) unless source_location
|
72
|
-
|
73
|
-
|
72
|
+
this_file, line_number = *source_location
|
73
|
+
MethodIntrospection.set_this_file(this_file)
|
74
|
+
MethodIntrospection.set_line_number(line_number)
|
75
|
+
expression_at(lines_for(this_file), line_number)
|
74
76
|
rescue SyntaxError => error
|
75
77
|
raise SourceNotFoundError,
|
76
78
|
"Could not parse source for #{name}: #{error.message}"
|
@@ -115,9 +117,6 @@ module MethodIntrospection # The top namespace of this project.
|
|
115
117
|
def self.comment_helper(source_location, name = nil)
|
116
118
|
raise_this(name) unless source_location
|
117
119
|
this_file, line_number = *source_location
|
118
|
-
pp source_location
|
119
|
-
pp this_file
|
120
|
-
pp line_number
|
121
120
|
MethodIntrospection.set_this_file(this_file)
|
122
121
|
MethodIntrospection.set_line_number(line_number)
|
123
122
|
comment_describing(lines_for(this_file), line_number)
|
data/lib/method_introspection.rb
CHANGED
@@ -26,6 +26,7 @@ module MethodIntrospection
|
|
26
26
|
MethodIntrospection.source_helper(source_location, defined?(name) ? name : inspect)
|
27
27
|
end
|
28
28
|
|
29
|
+
# ======================================================================= #
|
29
30
|
# === comment
|
30
31
|
#
|
31
32
|
# Return the comments associated with the method as a string.
|