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: which_command.rb
    path of file: ./repos/artichoke/artichoke-backend/vendor/ruby/lib/rubygems/commands
    
    the code of the file until where you have to start completion: # frozen_string_literal: true
require_relative '../command'

class Gem::Commands::WhichCommand < Gem::Command
  def initialize
    super 'which', 'Find the location of a library file you can require',
          :search_gems_first => false, :show_all => false

    ad
    
  def find_paths(package_name, dirs)
    result = []

    dirs.each do |dir|
      Gem.suffixes.each do |ext|
        full_path = File.join dir, "#{package_name}#{ext}"
        if File.exist? full_path and not File.directory? full_path
          result << full_path
          return result unless options[:show_all]
        end
      end
    end