readability-engine 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
@@ -8,20 +8,26 @@ class Readability::SessionController < ApplicationController
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def new
|
11
|
+
session[:readability] ||= {}
|
12
|
+
|
11
13
|
request_token = consumer.get_request_token(:oauth_callback => callback_url)
|
12
|
-
session[:request_token] = request_token
|
14
|
+
session[:readability][:request_token] = request_token
|
13
15
|
redirect_to request_token.authorize_url(:oauth_callback => callback_url)
|
14
16
|
end
|
15
17
|
|
18
|
+
def destroy
|
19
|
+
dereadabilify
|
20
|
+
end
|
21
|
+
|
16
22
|
private
|
17
23
|
def access_token
|
18
24
|
verifier = params[:oauth_verifier]
|
19
25
|
|
20
|
-
return nil unless session[:request_token] && verifier
|
21
|
-
access_token = session[:request_token].get_access_token(:oauth_verifier => verifier)
|
26
|
+
return nil unless session[:readability][:request_token] && verifier
|
27
|
+
access_token = session[:readability][:request_token].get_access_token(:oauth_verifier => verifier)
|
22
28
|
|
23
|
-
session[:readability_access] = access_token
|
24
|
-
session[:request_token] = nil
|
29
|
+
session[:readability][:readability_access] = access_token
|
30
|
+
session[:readability][:request_token] = nil
|
25
31
|
|
26
32
|
access_token
|
27
33
|
end
|
data/lib/readability/client.rb
CHANGED
@@ -6,13 +6,17 @@ module Readability
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def readability_access
|
9
|
-
session[:readability_access]
|
9
|
+
session[:readability][:readability_access]
|
10
10
|
end
|
11
11
|
|
12
12
|
def readability(resource, args = {})
|
13
13
|
readability_client.get(resource, args)
|
14
14
|
end
|
15
15
|
|
16
|
+
def dereadabilify
|
17
|
+
session[:readability] = nil
|
18
|
+
end
|
19
|
+
|
16
20
|
def readability_client
|
17
21
|
@client ||= Readability::Client.new(readability_access)
|
18
22
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: readability-engine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Luke van der Hoeven
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-04-
|
13
|
+
date: 2011-04-21 00:00:00 -04:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -73,7 +73,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
73
73
|
requirements:
|
74
74
|
- - ">="
|
75
75
|
- !ruby/object:Gem::Version
|
76
|
-
hash:
|
76
|
+
hash: -1556751525386014438
|
77
77
|
segments:
|
78
78
|
- 0
|
79
79
|
version: "0"
|