warden-github-rails 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 94c4bcff3c0978874ae4233194457aa095b6ec98
4
- data.tar.gz: 952a958502aef15b84ca89c4912d7577ea4ab0f4
3
+ metadata.gz: e4b21d7a28bf42f74da5eafddadfad17630e05a0
4
+ data.tar.gz: aa412e1be503469bc2771ee0cb51a820445f0268
5
5
  SHA512:
6
- metadata.gz: df68ab5d8e005762758a1c42ebf734a5dd477dc3b9e553658bdad6518af55b9d5ec924b9b205a924ec0f5e95b5f236bddbb2d8e4473a7db2623531a20fa58e02
7
- data.tar.gz: a5ca3a4d19fb32f664b3ae819df6243a557f252b01b59382965507b49cb99d88be888b1c9cdf0eb8d931205a541f480c2b337441f8ba7303d16c4639eafc4c2e
6
+ metadata.gz: 5e5c27ca1244250f732b1ea0ce6065006d0c46134d7bb451aa96e76e7d3014b23e1d707886d8602539774865b402165631671c5adccefe78d9a006d7f2048621
7
+ data.tar.gz: 2d8abd4c0e093228ca14cd82fb29b7914ceb8670d6950cdf3f9d8ccf6f9e391dc069d18c23e7658e5aafdc4dc4ddcb2980db17d4ae48d23b2da85a29499f2462
data/.coveralls.yml ADDED
@@ -0,0 +1 @@
1
+ service_name: travis-ci
data/.travis.yml CHANGED
@@ -1,12 +1,13 @@
1
1
  language: ruby
2
+ cache: bundler
2
3
  script: "bundle exec rspec"
3
4
  rvm:
4
- - 1.9.2
5
- - 1.9.3
5
+ - 2.1.0
6
6
  - 2.0.0
7
+ - 1.9.3
7
8
  - ruby-head
8
- - jruby-19mode # JRuby in 1.9 mode
9
- - rbx-19mode
9
+ - jruby-19mode
10
+ - rbx-2.1.1
10
11
  env:
11
12
  - "RAILS_VERSION=3.1.0"
12
13
  - "RAILS_VERSION=3.2.0"
@@ -16,8 +17,3 @@ matrix:
16
17
  allow_failures:
17
18
  - env: "RAILS_VERSION=master"
18
19
  - rvm: ruby-head
19
- exclude:
20
- - rvm: 1.9.2
21
- env: "RAILS_VERSION=master"
22
- - rvm: 1.9.2
23
- env: "RAILS_VERSION=4.0.0"
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## v1.1.1
4
+
5
+ - Transform string to integer when stubbing team membership
6
+ - Place redirect helper in correct rack module
7
+
3
8
  ## v1.1.0
4
9
 
5
10
  - Upgrade to octokit.rb version 2
data/Gemfile CHANGED
@@ -25,3 +25,8 @@ group :development do
25
25
  gem 'ruby-debug', platforms: :ruby_18, require: false
26
26
  end
27
27
  end
28
+
29
+ platforms :rbx do
30
+ gem 'rubysl'
31
+ gem 'racc'
32
+ end
data/README.md CHANGED
@@ -1,9 +1,11 @@
1
1
  # warden-github-rails
2
2
 
