lib/github/ldap.rb
def search(options, &block)
      instrument "search.github_ldap", options.dup do |payload|
        result =
          if options[:base]
            @connection.search(options, &block)
          else
            search_domains.each_with_object([]) do |base, result|
              rs = @connection.search(options.merge(:base => base), &block)
              result.concat Array(rs) unless rs == false
            end
          end

        return [] if result == false
        Array(result)
      end
    end
def search(options, &block)
      instrument "search.github_ldap", options.dup do |payload|
        result =
          if options[:base]
            @connection.search(options, &block)
          else
            search_domains.each_with_object([]) do |base, result|
              rs = @connection.search(options.merge(:base => base), &block)
              result.concat Array(rs) unless rs == false
            end
          end

        return [] if result == false
        Array(result)
      end
    end
Public - Search entries in the ldap server.

 options: is a hash with the same options that Net::LDAP::Connection#search supports.
 block: is an optional block to pass to the search.

 Returns an Array of Net::LDAP::Entry.