lib/lookbook/preview_example.rb in lookbook-1.0.7 vs lib/lookbook/preview_example.rb in lookbook-1.0.8
- old
+ new
@@ -25,10 +25,10 @@
def display_params
@preview.display_params.merge(@example_inspector.display_params)
end
def method_source
- @example_inspector.source.split("\n")[1..-2].join("\n").strip_heredoc
+ @example_inspector.source.sub(/^def \w+\s?(\([^)]+\))?/m, "").split("\n")[0..-2].join("\n").strip_heredoc.strip
end
def lang
Lookbook::Lang.find(:ruby)
end