All Files
(80.0%
covered at
0.9
hits/line)
2 files in total.
15 relevant lines.
12 lines covered and
3 lines missed
-
1
require 'omniauth-heello/version'
-
1
require 'omniauth/strategies/heello'
-
1
require 'omniauth-oauth2'
-
-
1
module OmniAuth
-
1
module Strategies
-
1
class Heello < OmniAuth::Strategies::OAuth2
-
-
1
option :name, 'heello'
-
1
option :client_options, {
-
site: "https://api.heello.com",
-
authorize_url: "/oauth/authorize",
-
proxy: ENV['http_proxy'] ? URI(ENV['http_proxy']) : nil
-
}
-
-
1
uid { raw_info["id"] }
-
-
1
info do
-
{
-
nickname: raw_info["username"],
-
name: raw_info["name"],
-
website: raw_info["website"],
-
-
images: {
-
avatar: raw_info["avatar"],
-
background: raw_info["background"],
-
cover: raw_info["cover"]
-
},
-
urls: {
-
website: raw_info["website"],
-
heello: "http://heello.com/" + raw_info["username"]
-
}
-
}
-
end
-
-
1
extra do
-
{ raw_info: raw_info }
-
end
-
-
1
def raw_info
-
@raw_info ||= access_token.get("/users/me.json").parsed["response"]
-
end
-
-
end
-
end
-
end