spicycode-inspector 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/inspector.rb +7 -6
- metadata +1 -1
data/lib/inspector.rb
CHANGED
@@ -58,11 +58,7 @@ class Inspector
|
|
58
58
|
event = _trace_the_method_call(&block)
|
59
59
|
|
60
60
|
if event
|
61
|
-
|
62
|
-
"Sorry, Ruby2Ruby can't peek under the hood in ActiveRecord::Base (modules + classes == fail in ruby2ruby)"
|
63
|
-
else
|
64
|
-
RubyToRuby.translate(event[:classname], event[:id])
|
65
|
-
end
|
61
|
+
RubyToRuby.translate(event[:classname], event[:id])
|
66
62
|
else
|
67
63
|
"Unable to determine where the method was defined in order to get to it's source"
|
68
64
|
end
|
@@ -74,6 +70,11 @@ class Inspector
|
|
74
70
|
return "Unable to get the source for #{event[:classname]}.#{event[:id]} because it is a function defined in C"
|
75
71
|
end
|
76
72
|
raise
|
73
|
+
rescue Exception => ex
|
74
|
+
if event[:classname].to_s == 'ActiveRecord::Base'
|
75
|
+
return "Sorry, Ruby2Ruby can't peek under the hood in ActiveRecord::Base (modules + classes == fail in ruby2ruby)"
|
76
|
+
end
|
77
|
+
raise
|
77
78
|
end
|
78
79
|
end
|
79
80
|
|
@@ -81,7 +82,7 @@ class Inspector
|
|
81
82
|
where = where_is_this_defined(&block)
|
82
83
|
how = how_is_this_defined(&block)
|
83
84
|
|
84
|
-
"Sir, here are the details of your inquiry:\nThe method in question was found to be defined in:\n#{where}
|
85
|
+
"Sir, here are the details of your inquiry:\n\nThe method in question was found to be defined in:\n#{where}\n\nAlso, it was found to look like the following on the inside:\n#{how}\n\n"
|
85
86
|
end
|
86
87
|
|
87
88
|
end
|