2016-02-17 15:13:19 +01:00
|
|
|
require 'goldfinger/request'
|
2016-02-17 23:16:08 +01:00
|
|
|
require 'goldfinger/link'
|
2016-02-17 15:13:19 +01:00
|
|
|
require 'goldfinger/result'
|
|
|
|
require 'goldfinger/utils'
|
|
|
|
require 'goldfinger/client'
|
|
|
|
|
|
|
|
module Goldfinger
|
2016-02-17 16:58:02 +01:00
|
|
|
class Error < StandardError
|
|
|
|
end
|
|
|
|
|
|
|
|
class NotFoundError < Error
|
|
|
|
end
|
|
|
|
|
|
|
|
class SSLError < Error
|
2016-02-17 15:13:19 +01:00
|
|
|
end
|
|
|
|
|
2016-02-17 23:16:08 +01:00
|
|
|
# Returns result for the Webfinger query
|
|
|
|
#
|
|
|
|
# @raise [Goldfinger::NotFoundError] Error raised when the Webfinger resource could not be retrieved
|
|
|
|
# @raise [Goldfinger::SSLError] Error raised when there was a SSL error when fetching the resource
|
|
|
|
# @param uri [String] A full resource identifier in the format acct:user@example.com
|
|
|
|
# @return [Goldfinger::Result]
|
2016-02-17 15:13:19 +01:00
|
|
|
def self.finger(uri)
|
|
|
|
Goldfinger::Client.new(uri).finger
|
|
|
|
end
|
|
|
|
end
|