omniauth-vocabulario 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,15 @@
1
+ source "http://rubygems.org"
2
+
3
+ gem 'gravatar-ultimate'
4
+ gem 'multi_json', '~> 1.3'
5
+ gem 'omniauth-oauth', '~> 1.0'
6
+
7
+ group :development do
8
+ gem "rspec", "~> 2.10.0"
9
+ gem "rack-test"
10
+ gem "rdoc", "~> 3.12"
11
+ gem "bundler", ">= 1.0.0"
12
+ gem "jeweler", "~> 1.8.3"
13
+ gem "simplecov"
14
+ gem "webmock"
15
+ end
@@ -0,0 +1,59 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ addressable (2.2.8)
5
+ crack (0.3.1)
6
+ diff-lcs (1.1.3)
7
+ git (1.2.5)
8
+ gravatar-ultimate (1.0.3)
9
+ hashie (1.2.0)
10
+ jeweler (1.8.3)
11
+ bundler (~> 1.0)
12
+ git (>= 1.2.5)
13
+ rake
14
+ rdoc
15
+ json (1.7.3)
16
+ multi_json (1.3.6)
17
+ oauth (0.4.6)
18
+ omniauth (1.1.0)
19
+ hashie (~> 1.2)
20
+ rack
21
+ omniauth-oauth (1.0.1)
22
+ oauth
23
+ omniauth (~> 1.0)
24
+ rack (1.4.1)
25
+ rack-test (0.6.1)
26
+ rack (>= 1.0)
27
+ rake (0.9.2.2)
28
+ rdoc (3.12)
29
+ json (~> 1.4)
30
+ rspec (2.10.0)
31
+ rspec-core (~> 2.10.0)
32
+ rspec-expectations (~> 2.10.0)
33
+ rspec-mocks (~> 2.10.0)
34
+ rspec-core (2.10.1)
35
+ rspec-expectations (2.10.0)
36
+ diff-lcs (~> 1.1.3)
37
+ rspec-mocks (2.10.1)
38
+ simplecov (0.6.4)
39
+ multi_json (~> 1.0)
40
+ simplecov-html (~> 0.5.3)
41
+ simplecov-html (0.5.3)
42
+ webmock (1.8.7)
43
+ addressable (>= 2.2.7)
44
+ crack (>= 0.1.7)
45
+
46
+ PLATFORMS
47
+ ruby
48
+
49
+ DEPENDENCIES
50
+ bundler (>= 1.0.0)
51
+ gravatar-ultimate
52
+ jeweler (~> 1.8.3)
53
+ multi_json (~> 1.3)
54
+ omniauth-oauth (~> 1.0)
55
+ rack-test
56
+ rdoc (~> 3.12)
57
+ rspec (~> 2.10.0)
58
+ simplecov
59
+ webmock
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2012 Ulf Möhring
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,19 @@
1
+ = omniauth-vocabulario
2
+
3
+ An omniauth strategy for http://vocabulario.me
4
+
5
+ == Contributing to omniauth-vocabulario
6
+
7
+ * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
8
+ * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
9
+ * Fork the project.
10
+ * Start a feature/bugfix branch.
11
+ * Commit and push until you are happy with your contribution.
12
+ * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
13
+ * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
14
+
15
+ == Copyright
16
+
17
+ Copyright (c) 2012 Ulf Möhring. See LICENSE.txt for
18
+ further details.
19
+
@@ -0,0 +1,50 @@
1
+ # encoding: utf-8
2
+
3
+ require 'rubygems'
4
+ require 'bundler'
5
+ begin
6
+ Bundler.setup(:default, :development)
7
+ rescue Bundler::BundlerError => e
8
+ $stderr.puts e.message
9
+ $stderr.puts "Run `bundle install` to install missing gems"
10
+ exit e.status_code
11
+ end
12
+ require 'rake'
13
+
14
+ require 'jeweler'
15
+ Jeweler::Tasks.new do |gem|
16
+ # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
17
+ gem.name = "omniauth-vocabulario"
18
+ gem.homepage = "http://github.com/paceline/omniauth-vocabulario"
19
+ gem.license = "MIT"
20
+ gem.summary = "An omniauth strategy for http://vocabulario.me"
21
+ gem.description = "An omniauth strategy for http://vocabulario.me"
22
+ gem.email = "hello@ulfmoehring.net"
23
+ gem.authors = ["Ulf Möhring"]
24
+ gem.files = FileList["[A-Z]*","{lib,spec}/**/*"]
25
+ # dependencies defined in Gemfile
26
+ end
27
+ Jeweler::RubygemsDotOrgTasks.new
28
+
29
+ require 'rspec/core'
30
+ require 'rspec/core/rake_task'
31
+ RSpec::Core::RakeTask.new(:spec) do |spec|
32
+ spec.pattern = FileList['spec/**/*_spec.rb']
33
+ end
34
+
35
+ RSpec::Core::RakeTask.new(:rcov) do |spec|
36
+ spec.pattern = 'spec/**/*_spec.rb'
37
+ spec.rcov = true
38
+ end
39
+
40
+ task :default => :spec
41
+
42
+ require 'rdoc/task'
43
+ Rake::RDocTask.new do |rdoc|
44
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
45
+
46
+ rdoc.rdoc_dir = 'rdoc'
47
+ rdoc.title = "omniauth-vocabulario #{version}"
48
+ rdoc.rdoc_files.include('README*')
49
+ rdoc.rdoc_files.include('lib/**/*.rb')
50
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.0.1
@@ -0,0 +1,2 @@
1
+ require 'omniauth-vocabulario/version'
2
+ require 'omniauth/strategies/vocabulario'
@@ -0,0 +1,5 @@
1
+ module OmniAuth
2
+ module Vocabulario
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
@@ -0,0 +1,38 @@
1
+ require 'omniauth-oauth'
2
+ require 'multi_json'
3
+ require 'gravatar-ultimate'
4
+
5
+ module OmniAuth
6
+ module Strategies
7
+ class Vocabulario < OmniAuth::Strategies::OAuth
8
+ option :name, 'vocabulario'
9
+ option :client_options, {:site => 'http://vocabulario.me'}
10
+
11
+ uid do
12
+ raw_info['id']
13
+ end
14
+
15
+ info do
16
+ {
17
+ :nickname => raw_info['permalink'],
18
+ :name => raw_info['name'],
19
+ :email => raw_info['email'],
20
+ :image => Gravatar.new(raw_info['email']).image_url,
21
+ :urls => {
22
+ 'Vocabulario' => 'http://vocabulario.me/users/' + raw_info['permalink']
23
+ }
24
+ }
25
+ end
26
+
27
+ extra do
28
+ { :raw_info => raw_info }
29
+ end
30
+
31
+ def raw_info
32
+ @raw_info ||= MultiJson.load(access_token.get('/users/current.json').body)['user']
33
+ rescue ::Errno::ETIMEDOUT
34
+ raise ::Timeout::Error
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,17 @@
1
+ require 'spec_helper'
2
+
3
+ describe OmniAuth::Strategies::Vocabulario do
4
+ subject do
5
+ OmniAuth::Strategies::Vocabulario.new({})
6
+ end
7
+
8
+ context "client options" do
9
+ it 'should have correct name' do
10
+ subject.options.name.should eq("vocabulario")
11
+ end
12
+
13
+ it 'should have correct site' do
14
+ subject.options.client_options.site.should eq('http://vocabulario.me')
15
+ end
16
+ end
17
+ 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-vocabulario'
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,171 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: omniauth-vocabulario
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Ulf Möhring
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-06-03 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: gravatar-ultimate
16
+ requirement: &21144300 !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: *21144300
25
+ - !ruby/object:Gem::Dependency
26
+ name: multi_json
27
+ requirement: &21142320 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ~>
31
+ - !ruby/object:Gem::Version
32
+ version: '1.3'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: *21142320
36
+ - !ruby/object:Gem::Dependency
37
+ name: omniauth-oauth
38
+ requirement: &21139320 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ~>
42
+ - !ruby/object:Gem::Version
43
+ version: '1.0'
44
+ type: :runtime
45
+ prerelease: false
46
+ version_requirements: *21139320
47
+ - !ruby/object:Gem::Dependency
48
+ name: rspec
49
+ requirement: &20753440 !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: 2.10.0
55
+ type: :development
56
+ prerelease: false
57
+ version_requirements: *20753440
58
+ - !ruby/object:Gem::Dependency
59
+ name: rack-test
60
+ requirement: &21668580 !ruby/object:Gem::Requirement
61
+ none: false
62
+ requirements:
63
+ - - ! '>='
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
66
+ type: :development
67
+ prerelease: false
68
+ version_requirements: *21668580
69
+ - !ruby/object:Gem::Dependency
70
+ name: rdoc
71
+ requirement: &21676120 !ruby/object:Gem::Requirement
72
+ none: false
73
+ requirements:
74
+ - - ~>
75
+ - !ruby/object:Gem::Version
76
+ version: '3.12'
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: *21676120
80
+ - !ruby/object:Gem::Dependency
81
+ name: bundler
82
+ requirement: &21671100 !ruby/object:Gem::Requirement
83
+ none: false
84
+ requirements:
85
+ - - ! '>='
86
+ - !ruby/object:Gem::Version
87
+ version: 1.0.0
88
+ type: :development
89
+ prerelease: false
90
+ version_requirements: *21671100
91
+ - !ruby/object:Gem::Dependency
92
+ name: jeweler
93
+ requirement: &21684100 !ruby/object:Gem::Requirement
94
+ none: false
95
+ requirements:
96
+ - - ~>
97
+ - !ruby/object:Gem::Version
98
+ version: 1.8.3
99
+ type: :development
100
+ prerelease: false
101
+ version_requirements: *21684100
102
+ - !ruby/object:Gem::Dependency
103
+ name: simplecov
104
+ requirement: &21706320 !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ type: :development
111
+ prerelease: false
112
+ version_requirements: *21706320
113
+ - !ruby/object:Gem::Dependency
114
+ name: webmock
115
+ requirement: &21703220 !ruby/object:Gem::Requirement
116
+ none: false
117
+ requirements:
118
+ - - ! '>='
119
+ - !ruby/object:Gem::Version
120
+ version: '0'
121
+ type: :development
122
+ prerelease: false
123
+ version_requirements: *21703220
124
+ description: An omniauth strategy for http://vocabulario.me
125
+ email: hello@ulfmoehring.net
126
+ executables: []
127
+ extensions: []
128
+ extra_rdoc_files:
129
+ - LICENSE.txt
130
+ - README.rdoc
131
+ files:
132
+ - Gemfile
133
+ - Gemfile.lock
134
+ - LICENSE.txt
135
+ - README.rdoc
136
+ - Rakefile
137
+ - VERSION
138
+ - lib/omniauth-vocabulario.rb
139
+ - lib/omniauth-vocabulario/version.rb
140
+ - lib/omniauth/strategies/vocabulario.rb
141
+ - spec/omniauth/strategies/vocabulario_spec.rb
142
+ - spec/spec_helper.rb
143
+ homepage: http://github.com/paceline/omniauth-vocabulario
144
+ licenses:
145
+ - MIT
146
+ post_install_message:
147
+ rdoc_options: []
148
+ require_paths:
149
+ - lib
150
+ required_ruby_version: !ruby/object:Gem::Requirement
151
+ none: false
152
+ requirements:
153
+ - - ! '>='
154
+ - !ruby/object:Gem::Version
155
+ version: '0'
156
+ segments:
157
+ - 0
158
+ hash: 3227175367230111648
159
+ required_rubygems_version: !ruby/object:Gem::Requirement
160
+ none: false
161
+ requirements:
162
+ - - ! '>='
163
+ - !ruby/object:Gem::Version
164
+ version: '0'
165
+ requirements: []
166
+ rubyforge_project:
167
+ rubygems_version: 1.8.11
168
+ signing_key:
169
+ specification_version: 3
170
+ summary: An omniauth strategy for http://vocabulario.me
171
+ test_files: []