3
- [![Build Status](https://travis-ci.org/fphilipe/warden-github-rails.png)](https://travis-ci.org/fphilipe/warden-github-rails)
4
- [![Gem Version](https://badge.fury.io/rb/warden-github-rails.png)](http://badge.fury.io/rb/warden-github-rails)
5
- [![Dependency Status](https://gemnasium.com/fphilipe/warden-github-rails.png)](https://gemnasium.com/fphilipe/warden-github-rails)
6
- [![Code Climate](https://codeclimate.com/github/fphilipe/warden-github-rails.png)](https://codeclimate.com/github/fphilipe/warden-github-rails)
3
+ [![Build Status][build-image]][build-link]
4
+ [![Gem Version][gem-image]][gem-link]
5
+ [![Dependency Status][deps-image]][deps-link]
6
+ [![Code Climate][gpa-image]][gpa-link]
7
+ [![Coverage Status][cov-image]][cov-link]
8
+ [![Bitdeli Badge][stats-image]][stats-link]
7
9
 
8
10
  A gem for rails that provides easy GitHub OAuth integration.
9
11
  It is built on top of [warden-github](https://github.com/atmos/warden-github), which gives you an easy to use [warden](https://github.com/hassox/warden) strategy to authenticate GitHub users.
@@ -108,12 +110,12 @@ Here's how such a config might look like:
108
110
  Warden::GitHub::Rails.setup do |config|
109
111
  config.add_scope :user, client_id: 'foo',
110
112
  client_secret: 'bar',
111
- scope: 'user'
113
+ scope: 'user:email'
112
114
 
113
115
  config.add_scope :admin, client_id: 'abc',
114
116
  client_secret: 'xyz',
115
117
  redirect_uri: '/admin/login/callback',
116
- scope: 'repo'
118
+ scope: 'read:org'
117
119
 
118
120
  config.default_scope = :admin
119
121
 
@@ -262,10 +264,29 @@ This functionality is used in this gem in order to setup the github strategy for
262
264
  - [warden](https://github.com/hassox/warden)
263
265
  - [octokit](https://github.com/octokit/octokit.rb)
264
266
 
265
- ### Maintainers
267
+ ### Author
266
268
 
267
- - Philipe Fatio ([@fphilipe](https://github.com/fphilipe))
269
+ Philipe Fatio ([@fphilipe][fphilipe twitter])
270
+
271
+ [![Support via Gittip][tip-image]][tip-link]
268
272
 
269
273
  ### License
270
274
 
271
275
  MIT License. Copyright 2013 Philipe Fatio
276
+
277
+ [build-image]: https://travis-ci.org/fphilipe/warden-github-rails.png
278
+ [build-link]: https://travis-ci.org/fphilipe/warden-github-rails
279
+ [gem-image]: https://badge.fury.io/rb/warden-github-rails.png
280
+ [gem-link]: https://rubygems.org/gems/warden-github-rails
281
+ [deps-image]: https://gemnasium.com/fphilipe/warden-github-rails.png
282
+ [deps-link]: https://gemnasium.com/fphilipe/warden-github-rails
283
+ [gpa-image]: https://codeclimate.com/github/fphilipe/warden-github-rails.png
284
+ [gpa-link]: https://codeclimate.com/github/fphilipe/warden-github-rails
285
+ [cov-image]: https://coveralls.io/repos/fphilipe/warden-github-rails/badge.png
286
+ [cov-link]: https://coveralls.io/r/fphilipe/warden-github-rails
287
+ [stats-image]: https://d2weczhvl823v0.cloudfront.net/fphilipe/warden-github-rails/trend.png
288
+ [stats-link]: https://bitdeli.com/
289
+ [tip-image]: https://rawgithub.com/twolfson/gittip-badge/0.1.0/dist/gittip.png
290
+ [tip-link]: https://www.gittip.com/fphilipe/
291
+
292
+ [fphilipe twitter]: https://twitter.com/fphilipe
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.0
1
+ 1.1.1
@@ -18,11 +18,10 @@ module Warden
18
18
  end
19
19
  end
20
20
 
21
- # Add a method to Rack::Response to easily determine if a request resulted in an
22
- # OAuth redirect to GitHub.
23
- class Rack::Response
21
+ # Add a method to Rack::Response::Helpers to easily determine if a request
22
+ # resulted in an OAuth redirect to GitHub.
23
+ module Rack::Response::Helpers
24
24
  def github_oauth_redirect?
25
- redirect? and
26
- location.start_with?('https://github.com/login/oauth/authorize')
25
+ redirect? && %r{https?://[^/]+/login/oauth/authorize\b} =~ location
27
26
  end
28
27
  end
@@ -12,7 +12,9 @@ module Warden
12
12
 
13
13
  def stub_membership(args)
14
14
  args.each do |type, values|
15
- memberships.fetch(type).concat(Array(values))
15
+ values = Array(values)
16
+ values.map!(&:to_i) if type == :team
17
+ memberships.fetch(type).concat(values)
16
18
  end
17
19
  end
18
20
 
data/spec/spec_helper.rb CHANGED
@@ -1,8 +1,14 @@
1
- unless ENV['CI']
2
- require 'simplecov'
3
- SimpleCov.start do
4
- add_filter '/spec'
5
- add_filter '/example'
1
+ if RUBY_ENGINE == 'ruby'
2
+ if ENV['CI']
3
+ require 'coveralls'
4
+ Coveralls::Output.silent = true
5
+ Coveralls.wear! do
6
+ add_filter 'spec/'
7
+ add_filter 'example/'
8
+ end
9
+ else
10
+ require 'simplecov'
11
+ SimpleCov.start
6
12
  end
7
13
  end
8
14
 
@@ -11,7 +11,7 @@ describe Warden::GitHub::Rails::TestHelpers::MockUser do
11
11
  expect(user).not_to be_team_member(456)
12
12
  expect(user).not_to be_organization_member('foobar')
13
13
 
14
- user.stub_membership(org: 'foobar', team: [123, 456])
14
+ user.stub_membership(org: 'foobar', team: [123, '456'])
15
15
 
16
16
  expect(user).to be_team_member(123)
17
17
  expect(user).to be_team_member(456)
@@ -15,10 +15,10 @@ Gem::Specification.new do |gem|
15
15
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
16
16
 
17
17
  gem.add_development_dependency 'rspec', '~> 2.14'
18
- gem.add_development_dependency 'simplecov'
19
18
  gem.add_development_dependency 'rails', '>= 3.2'
20
19
  gem.add_development_dependency 'rack-test', '~> 0.6'
21
20
  gem.add_development_dependency 'addressable', '~> 2.3'
21
+ gem.add_development_dependency 'coveralls' if RUBY_ENGINE == 'ruby'
22
22
 
23
23
  gem.add_dependency 'warden-github', '~> 1.0'
24
24
  gem.add_dependency 'railties', '>= 3.1'
metadata CHANGED
@@ -1,111 +1,111 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: warden-github-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Philipe Fatio
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-17 00:00:00.000000000 Z
11
+ date: 2014-09-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '2.14'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '2.14'
27
- - !ruby/object:Gem::Dependency
28
- name: simplecov
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - '>='
32
- - !ruby/object:Gem::Version
33
- version: '0'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - '>='
39
- - !ruby/object:Gem::Version
40
- version: '0'
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: rails
43
29
  requirement: !ruby/object:Gem::Requirement
44
30
  requirements:
45
- - - '>='
31
+ - - ">="
46
32
  - !ruby/object:Gem::Version
47
33
  version: '3.2'
48
34
  type: :development
49
35
  prerelease: false
50
36
  version_requirements: !ruby/object:Gem::Requirement
51
37
  requirements:
52
- - - '>='
38
+ - - ">="
53
39
  - !ruby/object:Gem::Version
54
40
  version: '3.2'
55
41
  - !ruby/object:Gem::Dependency
56
42
  name: rack-test
57
43
  requirement: !ruby/object:Gem::Requirement
58
44
  requirements:
59
- - - ~>
45
+ - - "~>"
60
46
  - !ruby/object:Gem::Version
61
47
  version: '0.6'
62
48
  type: :development
63
49
  prerelease: false
64
50
  version_requirements: !ruby/object:Gem::Requirement
65
51
  requirements:
66
- - - ~>
52
+ - - "~>"
67
53
  - !ruby/object:Gem::Version
68
54
  version: '0.6'
69
55
  - !ruby/object:Gem::Dependency
70
56
  name: addressable
71
57
  requirement: !ruby/object:Gem::Requirement
72
58
  requirements:
73
- - - ~>
59
+ - - "~>"
74
60
  - !ruby/object:Gem::Version
75
61
  version: '2.3'
76
62
  type: :development
77
63
  prerelease: false
78
64
  version_requirements: !ruby/object:Gem::Requirement
79
65
  requirements:
80
- - - ~>
66
+ - - "~>"
81
67
  - !ruby/object:Gem::Version
82
68
  version: '2.3'
69
+ - !ruby/object:Gem::Dependency
70
+ name: coveralls
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: warden-github
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ~>
87
+ - - "~>"
88
88
  - !ruby/object:Gem::Version
89
89
  version: '1.0'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ~>
94
+ - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: '1.0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: railties
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - '>='
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
103
  version: '3.1'
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - '>='
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '3.1'
111
111
  description: An easy drop in solution for rails to use GitHub authentication.
@@ -115,9 +115,10 @@ executables: []
115
115
  extensions: []
116
116
  extra_rdoc_files: []
117
117
  files:
118
- - .gitignore
119
- - .rspec
120
- - .travis.yml
118
+ - ".coveralls.yml"
119
+ - ".gitignore"
120
+ - ".rspec"
121
+ - ".travis.yml"
121
122
  - CHANGELOG.md
122
123
  - Gemfile
123
124
  - LICENSE.txt
@@ -170,17 +171,17 @@ require_paths:
170
171
  - lib
171
172
  required_ruby_version: !ruby/object:Gem::Requirement
172
173
  requirements:
173
- - - '>='
174
+ - - ">="
174
175
  - !ruby/object:Gem::Version
175
176
  version: '0'
176
177
  required_rubygems_version: !ruby/object:Gem::Requirement
177
178
  requirements:
178
- - - '>='
179
+ - - ">="
179
180
  - !ruby/object:Gem::Version
180
181
  version: '0'
181
182
  requirements: []
182
183
  rubyforge_project:
183
- rubygems_version: 2.0.2
184
+ rubygems_version: 2.2.2
184
185
  signing_key:
185
186
  specification_version: 4
186
187
  summary: An easy drop in solution for rails to use GitHub authentication.