omniauth-gitbook 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 72d24d6216474bc75afc23d1d8ebeadf3cf80be5
4
- data.tar.gz: 8d1b8cbd4639a87c229efdf44d630ad927b85d57
3
+ metadata.gz: 88f2efbb37098ea4476be249a3a7a98476223541
4
+ data.tar.gz: 45245ce8f54ac17456536dcf59e93f380fed3929
5
5
  SHA512:
6
- metadata.gz: b6ddd75587264a98ccaba4f0665682d7ce9ba8d6915ee67aa5acbe4a94d8d4f8d82749162f6543fc9ccf79131a6da7214e937d6e6c5aeb00fc14255f0c0c8cbb
7
- data.tar.gz: 411fa523e04d122fce167dd85b235a0257a600ce459c7ae2361fa15ddddfcd9592d342c8edbf03ccd7bb6ab52f3c020a9022700ae2f128494acfd2b8637ebc3f
6
+ metadata.gz: 0ee59f8e359e3f54ebe3bd84a31460c7f09ae71c01eabd133dec96cf42c8a06aea33a70c78d61a60f543de5b8895ae7e17eed47dae854889e51802ead206d9cf
7
+ data.tar.gz: 600edcb4abd56aa168b5c28597ee4b7547091c74d1330117bea6f6ad378cb69da94f7642533c7202cf62b33329544de8230ad2ba219d9442bad4f9bf19fc5880
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module GitBook
3
- VERSION = '0.0.2'
3
+ VERSION = '0.0.3'
4
4
  end
5
5
  end
@@ -0,0 +1,2 @@
1
+ require 'gitbook/version'
2
+ require 'omniauth/strategies/gitbook'
@@ -5,7 +5,6 @@ module OmniAuth
5
5
  class GitBook < OmniAuth::Strategies::OAuth2
6
6
  base_url = 'https://api.gitbook.com'
7
7
 
8
- option :name, 'GitBook'
9
8
  option :client_options, {
10
9
  site: base_url,
11
10
  authorize_url: "#{base_url}/oauth/authorize",
@@ -16,8 +15,12 @@ module OmniAuth
16
15
 
17
16
  info do
18
17
  {
18
+ 'username' => raw_info['username'],
19
19
  'name' => raw_info['name'],
20
- 'website' => raw_info['website']
20
+ 'website' => raw_info['website'],
21
+ 'urls' => raw_info['urls'],
22
+ 'auth' => raw_info['auth'],
23
+ 'token' => raw_info['token'],
21
24
  }
22
25
  end
23
26
 
@@ -27,7 +30,7 @@ module OmniAuth
27
30
 
28
31
  def raw_info
29
32
  access_token.options[:mode] = :query
30
- @raw_info ||= access_token
33
+ @raw_info ||= access_token.get('account').parsed
31
34
  end
32
35
 
33
36
  def authorize_params
@@ -2,7 +2,7 @@ require 'rspec'
2
2
  require 'rack/test'
3
3
  require 'webmock/rspec'
4
4
  require 'omniauth'
5
- require 'omni-gitbook'
5
+ require 'omniauth-gitbook'
6
6
 
7
7
  RSpec.configure do |config|
8
8
  config.include WebMock::API
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-gitbook
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Calvin Huang
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-02 00:00:00.000000000 Z
11
+ date: 2016-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth
@@ -115,7 +115,7 @@ files:
115
115
  - README.md
116
116
  - Rakefile
117
117
  - lib/gitbook/version.rb
118
- - lib/omni-gitbook.rb
118
+ - lib/omniauth-gitbook.rb
119
119
  - lib/omniauth/strategies/gitbook.rb
120
120
  - omniauth-gitbook.gemspec
121
121
  - spec/omniauth/strategies/gitbook_spec.rb
@@ -1,2 +0,0 @@
1
- require('omniauth/strategies/gitbook')
2
- require('gitbook/version')