omniauth-tradegecko 0.0.2 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Omniauth::TradeGecko
1
+ # Omniauth::TradeGecko [![Build Status](https://travis-ci.org/tradegecko/omniauth-tradegecko.png)](https://travis-ci.org/tradegecko/omniauth-tradegecko)
2
2
 
3
3
  This is the TradeGecko strategy for authenticating to TradeGecko via OmniAuth.
4
4
  For more information about the TradeGecko API check out [http://tradegecko.com/apps/api](http://tradegecko.com/apps/api)
@@ -13,4 +13,4 @@ In `config/initializers/tradegecko.rb`
13
13
  ```
14
14
 
15
15
  ## Questions
16
- Contact me at [bradleypriest@gmail.com](mailto:bradleypriest@gmail.com) or [@bradleypriest](http://twitter.com/bradleypriest)
16
+ Contact me at [bradley@tradegecko.com](mailto:bradley@tradegecko.com) or [@bradleypriest](http://twitter.com/bradleypriest)
@@ -14,17 +14,28 @@ module OmniAuth
14
14
 
15
15
  info do
16
16
  {
17
+ email: raw_info["email"],
17
18
  first_name: raw_info["first_name"],
18
19
  last_name: raw_info["last_name"],
19
- email: raw_info["email"]
20
+ name: full_name
21
+ }
22
+ end
23
+
24
+ extra do
25
+ {
26
+ raw_info: raw_info
20
27
  }
21
28
  end
22
29
 
23
30
  def raw_info
24
31
  @raw_info ||= access_token.get('/users/current').parsed["user"]
25
32
  end
33
+
34
+ def full_name
35
+ [raw_info["first_name"], raw_info["last_name"]].compact.join(" ")
36
+ end
26
37
  end
27
38
  end
28
39
  end
29
40
 
30
- OmniAuth.config.add_camelization 'tradegecko', 'TradeGecko'
41
+ OmniAuth.config.add_camelization 'tradegecko', 'TradeGecko'
@@ -1,5 +1,5 @@
1
1
  module Omniauth
2
2
  module TradeGecko
3
- VERSION = "0.0.2"
3
+ VERSION = "0.1.0"
4
4
  end
5
5
  end
@@ -20,4 +20,5 @@ Gem::Specification.new do |gem|
20
20
  gem.add_development_dependency 'rack-test'
21
21
  gem.add_development_dependency 'simplecov'
22
22
  gem.add_development_dependency 'webmock'
23
+ gem.add_development_dependency 'rake'
23
24
  end
@@ -20,6 +20,7 @@ describe OmniAuth::Strategies::TradeGecko do
20
20
  strategy.stub(:raw_info) do
21
21
  {
22
22
  "first_name" => "Invader",
23
+ "account_id" => 1,
23
24
  "last_name" => "Zim",
24
25
  "email" => "invaderzim@example.com"
25
26
  }
@@ -29,7 +30,8 @@ describe OmniAuth::Strategies::TradeGecko do
29
30
  strategy.info.should eql({
30
31
  first_name: "Invader",
31
32
  last_name: "Zim",
32
- email: "invaderzim@example.com"
33
+ email: "invaderzim@example.com",
34
+ name: "Invader Zim"
33
35
  })
34
36
  end
35
37
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-tradegecko
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-12 00:00:00.000000000 Z
12
+ date: 2013-05-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: omniauth
@@ -107,6 +107,22 @@ dependencies:
107
107
  - - ! '>='
108
108
  - !ruby/object:Gem::Version
109
109
  version: '0'
110
+ - !ruby/object:Gem::Dependency
111
+ name: rake
112
+ requirement: !ruby/object:Gem::Requirement
113
+ none: false
114
+ requirements:
115
+ - - ! '>='
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ! '>='
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
110
126
  description: Omniauth strategy for TradeGecko
111
127
  email:
112
128
  - bradley@tradegecko.com