omniauth-wrapper 0.0.3 → 0.0.4

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: b23b2058d0061595ee9016408470f1e53a8d3995
4
- data.tar.gz: 0f28e7139d9ee3747c6490a5c50173f9665d4e88
3
+ metadata.gz: 402036c25be389888df435e7d042c6a3566a1d76
4
+ data.tar.gz: 2f1f707d6ad9caefa597f8351fb95ce5ab451bef
5
5
  SHA512:
6
- metadata.gz: b8b4579b97b2e9b4c2be8f80f5bc73e79ed55af5ad7532e3c838b5ee1c7cbd5e361d77daf9ea77adfd7d8d49ae32c52a7f11616242dd9722fb07f3eb1f5f7575
7
- data.tar.gz: 57f07ee438e997bf640a1c9379434f1c05653237ef9ececf163bf4c02c2ad119f4823b5a0a3a9e4e0e8cdcf4975c952757e21dc93287792b1298ffab2e1c5fc5
6
+ metadata.gz: 374161c1e3f548adc31d010d22d470b235f57330bac68340f2999506e0f88347038a5307e6d59d38e450b7a27f988399df397a424ee7c1088308ee30a5dd4798
7
+ data.tar.gz: 743b0512c3ed204e164743f934ab1b45d786b06579ba6b4d019b6bfa8d69a64a3e19a8946b92cfc3ed9aed978928dd7dbb13be586d0ec5be329e5227dff767fd
@@ -22,6 +22,14 @@ module Omniauth
22
22
  @credentials ||= (auth_hash['credentials'] || {})
23
23
  end
24
24
 
25
+ def extra
26
+ @extra ||= (auth_hash['extra'] || {})
27
+ end
28
+
29
+ def info
30
+ @extra ||= (auth_hash['info'] || {})
31
+ end
32
+
25
33
  def access_token
26
34
  @access_token ||= credentials['token']
27
35
  end
@@ -31,10 +39,10 @@ module Omniauth
31
39
  end
32
40
 
33
41
  protected
34
- def parse_datetime(value)
35
- return nil if value.nil? || value.to_i.zero?
36
- Time.at(value.to_i).to_datetime
37
- end
42
+ def parse_datetime(value)
43
+ return nil if value.nil? || value.to_i.zero?
44
+ Time.at(value.to_i).to_datetime
45
+ end
38
46
  end
39
47
  end
40
48
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Omniauth
4
4
  module Wrapper
5
- VERSION = "0.0.3"
5
+ VERSION = "0.0.4"
6
6
  end
7
7
  end
@@ -24,5 +24,25 @@ describe Omniauth::Wrapper::Provider::Facebook do
24
24
  its(:provider) { should eq "facebook" }
25
25
  its(:access_token) { should eq "AAAC1N4JHfIcBAIDYp0QLdyCMX9LenAS6KNDrGNZAOQ8bOYObHSg3tgxzvEVNLOTCZBOHDUCcHDxINgluKw52CLxMMZAxHaPXqAwZABMqhgZDZD" }
26
26
  its(:token_expires_at) { should eq Time.at("1369429974".to_i).to_datetime }
27
+
28
+ its 'info[:nickname] should be "foo.bar"' do
29
+ subject.info['nickname'].should eq 'foo.bar'
30
+ end
31
+
32
+ its 'info[:email] should be "email@gmail.com"' do
33
+ subject.info['email'].should eq 'email@gmail.com'
34
+ end
35
+
36
+ its 'info[:name] should be "Foo Bar"' do
37
+ subject.info['name'].should eq 'Foo Bar'
38
+ end
39
+
40
+ its 'info[:first_name] should be "Foo"' do
41
+ subject.info['first_name'].should eq 'Foo'
42
+ end
43
+
44
+ its 'info[:last_name] should be "Bar"' do
45
+ subject.info['last_name'].should eq 'Bar'
46
+ end
27
47
  end
28
48
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-wrapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zolzaya E.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-07 00:00:00.000000000 Z
11
+ date: 2013-10-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler