authpwn_rails 0.9.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/authpwn_rails.gemspec +3 -2
- data/lib/authpwn_rails.rb +1 -0
- data/lib/authpwn_rails/session.rb +0 -14
- data/lib/authpwn_rails/test_extensions.rb +24 -0
- metadata +5 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.9.
|
1
|
+
0.9.1
|
data/authpwn_rails.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{authpwn_rails}
|
8
|
-
s.version = "0.9.
|
8
|
+
s.version = "0.9.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = [%q{Victor Costan}]
|
12
|
-
s.date = %q{2011-07-
|
12
|
+
s.date = %q{2011-07-21}
|
13
13
|
s.description = %q{Works with Facebook.}
|
14
14
|
s.email = %q{victor@costan.us}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -48,6 +48,7 @@ Gem::Specification.new do |s|
|
|
48
48
|
"lib/authpwn_rails/generators/users_generator.rb",
|
49
49
|
"lib/authpwn_rails/session.rb",
|
50
50
|
"lib/authpwn_rails/session_controller.rb",
|
51
|
+
"lib/authpwn_rails/test_extensions.rb",
|
51
52
|
"lib/authpwn_rails/user_model.rb",
|
52
53
|
"test/cookie_controller_test.rb",
|
53
54
|
"test/facebook_controller_test.rb",
|
data/lib/authpwn_rails.rb
CHANGED
@@ -6,6 +6,7 @@ require 'authpwn_rails/facebook_session.rb'
|
|
6
6
|
require 'authpwn_rails/facebook_token_model.rb'
|
7
7
|
require 'authpwn_rails/session.rb'
|
8
8
|
require 'authpwn_rails/session_controller.rb'
|
9
|
+
require 'authpwn_rails/test_extensions.rb'
|
9
10
|
require 'authpwn_rails/user_model.rb'
|
10
11
|
|
11
12
|
if defined?(Rails)
|
@@ -66,17 +66,3 @@ module ControllerInstanceMethods
|
|
66
66
|
end # module AuthpwnRails::ControllerInstanceMethods
|
67
67
|
|
68
68
|
end # namespace AuthpwnRails
|
69
|
-
|
70
|
-
# :nodoc: add session modification
|
71
|
-
class ActionController::TestCase
|
72
|
-
# Sets the authenticated user in the test session.
|
73
|
-
def set_session_current_user(user)
|
74
|
-
request.session[:current_user_pid] = user ? user.to_param : nil
|
75
|
-
end
|
76
|
-
|
77
|
-
# The authenticated user in the test session.
|
78
|
-
def session_current_user
|
79
|
-
return nil unless user_param = request.session[:current_user_pid]
|
80
|
-
User.find_by_param user_param
|
81
|
-
end
|
82
|
-
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# :nodoc: namespace
|
2
|
+
module AuthpwnRails
|
3
|
+
|
4
|
+
# Included in test cases.
|
5
|
+
module TestExtensions
|
6
|
+
# Sets the authenticated user in the test session.
|
7
|
+
def set_session_current_user(user)
|
8
|
+
request.session[:current_user_pid] = user ? user.to_param : nil
|
9
|
+
end
|
10
|
+
|
11
|
+
# The authenticated user in the test session.
|
12
|
+
def session_current_user
|
13
|
+
return nil unless user_param = request.session[:current_user_pid]
|
14
|
+
User.find_by_param user_param
|
15
|
+
end
|
16
|
+
end # module AuthpwnRails::TestExtensions
|
17
|
+
|
18
|
+
end # namespace AuthpwnRails
|
19
|
+
|
20
|
+
|
21
|
+
# :nodoc: extend Test::Unit
|
22
|
+
class ActionController::TestCase
|
23
|
+
include AuthpwnRails::TestExtensions
|
24
|
+
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: authpwn_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 57
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 9
|
9
|
-
-
|
10
|
-
version: 0.9.
|
9
|
+
- 1
|
10
|
+
version: 0.9.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Victor Costan
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-07-
|
18
|
+
date: 2011-07-21 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
version_requirements: &id001 !ruby/object:Gem::Requirement
|
@@ -154,6 +154,7 @@ files:
|
|
154
154
|
- lib/authpwn_rails/generators/users_generator.rb
|
155
155
|
- lib/authpwn_rails/session.rb
|
156
156
|
- lib/authpwn_rails/session_controller.rb
|
157
|
+
- lib/authpwn_rails/test_extensions.rb
|
157
158
|
- lib/authpwn_rails/user_model.rb
|
158
159
|
- test/cookie_controller_test.rb
|
159
160
|
- test/facebook_controller_test.rb
|