twitter-login 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/twitter/login.rb +11 -1
  2. metadata +4 -4
data/lib/twitter/login.rb CHANGED
@@ -104,7 +104,7 @@ class Twitter::Login
104
104
 
105
105
  # get and store authenticated user's info from Twitter
106
106
  response = access_token.get('/1/account/verify_credentials.json')
107
- request.session[:twitter_user] = Yajl::Parser.parse response.body
107
+ request.session[:twitter_user] = user_hash_from_response(response)
108
108
 
109
109
  redirect_to_return_path(request)
110
110
  end
@@ -142,4 +142,14 @@ class Twitter::Login
142
142
  OAuth::Consumer.new options[:consumer_key], options[:secret],
143
143
  :site => options[:site], :authorize_path => options[:authorize_path]
144
144
  end
145
+
146
+ def user_hash_from_response(api_response)
147
+ parse_response(api_response).reject { |key, _|
148
+ key == 'status' or key =~ /^profile_|_color$/
149
+ }
150
+ end
151
+
152
+ def parse_response(api_response)
153
+ Yajl::Parser.parse api_response.body
154
+ end
145
155
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twitter-login
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 13
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 0
10
- version: 0.4.0
9
+ - 1
10
+ version: 0.4.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - "Mislav Marohni\xC4\x87"
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-09-17 00:00:00 -07:00
18
+ date: 2010-10-27 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency