omniauth-roomorama 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ ZWRkODJmODM5ZTEwMDBmZDM4OTNhMzI0MmY1ZDk1MGMyZTA1OTgxOQ==
5
+ data.tar.gz: !binary |-
6
+ Nzg2YWVkZWQwNWFkYWM0MWYxNmY0OGFiOTcxNDk0MTQzYTQ2MDg0YQ==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ OGI4M2ZlMjVjOTU1ZjMxZmEwNTY4MmY2MWIxNTg0NDA3NzUzMDg5NDVmMjJl
10
+ YTdmYjExMWRmYjhjMzM1YTgzMWYyYTdmNTM3MjVhZjRlOTYzYTZjYWJhYTIx
11
+ MmZlNzUxMDk0NDJjYWY3ZWQ3ZjU2NTZjYzVkMDc0YWM0NmM5YWU=
12
+ data.tar.gz: !binary |-
13
+ YTMyNWQ5MjVmYTZjNjQyNzQ1NTQzYjk1Mjc1OTM5ZDE4MTA1NTU1YjcyODQ2
14
+ YzVmYWVkMmJmMDFkZTBmNDUwYTkxMmFjZDIxMjU0OTE1OTVjY2FkYWFjZDRj
15
+ Y2RmZjFjZTFhZWU4ZjY0MWNmODRiNjMyNzdkM2ZlMDBkNjRiMTU=
data/.gitignore CHANGED
@@ -6,6 +6,7 @@
6
6
  .rbx
7
7
  .rvmrc
8
8
  .yardoc
9
+ .idea
9
10
  Gemfile.lock
10
11
  bin
11
12
  coverage*
@@ -15,4 +16,4 @@ pkg
15
16
  rdoc
16
17
  rerun.txt
17
18
  tags
18
- tmp
19
+ tmp
data/.rspec CHANGED
@@ -1,2 +1,2 @@
1
1
  --format=nested
2
- --colour
2
+ --colour
data/.travis.yml CHANGED
@@ -1,11 +1,12 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 1.8.7
4
- - 1.9.2
5
- - 1.9.3
6
- - ruby-head
7
- - ree
3
+ - "1.8.7"
4
+ - "1.9.2"
5
+ - "1.9.3"
6
+ - "2.0.0"
8
7
  - jruby-18mode # JRuby in 1.8 mode
9
8
  - jruby-19mode # JRuby in 1.9 mode
10
9
  - rbx-18mode
11
10
  - rbx-19mode
11
+ # uncomment this line if your project needs to run something other than `rake`:
12
+ # script: bundle exec rspec spec
data/Gemfile CHANGED
@@ -1,7 +1,3 @@
1
- source :rubygems
1
+ source 'https://rubygems.org'
2
2
 
3
- gemspec
4
-
5
- group :example do
6
- gem 'sinatra'
7
- end
3
+ gemspec
data/README.md CHANGED
@@ -1,6 +1,9 @@
1
1
  # OmniAuth Roomorama
2
2
 
3
- This is an OmniAuth 1.0 strategy for authenticating to Roomorama. To
3
+ [![Build Status](https://travis-ci.org/roomorama/omniauth-roomorama.png)](https://travis-ci.org/roomorama/omniauth-roomorama)
4
+
5
+
6
+ This is an OmniAuth 1.1 strategy for authenticating to Roomorama. To
4
7
  use it, you'll need to sign up for an OAuth2 Application ID and Secret
5
8
  on the [Roomorama Application's Registration Page](https://roomorama.com/oauth_clients/new).
6
9
 
@@ -16,7 +19,7 @@ Then `bundle install`.
16
19
 
17
20
  ## Usage
18
21
 
19
- `OmniAuth::Strategies::Roomorama` is simply a Rack middleware. Read the OmniAuth 1.0 docs for detailed instructions: https://github.com/intridea/omniauth.
22
+ `OmniAuth::Strategies::Roomorama` is simply a Rack middleware. Read the OmniAuth 1.1 docs for detailed instructions: https://github.com/intridea/omniauth.
20
23
 
21
24
  Here's a quick example, adding the middleware to a Rails app in `config/initializers/omniauth.rb`:
22
25
 
@@ -28,17 +31,14 @@ end
28
31
 
29
32
  ## Supported Rubies
30
33
 
31
- OmniAuth Roomorama is tested under 1.8.7, 1.9.2, 1.9.3, Ruby-head, Ruby Enterprise Edition, JRuby (1.8 and 1.9 mode) and Rubinius (1.8 and 1.9 mode).
32
-
33
- [![CI Build
34
- Status](https://secure.travis-ci.org/BookingSync/omniauth-roomorama.png)](http://travis-ci.org/BookingSync/omniauth-roomorama)
34
+ OmniAuth Roomorama Admin is tested under 1.9.3 but will probably work under other rubies
35
35
 
36
36
  ## License
37
37
 
38
- Copyright (c) 2012 Sébastien Grosjean and [BookingSync.com](http://www.bookingsync.com)
38
+ Copyright (c) 2013 Roomorama
39
39
 
40
40
  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:
41
41
 
42
42
  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
43
43
 
44
- 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.
44
+ 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 CHANGED
File without changes
@@ -1,2 +1,2 @@
1
- require 'omniauth-roomorama/version'
2
- require 'omniauth/strategies/roomorama'
1
+ require 'omniauth/roomorama/version'
2
+ require 'omniauth/roomorama'
@@ -0,0 +1 @@
1
+ require 'omniauth/strategies/roomorama'
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Roomorama
3
- VERSION = '0.1.0'
3
+ VERSION = '0.2.0'
4
4
  end
5
5
  end
@@ -1,13 +1,42 @@
1
- require 'omniauth-oauth2'
1
+ require 'omniauth/strategies/oauth2'
2
2
 
3
3
  module OmniAuth
4
4
  module Strategies
5
5
  class Roomorama < OmniAuth::Strategies::OAuth2
6
6
  option :name, 'roomorama'
7
7
 
8
- option :client_options, { :site => 'https://roomorama.com' }
8
+ option :client_options, {
9
+ :site => 'https://api.roomorama.com',
10
+ :authorize_url => "https://roomorama.com/oauth/authorize",
11
+ :token_url => "https://roomorama.com/oauth/token"
12
+ }
13
+
14
+ uid { raw_info['id'] }
15
+
16
+ info do
17
+ {
18
+ :name => raw_info['login'],
19
+ :email => raw_info['email'],
20
+ :nickname => raw_info['login'],
21
+ :first_name => raw_info['first_name'],
22
+ :last_name => raw_info['last_name'],
23
+ :location => [raw_info['city'], raw_info['country']].delete_if(&:blank?).join(', '),
24
+ :description => raw_info['description'],
25
+ :phone => raw_info['phone_number'],
26
+ }
27
+ end
28
+
29
+ extra do
30
+ {
31
+ :raw_info => raw_info
32
+ }
33
+ end
34
+
35
+ def raw_info
36
+ @raw_info ||= access_token.get('/v1.0/me').parsed['result']
37
+ end
9
38
  end
10
39
  end
11
40
  end
12
41
 
13
- OmniAuth.config.add_camelization 'roomorama', 'Roomorama'
42
+ OmniAuth.config.add_camelization 'roomorama', 'Roomorama'
@@ -1,12 +1,13 @@
1
1
  # -*- encoding: utf-8 -*-
2
- require File.expand_path('../lib/omniauth-roomorama/version', __FILE__)
2
+ require File.expand_path('../lib/omniauth/roomorama/version', __FILE__)
3
3
 
4
4
  Gem::Specification.new do |gem|
5
- gem.authors = ["Sebastien Grosjean"]
6
- gem.email = ["dev@bookingsync.com"]
7
- gem.description = %q{An OmniAuth 1.0 strategy for Roomorama oauth2 identification.}
5
+ gem.authors = ["Donald Piret"]
6
+ gem.email = ["donald@roomorama.com"]
7
+ gem.description = %q{Roomorama OmniAuth strategy.}
8
8
  gem.summary = %q{An OmniAuth 1.0 strategy for Roomorama oauth2 identification.}
9
- gem.homepage = "https://github.com/BookingSync/omniauth-roomorama"
9
+ gem.homepage = "https://github.com/roomorama/omniauth-roomorama"
10
+ gem.license = 'MIT'
10
11
 
11
12
  gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
12
13
  gem.files = `git ls-files`.split("\n")
@@ -15,8 +16,8 @@ Gem::Specification.new do |gem|
15
16
  gem.require_paths = ["lib"]
16
17
  gem.version = OmniAuth::Roomorama::VERSION
17
18
 
18
- gem.add_dependency 'omniauth', '~> 1.0'
19
- gem.add_dependency 'omniauth-oauth2', '~> 1.0'
19
+ gem.add_dependency 'omniauth', '~> 1.1'
20
+ gem.add_dependency 'omniauth-oauth2', '~> 1.1'
20
21
 
21
22
  gem.add_development_dependency 'rspec', '~> 2.7'
22
23
  gem.add_development_dependency 'rake'
@@ -1,7 +1,11 @@
1
1
  require 'spec_helper'
2
- require 'omniauth-roomorama'
2
+ require 'omniauth/roomorama'
3
3
 
4
4
  describe OmniAuth::Strategies::Roomorama do
5
+ before do
6
+ OmniAuth.config.test_mode = true
7
+ end
8
+
5
9
  subject do
6
10
  OmniAuth::Strategies::Roomorama.new(nil, @options || {})
7
11
  end
@@ -10,15 +14,15 @@ describe OmniAuth::Strategies::Roomorama do
10
14
 
11
15
  describe '#client' do
12
16
  it 'should have the correct site' do
13
- subject.client.site.should eq("https://roomorama.com")
17
+ subject.client.site.should eq("https://api.roomorama.com")
14
18
  end
15
19
 
16
20
  it 'should have the correct authorization url' do
17
- subject.client.options[:authorize_url].should eq("/oauth/authorize")
21
+ subject.client.options[:authorize_url].should eq("https://roomorama.com/oauth/authorize")
18
22
  end
19
23
 
20
24
  it 'should have the correct token url' do
21
- subject.client.options[:token_url].should eq('/oauth/token')
25
+ subject.client.options[:token_url].should eq('https://roomorama.com/oauth/token')
22
26
  end
23
27
  end
24
28
 
data/spec/spec_helper.rb CHANGED
@@ -3,4 +3,4 @@ require 'rspec'
3
3
  Dir[File.expand_path('../support/**/*', __FILE__)].each { |f| require f }
4
4
 
5
5
  RSpec.configure do |config|
6
- end
6
+ end
metadata CHANGED
@@ -1,63 +1,74 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-roomorama
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
5
- prerelease:
4
+ version: 0.2.0
6
5
  platform: ruby
7
6
  authors:
8
- - Sebastien Grosjean
7
+ - Donald Piret
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-05-07 00:00:00.000000000Z
11
+ date: 2013-05-08 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: omniauth
16
- requirement: &70231885663260 !ruby/object:Gem::Requirement
17
- none: false
15
+ requirement: !ruby/object:Gem::Requirement
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
21
- version: '1.0'
19
+ version: '1.1'
22
20
  type: :runtime
23
21
  prerelease: false
24
- version_requirements: *70231885663260
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.1'
25
27
  - !ruby/object:Gem::Dependency
26
28
  name: omniauth-oauth2
27
- requirement: &70231885661960 !ruby/object:Gem::Requirement
28
- none: false
29
+ requirement: !ruby/object:Gem::Requirement
29
30
  requirements:
30
31
  - - ~>
31
32
  - !ruby/object:Gem::Version
32
- version: '1.0'
33
+ version: '1.1'
33
34
  type: :runtime
34
35
  prerelease: false
35
- version_requirements: *70231885661960
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '1.1'
36
41
  - !ruby/object:Gem::Dependency
37
42
  name: rspec
38
- requirement: &70231885660480 !ruby/object:Gem::Requirement
39
- none: false
43
+ requirement: !ruby/object:Gem::Requirement
40
44
  requirements:
41
45
  - - ~>
42
46
  - !ruby/object:Gem::Version
43
47
  version: '2.7'
44
48
  type: :development
45
49
  prerelease: false
46
- version_requirements: *70231885660480
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '2.7'
47
55
  - !ruby/object:Gem::Dependency
48
56
  name: rake
49
- requirement: &70231885659280 !ruby/object:Gem::Requirement
50
- none: false
57
+ requirement: !ruby/object:Gem::Requirement
51
58
  requirements:
52
59
  - - ! '>='
53
60
  - !ruby/object:Gem::Version
54
61
  version: '0'
55
62
  type: :development
56
63
  prerelease: false
57
- version_requirements: *70231885659280
58
- description: An OmniAuth 1.0 strategy for Roomorama oauth2 identification.
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ! '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: Roomorama OmniAuth strategy.
59
70
  email:
60
- - dev@bookingsync.com
71
+ - donald@roomorama.com
61
72
  executables: []
62
73
  extensions: []
63
74
  extra_rdoc_files: []
@@ -68,37 +79,37 @@ files:
68
79
  - Gemfile
69
80
  - README.md
70
81
  - Rakefile
71
- - example/sinatra.rb
72
82
  - lib/omniauth-roomorama.rb
73
- - lib/omniauth-roomorama/version.rb
83
+ - lib/omniauth/roomorama.rb
84
+ - lib/omniauth/roomorama/version.rb
74
85
  - lib/omniauth/strategies/roomorama.rb
75
86
  - omniauth-roomorama.gemspec
76
87
  - spec/omniauth/strategies/roomorama_spec.rb
77
88
  - spec/spec_helper.rb
78
89
  - spec/support/shared_examples.rb
79
- homepage: https://github.com/BookingSync/omniauth-roomorama
80
- licenses: []
90
+ homepage: https://github.com/roomorama/omniauth-roomorama
91
+ licenses:
92
+ - MIT
93
+ metadata: {}
81
94
  post_install_message:
82
95
  rdoc_options: []
83
96
  require_paths:
84
97
  - lib
85
98
  required_ruby_version: !ruby/object:Gem::Requirement
86
- none: false
87
99
  requirements:
88
100
  - - ! '>='
89
101
  - !ruby/object:Gem::Version
90
102
  version: '0'
91
103
  required_rubygems_version: !ruby/object:Gem::Requirement
92
- none: false
93
104
  requirements:
94
105
  - - ! '>='
95
106
  - !ruby/object:Gem::Version
96
107
  version: '0'
97
108
  requirements: []
98
109
  rubyforge_project:
99
- rubygems_version: 1.8.17
110
+ rubygems_version: 2.0.3
100
111
  signing_key:
101
- specification_version: 3
112
+ specification_version: 4
102
113
  summary: An OmniAuth 1.0 strategy for Roomorama oauth2 identification.
103
114
  test_files:
104
115
  - spec/omniauth/strategies/roomorama_spec.rb
data/example/sinatra.rb DELETED
@@ -1,31 +0,0 @@
1
- require 'rubygems'
2
- require 'bundler'
3
-
4
- Bundler.setup :default, :development, :example
5
- require 'sinatra'
6
- require 'omniauth'
7
- require 'omniauth-roomorama'
8
-
9
- use Rack::Session::Cookie
10
-
11
- use OmniAuth::Builder do
12
- provider :roomorama, "xhphaTy1kl0Yjqan1ZgHGw", "E9PVZNSWbluCqqSjy9wH8tUb6ttTkaHy6wV38724o"
13
- end
14
-
15
- get '/' do
16
- <<-HTML
17
- <ul>
18
- <li><a href='/auth/roomorama'>Sign in with Roomorama</a></li>
19
- </ul>
20
- HTML
21
- end
22
-
23
- get '/auth/:provider/callback' do
24
- content_type 'text/plain'
25
- request.env['omniauth.auth'].to_hash.inspect
26
- end
27
-
28
- get '/auth/failure' do
29
- content_type 'text/plain'
30
- params[:message]
31
- end