def find_lints(ruby, source_map)
      rubocop = ::RuboCop::CLI.new

      filename =
        if document.file
          "#{document.file}.rb"
        else
          'ruby_script.rb'
        end

      with_ruby_from_stdin(ruby) do
        extract_lints_from_offenses(lint_file(rubocop, filename), source_map)
      end
    end
def find_lints(ruby, source_map)
      rubocop = ::RuboCop::CLI.new

      filename =
        if document.file
          "#{document.file}.rb"
        else
          'ruby_script.rb'
        end

      with_ruby_from_stdin(ruby) do
        extract_lints_from_offenses(lint_file(rubocop, filename), source_map)
      end
    end
Executes RuboCop against the given Ruby code and records the offenses as
 lints.

 @param ruby [String] Ruby code
 @param source_map [Hash] map of Ruby code line numbers to original line
   numbers in the template