omniauth-beeminder 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,2 @@
1
+ require 'omniauth-beeminder/version'
2
+ require 'omniauth/strategies/beeminder'
@@ -0,0 +1,5 @@
1
+ module OmniAuth
2
+ module Beeminder
3
+ VERSION = "0.1.0"
4
+ end
5
+ end
@@ -0,0 +1,32 @@
1
+ require 'omniauth-oauth2'
2
+
3
+ module OmniAuth
4
+ module Strategies
5
+ class Beeminder < OmniAuth::Strategies::OAuth2
6
+ option :name, 'beeminder'
7
+
8
+ option :client_options, {
9
+ :site => 'https://www.beeminder.com',
10
+ :authorize_url => 'https://www.beeminder.com/apps/authorize',
11
+ :token_url => 'https://www.beeminder.com/apps/authorize',
12
+ :response_type => 'token'
13
+ }
14
+
15
+ uid {
16
+ raw_info['username']
17
+ }
18
+
19
+ info do
20
+ {
21
+ 'id' => raw_info['username']
22
+ }
23
+ end
24
+
25
+ def raw_info
26
+ @raw_info ||= MultiJson.load(access_token.get("/api/v1/users/me.json?access_token=#{access_token.token}").body)
27
+ end
28
+ end
29
+ end
30
+ end
31
+
32
+ OmniAuth.config.add_camelization 'beeminder', 'Beeminder'
metadata ADDED
@@ -0,0 +1,60 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: omniauth-beeminder
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Andy Brett
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-10-20 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: omniauth-oauth2
16
+ requirement: &70200679245940 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: 1.1.1
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *70200679245940
25
+ description: An omniauth strategy for Beeminder.
26
+ email:
27
+ - andy@andybrett.com
28
+ executables: []
29
+ extensions: []
30
+ extra_rdoc_files: []
31
+ files:
32
+ - lib/omniauth-beeminder.rb
33
+ - lib/omniauth/strategies/beeminder.rb
34
+ - lib/omniauth-beeminder/version.rb
35
+ homepage: https://github.com/beeminder/omniauth-beeminder
36
+ licenses:
37
+ - MIT
38
+ post_install_message:
39
+ rdoc_options: []
40
+ require_paths:
41
+ - lib
42
+ required_ruby_version: !ruby/object:Gem::Requirement
43
+ none: false
44
+ requirements:
45
+ - - ! '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ required_rubygems_version: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ requirements: []
55
+ rubyforge_project:
56
+ rubygems_version: 1.8.13
57
+ signing_key:
58
+ specification_version: 3
59
+ summary: Omniauth strategy for Beeminder
60
+ test_files: []