omniauth-podio 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,18 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
5
+ *.rbc
6
+ .config
7
+ .yardoc
8
+ InstalledFiles
9
+ _yardoc
10
+ coverage
11
+ doc/
12
+ lib/bundler/man
13
+ /pkg
14
+ rdoc
15
+ spec/reports
16
+ test/tmp
17
+ test/version_tmp
18
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in omniauth-podio.gemspec
4
+ gemspec
data/README.md ADDED
@@ -0,0 +1,21 @@
1
+ # OmniAuth Podio
2
+
3
+ This is a OmniAuth strategy for authenticating to Podio.
4
+
5
+ ## Basic Usage
6
+
7
+ Rails.application.config.middleware.use OmniAuth::Builder do
8
+ provider :podio, ENV['CLIENT_ID'], ENV['CLIENT_SECRET']
9
+ end
10
+
11
+ ## License
12
+
13
+ ###(The MIT License)
14
+
15
+ Copyright (c) 2011 Lucas Allan Amorim (www.lucasallan.com)
16
+
17
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ‘Software’), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
20
+
21
+ THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env rake
2
+ require "bundler/gem_tasks"
3
+ require 'rspec/core/rake_task'
4
+
5
+ desc 'Default: run specs.'
6
+ task :default => :spec
7
+
8
+ desc "Run specs"
9
+ RSpec::Core::RakeTask.new
10
+
11
+ desc 'Run specs'
12
+ task :default => :spec
@@ -0,0 +1,2 @@
1
+ require "omniauth-podio/version"
2
+ require 'omniauth/strategies/podio'
@@ -0,0 +1,5 @@
1
+ module Omniauth
2
+ module Podio
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 Podio < OmniAuth::Strategies::OAuth2
6
+ option :client_options, {
7
+ :site => 'https://api.podio.com/',
8
+ :authorize_url => 'https://podio.com/oauth/authorize',
9
+ :token_url => "https://podio.com/oauth/token"
10
+ }
11
+
12
+ def request_phase
13
+ super
14
+ end
15
+
16
+ info do
17
+ {
18
+ :email => raw_info["mail"],
19
+ :user_id => raw_info["user_id"]
20
+
21
+ }
22
+ end
23
+
24
+ extra do
25
+ {:raw_info => raw_info}
26
+ end
27
+
28
+ def raw_info
29
+ @raw_info ||= MultiJson.decode(access_token.get('/user').body)
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,25 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "omniauth-podio/version"
4
+
5
+ Gem::Specification.new do |gem|
6
+ gem.authors = ["Lucas Allan"]
7
+ gem.email = ["lucas.allan@gmail.com"]
8
+ gem.description = %q{OmniAuth strategy for Podio.}
9
+ gem.summary = %q{OmniAuth strategy for Podio.}
10
+ gem.homepage = "https://github.com/lucasallan/omniauth-podio"
11
+
12
+ gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
13
+ gem.files = `git ls-files`.split("\n")
14
+ gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
15
+ gem.name = "omniauth-podio"
16
+ gem.require_paths = ["lib"]
17
+ gem.version = Omniauth::Podio::VERSION
18
+
19
+ gem.add_dependency 'omniauth', '~> 1.0'
20
+ gem.add_dependency 'omniauth-oauth2', '~> 1.0'
21
+ gem.add_development_dependency 'rspec', '~> 2.7'
22
+ gem.add_development_dependency 'rack-test'
23
+ gem.add_development_dependency 'simplecov'
24
+ gem.add_development_dependency 'webmock'
25
+ end
@@ -0,0 +1,7 @@
1
+ require 'spec_helper'
2
+
3
+ describe OmniAuth::Strategies::Podio do
4
+ it 'should do some testing' do
5
+ pending
6
+ end
7
+ end
@@ -0,0 +1,15 @@
1
+ $:.unshift File.expand_path('..', __FILE__)
2
+ $:.unshift File.expand_path('../../lib', __FILE__)
3
+ require 'simplecov'
4
+ SimpleCov.start
5
+ require 'rspec'
6
+ require 'rack/test'
7
+ require 'webmock/rspec'
8
+ require 'omniauth'
9
+ require 'omniauth-github'
10
+
11
+ RSpec.configure do |config|
12
+ config.include WebMock::API
13
+ config.include Rack::Test::Methods
14
+ config.extend OmniAuth::Test::StrategyMacros, :type => :strategy
15
+ end
metadata ADDED
@@ -0,0 +1,162 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: omniauth-podio
3
+ version: !ruby/object:Gem::Version
4
+ hash: 29
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 1
10
+ version: 0.0.1
11
+ platform: ruby
12
+ authors:
13
+ - Lucas Allan
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-12-21 00:00:00 Z
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: omniauth
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ~>
27
+ - !ruby/object:Gem::Version
28
+ hash: 15
29
+ segments:
30
+ - 1
31
+ - 0
32
+ version: "1.0"
33
+ type: :runtime
34
+ version_requirements: *id001
35
+ - !ruby/object:Gem::Dependency
36
+ name: omniauth-oauth2
37
+ prerelease: false
38
+ requirement: &id002 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ~>
42
+ - !ruby/object:Gem::Version
43
+ hash: 15
44
+ segments:
45
+ - 1
46
+ - 0
47
+ version: "1.0"
48
+ type: :runtime
49
+ version_requirements: *id002
50
+ - !ruby/object:Gem::Dependency
51
+ name: rspec
52
+ prerelease: false
53
+ requirement: &id003 !ruby/object:Gem::Requirement
54
+ none: false
55
+ requirements:
56
+ - - ~>
57
+ - !ruby/object:Gem::Version
58
+ hash: 13
59
+ segments:
60
+ - 2
61
+ - 7
62
+ version: "2.7"
63
+ type: :development
64
+ version_requirements: *id003
65
+ - !ruby/object:Gem::Dependency
66
+ name: rack-test
67
+ prerelease: false
68
+ requirement: &id004 !ruby/object:Gem::Requirement
69
+ none: false
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ hash: 3
74
+ segments:
75
+ - 0
76
+ version: "0"
77
+ type: :development
78
+ version_requirements: *id004
79
+ - !ruby/object:Gem::Dependency
80
+ name: simplecov
81
+ prerelease: false
82
+ requirement: &id005 !ruby/object:Gem::Requirement
83
+ none: false
84
+ requirements:
85
+ - - ">="
86
+ - !ruby/object:Gem::Version
87
+ hash: 3
88
+ segments:
89
+ - 0
90
+ version: "0"
91
+ type: :development
92
+ version_requirements: *id005
93
+ - !ruby/object:Gem::Dependency
94
+ name: webmock
95
+ prerelease: false
96
+ requirement: &id006 !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ">="
100
+ - !ruby/object:Gem::Version
101
+ hash: 3
102
+ segments:
103
+ - 0
104
+ version: "0"
105
+ type: :development
106
+ version_requirements: *id006
107
+ description: OmniAuth strategy for Podio.
108
+ email:
109
+ - lucas.allan@gmail.com
110
+ executables: []
111
+
112
+ extensions: []
113
+
114
+ extra_rdoc_files: []
115
+
116
+ files:
117
+ - .gitignore
118
+ - Gemfile
119
+ - README.md
120
+ - Rakefile
121
+ - lib/omniauth-podio.rb
122
+ - lib/omniauth-podio/version.rb
123
+ - lib/omniauth/strategies/podio.rb
124
+ - omniauth-podio.gemspec
125
+ - spec/omniauth/strategies/podio_spec.rb
126
+ - spec/spec_helper.rb
127
+ homepage: https://github.com/lucasallan/omniauth-podio
128
+ licenses: []
129
+
130
+ post_install_message:
131
+ rdoc_options: []
132
+
133
+ require_paths:
134
+ - lib
135
+ required_ruby_version: !ruby/object:Gem::Requirement
136
+ none: false
137
+ requirements:
138
+ - - ">="
139
+ - !ruby/object:Gem::Version
140
+ hash: 3
141
+ segments:
142
+ - 0
143
+ version: "0"
144
+ required_rubygems_version: !ruby/object:Gem::Requirement
145
+ none: false
146
+ requirements:
147
+ - - ">="
148
+ - !ruby/object:Gem::Version
149
+ hash: 3
150
+ segments:
151
+ - 0
152
+ version: "0"
153
+ requirements: []
154
+
155
+ rubyforge_project:
156
+ rubygems_version: 1.8.10
157
+ signing_key:
158
+ specification_version: 3
159
+ summary: OmniAuth strategy for Podio.
160
+ test_files:
161
+ - spec/omniauth/strategies/podio_spec.rb
162
+ - spec/spec_helper.rb