omniauth-workmate 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'http://rubygems.org'
2
+
3
+ gemspec
data/Manifest ADDED
@@ -0,0 +1,8 @@
1
+ Gemfile
2
+ Manifest
3
+ README.md
4
+ Rakefile
5
+ lib/omniauth-workmate.rb
6
+ lib/omniauth-workmate/version.rb
7
+ lib/omniauth/strategies/workmate.rb
8
+ omniauth-workmate.gemspec
data/README.md ADDED
@@ -0,0 +1,9 @@
1
+ # OmniAuth WorkMate
2
+
3
+ This is the OmniAuth strategy for authenticating to WorkMate.
4
+
5
+ ## Basic Usage
6
+
7
+ use OmniAuth::Builder do
8
+ provider :workmate, ENV['WORKMATE_KEY'], ENV['WORKMATE_SECRET']
9
+ end
data/Rakefile ADDED
@@ -0,0 +1,13 @@
1
+ require 'psych'
2
+ require 'rubygems'
3
+ require 'rake'
4
+ require 'echoe'
5
+
6
+ Echoe.new('omniauth-workmate', '0.0.1') do |p|
7
+ p.description = "WorkMate strategy for OmniAuth."
8
+ p.url = "http://github.com/workmate/omniauth-workmate"
9
+ p.author = "Iskander Haziev"
10
+ p.email = "gvalmon@gmail.com"
11
+ p.ignore_pattern = ["tmp/*", "script/*"]
12
+ p.runtime_dependencies = ['omniauth', 'omniauth-oauth2']
13
+ end
@@ -0,0 +1,2 @@
1
+ require "omniauth-workmate/version"
2
+ require 'omniauth/strategies/workmate'
@@ -0,0 +1,5 @@
1
+ module OmniAuth
2
+ module Workmate
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
@@ -0,0 +1,33 @@
1
+ require 'omniauth-oauth2'
2
+
3
+ module OmniAuth
4
+ module Strategies
5
+ class Workmate < OmniAuth::Strategies::OAuth2
6
+ option :client_options, {
7
+ :site => 'https://workmateapp.com',
8
+ :authorize_url => 'https://workmateapp.com/oauth/authorize',
9
+ :token_url => 'https://workmateapp.com/oauth/token'
10
+ }
11
+
12
+ def request_phase
13
+ super
14
+ end
15
+
16
+ uid { raw_info['id'] }
17
+
18
+ info do
19
+ {
20
+ 'email' => raw_info['email'],
21
+ 'name' => raw_info['name']
22
+ }
23
+ end
24
+
25
+ def raw_info
26
+ access_token.options[:mode] = :query
27
+ @raw_info ||= access_token.get('/user').parsed
28
+ end
29
+ end
30
+ end
31
+ end
32
+
33
+ OmniAuth.config.add_camelization 'workmate', 'Workmate'
@@ -0,0 +1,35 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = "omniauth-workmate"
5
+ s.version = "0.0.1"
6
+
7
+ s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
+ s.authors = ["Iskander Haziev"]
9
+ s.date = "2011-11-15"
10
+ s.description = "WorkMate strategy for OmniAuth."
11
+ s.email = "gvalmon@gmail.com"
12
+ s.extra_rdoc_files = ["README.md", "lib/omniauth-workmate.rb", "lib/omniauth-workmate/version.rb", "lib/omniauth/strategies/workmate.rb"]
13
+ s.files = ["Gemfile", "Manifest", "README.md", "Rakefile", "lib/omniauth-workmate.rb", "lib/omniauth-workmate/version.rb", "lib/omniauth/strategies/workmate.rb", "omniauth-workmate.gemspec"]
14
+ s.homepage = "http://github.com/workmate/omniauth-workmate"
15
+ s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Omniauth-workmate", "--main", "README.md"]
16
+ s.require_paths = ["lib"]
17
+ s.rubyforge_project = "omniauth-workmate"
18
+ s.rubygems_version = "1.8.10"
19
+ s.summary = "WorkMate strategy for OmniAuth."
20
+
21
+ if s.respond_to? :specification_version then
22
+ s.specification_version = 3
23
+
24
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
25
+ s.add_runtime_dependency(%q<omniauth>, [">= 0"])
26
+ s.add_runtime_dependency(%q<omniauth-oauth2>, [">= 0"])
27
+ else
28
+ s.add_dependency(%q<omniauth>, [">= 0"])
29
+ s.add_dependency(%q<omniauth-oauth2>, [">= 0"])
30
+ end
31
+ else
32
+ s.add_dependency(%q<omniauth>, [">= 0"])
33
+ s.add_dependency(%q<omniauth-oauth2>, [">= 0"])
34
+ end
35
+ end
metadata ADDED
@@ -0,0 +1,84 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: omniauth-workmate
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Iskander Haziev
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2011-11-15 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: omniauth
16
+ requirement: &70191342198340 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *70191342198340
25
+ - !ruby/object:Gem::Dependency
26
+ name: omniauth-oauth2
27
+ requirement: &70191342213800 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: *70191342213800
36
+ description: WorkMate strategy for OmniAuth.
37
+ email: gvalmon@gmail.com
38
+ executables: []
39
+ extensions: []
40
+ extra_rdoc_files:
41
+ - README.md
42
+ - lib/omniauth-workmate.rb
43
+ - lib/omniauth-workmate/version.rb
44
+ - lib/omniauth/strategies/workmate.rb
45
+ files:
46
+ - Gemfile
47
+ - Manifest
48
+ - README.md
49
+ - Rakefile
50
+ - lib/omniauth-workmate.rb
51
+ - lib/omniauth-workmate/version.rb
52
+ - lib/omniauth/strategies/workmate.rb
53
+ - omniauth-workmate.gemspec
54
+ homepage: http://github.com/workmate/omniauth-workmate
55
+ licenses: []
56
+ post_install_message:
57
+ rdoc_options:
58
+ - --line-numbers
59
+ - --inline-source
60
+ - --title
61
+ - Omniauth-workmate
62
+ - --main
63
+ - README.md
64
+ require_paths:
65
+ - lib
66
+ required_ruby_version: !ruby/object:Gem::Requirement
67
+ none: false
68
+ requirements:
69
+ - - ! '>='
70
+ - !ruby/object:Gem::Version
71
+ version: '0'
72
+ required_rubygems_version: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '1.2'
78
+ requirements: []
79
+ rubyforge_project: omniauth-workmate
80
+ rubygems_version: 1.8.10
81
+ signing_key:
82
+ specification_version: 3
83
+ summary: WorkMate strategy for OmniAuth.
84
+ test_files: []