hellhound-twitter 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile
CHANGED
@@ -8,7 +8,7 @@ begin
|
|
8
8
|
s.summary = 'A auth system that relay in twitter oauth'
|
9
9
|
s.email = 'pedro.delgallego@gmail.com'
|
10
10
|
s.homepage = 'http://github.com/pedrodelgallego/hellhound-twitter'
|
11
|
-
s.version = '0.0.
|
11
|
+
s.version = '0.0.4'
|
12
12
|
s.authors = ["Pedro Del Gallego"]
|
13
13
|
s.files = FileList['[A-Z]*', '{lib,spec,bin,examples}/**/*']
|
14
14
|
|
@@ -2,15 +2,15 @@
|
|
2
2
|
json haml dm-core memcached
|
3
3
|
).each {|gem| require gem}
|
4
4
|
|
5
|
-
require File.expand_path(File.join(File.dirname(__FILE__), "../lib/hellhound
|
5
|
+
require File.expand_path(File.join(File.dirname(__FILE__), "../lib/sinatra/hellhound.rb"))
|
6
6
|
|
7
7
|
configure do
|
8
|
-
|
9
|
-
|
8
|
+
|
9
|
+
use Rack::OAuth, :key => '97DyOmKn7gn1ki0wlyoGA',
|
10
|
+
:secret => 'bBYIkLEEsdbLFEflWOV2fqaCieiBmYwzV4gXdvwwk',
|
10
11
|
:site => 'http://twitter.com'
|
11
12
|
|
12
|
-
#
|
13
|
-
# Sinatra::Hellhound::CACHE = Memcached.new
|
13
|
+
#enable :hellhound_cache
|
14
14
|
|
15
15
|
end
|
16
16
|
|
@@ -18,7 +18,7 @@ module Sinatra
|
|
18
18
|
#
|
19
19
|
def current_user
|
20
20
|
if session[:user]
|
21
|
-
|
21
|
+
options.hellhound_cache ? Sinatra::Hellhound::CACHE.get("user-#{session[:user]}") : get_user(session[:user])
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
@@ -28,7 +28,6 @@ module Sinatra
|
|
28
28
|
def logged_in?
|
29
29
|
!! session[:user]
|
30
30
|
end
|
31
|
-
|
32
31
|
|
33
32
|
##
|
34
33
|
# Returns the user that logged out and remove user from the
|
@@ -60,7 +59,7 @@ module Sinatra
|
|
60
59
|
session[:user] = user_data["id"].to_s
|
61
60
|
user = yield user_data
|
62
61
|
|
63
|
-
Sinatra::Hellhound::CACHE.set "user-#{session[:user]}", user if
|
62
|
+
Sinatra::Hellhound::CACHE.set "user-#{session[:user]}", user if options.hellhound_cache
|
64
63
|
end
|
65
64
|
|
66
65
|
##
|
@@ -71,10 +70,12 @@ module Sinatra
|
|
71
70
|
end
|
72
71
|
end
|
73
72
|
|
74
|
-
Sinatra::Hellhound::CACHE =
|
73
|
+
Sinatra::Hellhound::CACHE = Memcached.new
|
75
74
|
|
76
75
|
def self.registered(app)
|
77
76
|
app.enable :sessions
|
77
|
+
app.disable :hellhound_cache
|
78
|
+
|
78
79
|
end
|
79
80
|
end # Module Hellhound
|
80
81
|
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 4
|
9
|
+
version: 0.0.4
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Pedro Del Gallego
|
@@ -66,7 +66,7 @@ files:
|
|
66
66
|
- README
|
67
67
|
- Rakefile
|
68
68
|
- examples/simple-login-twitter.rb
|
69
|
-
- lib/hellhound
|
69
|
+
- lib/sinatra/hellhound.rb
|
70
70
|
has_rdoc: true
|
71
71
|
homepage: http://github.com/pedrodelgallego/hellhound-twitter
|
72
72
|
licenses: []
|