method
source_fragment
v8.0.0 -
Show latest stable
- Class:
ActionDispatch::ExceptionWrapper
source_fragment(path, line)private
No documentation available.
# File actionpack/lib/action_dispatch/middleware/exception_wrapper.rb, line 330
def source_fragment(path, line)
return unless Rails.respond_to?(:root) && Rails.root
full_path = Rails.root.join(path)
if File.exist?(full_path)
File.open(full_path, "r") do |file|
extract_source_fragment_lines(file.each_line, line)
end
end
end