You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: resource_failure_inspector.rb
    path of file: ./repos/chef/lib/chef/formatters/error_inspectors
    
    the code of the file until where you have to start completion: #--
# Author:: Daniel DeLeo (<dan@chef.io>)
# Author:: Tyler Cloke (<tyler@chef.io>)
# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or imp
    
        def recipe_snippet
          return nil if dynamic_resource?

          @snippet ||= if (file = parse_source) && (line = parse_line(file))
                         return nil unless ::File.exist?(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 /\s+do\s*/.match?(lines[current_line])
                           nesting -= 1 if /end\s*$/.match?(lines[current_line])

                           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