omniauth-bluenumber 0.1.0 → 0.2.0

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: 1b8afa8be7a0923abb314124b4e2b91732b8e414
4
- data.tar.gz: e0652b85d68013d32eab46c09641dbb6c96b2b46
3
+ metadata.gz: 4b0617a53f1dc88d93baf4894b7f14bf252d5207
4
+ data.tar.gz: dc807aafacfd22b5313d4329cf426a6a91cf4684
5
5
  SHA512:
6
- metadata.gz: b1843e39d7dbb8c12e4ce382a4bea7b081f7d3d614bf0a93117c06ffece7a79e58e63bab5890b4b82352df824574df8522410de9d5716a2aef8b65c72594a09c
7
- data.tar.gz: 1fd1c79dbc8d1347f71f702882cf2927c1e0d794f2e2ccd7ab739de05acef2ac31c29d3588847df8aad43b3ffc27cd50bbf1a33df552919886b51aa63892f633
6
+ metadata.gz: add472d8e7ad5e3637c8deb9fbbb1fbaf8f7dfa88792ca7bdcb5ec1c6382a0d855bfacbf25cf14d3ccd05020737dd8e0b99dc0d62f24954dd96e46147352a2c8
7
+ data.tar.gz: 35679151279d976f73ee28a51d2e4c17e3354ac61bb7d74d2f48ddd726a7526976ad8d18c2670d1756419d3b5c155448f970d2bad37b1cf3a15e1499bce2e8ae
data/README.md CHANGED
@@ -1,8 +1,14 @@
1
1
  # Omniauth::Bluenumber
2
2
 
3
+ [![Code Climate](https://codeclimate.com/github/sachin87/omniauth-bluenumber/badges/gpa.svg)](https://codeclimate.com/github/sachin87/omniauth-bluenumber)
4
+
5
+ [![Test Coverage](https://codeclimate.com/github/sachin87/omniauth-bluenumber/badges/coverage.svg)](https://codeclimate.com/github/sachin87/omniauth-bluenumber/coverage)
6
+
7
+ [![Issue Count](https://codeclimate.com/github/sachin87/omniauth-bluenumber/badges/issue_count.svg)](https://codeclimate.com/github/sachin87/omniauth-bluenumber)
8
+
3
9
  Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/omniauth/bluenumber`. To experiment with that code, run `bin/console` for an interactive prompt.
4
10
 
5
- TODO: Delete this and the text above, and describe your gem
11
+ Omniauth Strategies for Bluenumber
6
12
 
7
13
  ## Installation
8
14
 
@@ -22,7 +28,7 @@ Or install it yourself as:
22
28
 
23
29
  ## Usage
24
30
 
25
- TODO: Write usage instructions here
31
+ # later
26
32
 
27
33
  ## Development
28
34
 
@@ -32,5 +38,5 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
32
38
 
33
39
  ## Contributing
34
40
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/omniauth-bluenumber.
41
+ Bug reports and pull requests are welcome on GitHub at https://github.com/Sachin87/omniauth-bluenumber.
36
42
 
@@ -1,5 +1,5 @@
1
1
  module Omniauth
2
2
  module Bluenumber
3
- VERSION = "0.1.0"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
@@ -1,7 +1,8 @@
1
1
  module OmniAuth
2
2
  module Strategies
3
3
  class Bluenumber < OmniAuth::Strategies::OAuth2
4
- option :email, :bluenumber
4
+
5
+ option :name, 'bluenumber'
5
6
 
6
7
  option :client_options, {
7
8
  site: "http://localhost:3000",
@@ -13,11 +14,34 @@ module OmniAuth
13
14
  end
14
15
 
15
16
  info do
16
- {name: raw_info["name"], email: 'sachin.y87@gmail.com'}
17
+ {email: email, bluenumber: bluenumber,
18
+ username: username, actor_id: actor_id}
17
19
  end
18
20
 
21
+ def localhost
22
+ "http://localhost:3000"
23
+ end
24
+
25
+ def email
26
+ raw_info['email']
27
+ end
28
+
29
+ def bluenumber
30
+ raw_info['bluenumber']
31
+ end
32
+
33
+ def username
34
+ raw_info['username']
35
+ end
36
+
37
+ def actor_id
38
+ raw_info['ActorID']
39
+ end
40
+
19
41
  def raw_info
20
- @raw_info ||= {}
42
+ @raw_info ||= access_token.get('/gpr/v2/users/user_info').parsed
43
+ rescue ::Errno::ETIMEDOUT
44
+ raise ::Timeout::Error
21
45
  end
22
46
  end
23
47
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-bluenumber
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sachin Singh