    # File lib/chef/formatters/error_inspectors/resource_failure_inspector.rb, line 55
            def recipe_snippet
              return nil if dynamic_resource?
              @snippet ||= begin
                if file = resource.source_line[/^(([\w]:)?[^:]+):([\d]+)/,1] and line = resource.source_line[/^#{file}:([\d]+)/,1].to_i
                  return nil unless ::File.exists?(file)
                  lines = IO.readlines(file)

                  relevant_lines = ["# In #{file}\n\n"]

                  current_line = line - 1
                  current_line = 0 if current_line < 0
                  nesting = 0

                  loop do

                    # low rent parser. try to gracefully handle nested blocks in resources
                    nesting += 1 if lines[current_line] =~ /[\s]+do[\s]*/
                    nesting -= 1 if lines[current_line] =~ /end[\s]*$/

                    relevant_lines << format_line(current_line, lines[current_line])

                    break if lines[current_line + 1].nil?
                    break if current_line >= (line + 50)
                    break if nesting <= 0

                    current_line += 1
                  end
                  relevant_lines << format_line(current_line + 1, lines[current_line + 1]) if lines[current_line + 1]
                  relevant_lines.join("")
                end
              end
            end