authpwn_rails 0.5.1 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/authpwn_rails.gemspec +50 -52
- data/lib/authpwn_rails/facebook_extensions.rb +2 -2
- data/lib/authpwn_rails/user_model.rb +3 -0
- data/test/user_test.rb +13 -0
- metadata +12 -13
- data/.gitignore +0 -24
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.2
|
data/authpwn_rails.gemspec
CHANGED
@@ -5,75 +5,73 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{authpwn_rails}
|
8
|
-
s.version = "0.5.
|
8
|
+
s.version = "0.5.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Victor Costan"]
|
12
|
-
s.date = %q{2010-10-
|
12
|
+
s.date = %q{2010-10-15}
|
13
13
|
s.description = %q{Works with Facebook.}
|
14
14
|
s.email = %q{victor@costan.us}
|
15
15
|
s.extra_rdoc_files = [
|
16
16
|
"LICENSE",
|
17
|
-
|
17
|
+
"README.rdoc"
|
18
18
|
]
|
19
19
|
s.files = [
|
20
20
|
".document",
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
"test/user_test.rb"
|
21
|
+
".project",
|
22
|
+
"LICENSE",
|
23
|
+
"README.rdoc",
|
24
|
+
"Rakefile",
|
25
|
+
"VERSION",
|
26
|
+
"app/helpers/session_helper.rb",
|
27
|
+
"authpwn_rails.gemspec",
|
28
|
+
"lib/authpwn_rails.rb",
|
29
|
+
"lib/authpwn_rails/engine.rb",
|
30
|
+
"lib/authpwn_rails/facebook_extensions.rb",
|
31
|
+
"lib/authpwn_rails/generators/facebook_generator.rb",
|
32
|
+
"lib/authpwn_rails/generators/session_generator.rb",
|
33
|
+
"lib/authpwn_rails/generators/templates/001_create_users.rb",
|
34
|
+
"lib/authpwn_rails/generators/templates/002_create_facebook_tokens.rb",
|
35
|
+
"lib/authpwn_rails/generators/templates/facebook_token.rb",
|
36
|
+
"lib/authpwn_rails/generators/templates/facebook_tokens.yml",
|
37
|
+
"lib/authpwn_rails/generators/templates/session/home.html.erb",
|
38
|
+
"lib/authpwn_rails/generators/templates/session/new.html.erb",
|
39
|
+
"lib/authpwn_rails/generators/templates/session/welcome.html.erb",
|
40
|
+
"lib/authpwn_rails/generators/templates/session_controller.rb",
|
41
|
+
"lib/authpwn_rails/generators/templates/session_controller_test.rb",
|
42
|
+
"lib/authpwn_rails/generators/templates/user.rb",
|
43
|
+
"lib/authpwn_rails/generators/templates/users.yml",
|
44
|
+
"lib/authpwn_rails/generators/user_generator.rb",
|
45
|
+
"lib/authpwn_rails/session.rb",
|
46
|
+
"lib/authpwn_rails/user_model.rb",
|
47
|
+
"test/cookie_controller_test.rb",
|
48
|
+
"test/facebook_controller_test.rb",
|
49
|
+
"test/facebook_token_test.rb",
|
50
|
+
"test/helpers/application_controller.rb",
|
51
|
+
"test/helpers/db_setup.rb",
|
52
|
+
"test/helpers/fbgraph.rb",
|
53
|
+
"test/helpers/routes.rb",
|
54
|
+
"test/helpers/view_helpers.rb",
|
55
|
+
"test/session_controller_api_test.rb",
|
56
|
+
"test/test_helper.rb",
|
57
|
+
"test/user_test.rb"
|
59
58
|
]
|
60
59
|
s.homepage = %q{http://github.com/pwnall/authpwn_rails}
|
61
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
62
60
|
s.require_paths = ["lib"]
|
63
61
|
s.rubygems_version = %q{1.3.7}
|
64
62
|
s.summary = %q{User authentication for Rails 3 applications.}
|
65
63
|
s.test_files = [
|
64
|
+
"test/cookie_controller_test.rb",
|
65
|
+
"test/facebook_controller_test.rb",
|
66
66
|
"test/facebook_token_test.rb",
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
"test/helpers/db_setup.rb",
|
76
|
-
"test/helpers/view_helpers.rb"
|
67
|
+
"test/helpers/application_controller.rb",
|
68
|
+
"test/helpers/db_setup.rb",
|
69
|
+
"test/helpers/fbgraph.rb",
|
70
|
+
"test/helpers/routes.rb",
|
71
|
+
"test/helpers/view_helpers.rb",
|
72
|
+
"test/session_controller_api_test.rb",
|
73
|
+
"test/test_helper.rb",
|
74
|
+
"test/user_test.rb"
|
77
75
|
]
|
78
76
|
|
79
77
|
if s.respond_to? :specification_version then
|
@@ -11,7 +11,7 @@ module FacebookExtensions
|
|
11
11
|
# Mixed into ActiveController::Base
|
12
12
|
module ControllerMixin
|
13
13
|
def self.included(base)
|
14
|
-
base.send :extend, ControllerClassMethods
|
14
|
+
base.send :extend, ControllerClassMethods
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
@@ -60,7 +60,7 @@ module ModelClassMethods
|
|
60
60
|
# Extends the model with all that it needs to be PwnAuth's user model.
|
61
61
|
def pwnauth_facebook_token_model
|
62
62
|
# The user whose token this is.
|
63
|
-
belongs_to :user
|
63
|
+
belongs_to :user, :inverse_of => :facebook_token
|
64
64
|
validates :user, :presence => true
|
65
65
|
|
66
66
|
# A unique ID on the Facebook site for the user owning this token.
|
@@ -36,6 +36,9 @@ module ModelClassMethods
|
|
36
36
|
# Virtual attribute: confirmation for the user's password.
|
37
37
|
attr_accessor :password_confirmation
|
38
38
|
validates_confirmation_of :password
|
39
|
+
|
40
|
+
# Facebook token.
|
41
|
+
has_one :facebook_token, :dependent => :destroy, :inverse_of => :user
|
39
42
|
|
40
43
|
extend ModelMetaclassMethods
|
41
44
|
include ModelInstanceMethods
|
data/test/user_test.rb
CHANGED
@@ -96,4 +96,17 @@ class UserTest < ActiveSupport::TestCase
|
|
96
96
|
User.find_by_email_and_password('john@gmail.com', 'awesome'),
|
97
97
|
'Bogus password'
|
98
98
|
end
|
99
|
+
|
100
|
+
test 'facebook_token' do
|
101
|
+
assert_nil @user.facebook_token
|
102
|
+
|
103
|
+
user = users(:john)
|
104
|
+
assert_equal facebook_tokens(:john), user.facebook_token
|
105
|
+
end
|
106
|
+
|
107
|
+
|
108
|
+
test 'for_facebook_token' do
|
109
|
+
assert_equal users(:john),
|
110
|
+
User.for_facebook_token(users(:john). facebook_token.access_token)
|
111
|
+
end
|
99
112
|
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: 15
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 5
|
9
|
-
-
|
10
|
-
version: 0.5.
|
9
|
+
- 2
|
10
|
+
version: 0.5.2
|
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: 2010-10-
|
18
|
+
date: 2010-10-15 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -77,7 +77,6 @@ extra_rdoc_files:
|
|
77
77
|
- README.rdoc
|
78
78
|
files:
|
79
79
|
- .document
|
80
|
-
- .gitignore
|
81
80
|
- .project
|
82
81
|
- LICENSE
|
83
82
|
- README.rdoc
|
@@ -120,8 +119,8 @@ homepage: http://github.com/pwnall/authpwn_rails
|
|
120
119
|
licenses: []
|
121
120
|
|
122
121
|
post_install_message:
|
123
|
-
rdoc_options:
|
124
|
-
|
122
|
+
rdoc_options: []
|
123
|
+
|
125
124
|
require_paths:
|
126
125
|
- lib
|
127
126
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -150,14 +149,14 @@ signing_key:
|
|
150
149
|
specification_version: 3
|
151
150
|
summary: User authentication for Rails 3 applications.
|
152
151
|
test_files:
|
153
|
-
- test/facebook_token_test.rb
|
154
|
-
- test/session_controller_api_test.rb
|
155
|
-
- test/user_test.rb
|
156
152
|
- test/cookie_controller_test.rb
|
157
|
-
- test/test_helper.rb
|
158
153
|
- test/facebook_controller_test.rb
|
154
|
+
- test/facebook_token_test.rb
|
159
155
|
- test/helpers/application_controller.rb
|
160
|
-
- test/helpers/routes.rb
|
161
|
-
- test/helpers/fbgraph.rb
|
162
156
|
- test/helpers/db_setup.rb
|
157
|
+
- test/helpers/fbgraph.rb
|
158
|
+
- test/helpers/routes.rb
|
163
159
|
- test/helpers/view_helpers.rb
|
160
|
+
- test/session_controller_api_test.rb
|
161
|
+
- test/test_helper.rb
|
162
|
+
- test/user_test.rb
|
data/.gitignore
DELETED