devise 1.1.4 → 1.1.5
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of devise might be problematic. Click here for more details.
- data/CHANGELOG.rdoc +8 -0
- data/Gemfile +23 -8
- data/Gemfile.lock +51 -38
- data/lib/devise.rb +1 -1
- data/lib/devise/rails/warden_compat.rb +5 -0
- data/lib/devise/version.rb +1 -1
- data/lib/generators/templates/devise.rb +2 -2
- data/test/indifferent_hash.rb +33 -0
- data/test/orm/mongoid.rb +3 -2
- data/test/rails_app/config/boot.rb +2 -2
- data/test/rails_app/config/initializers/devise.rb +1 -1
- data/test/test_helper.rb +3 -2
- metadata +6 -4
data/CHANGELOG.rdoc
CHANGED
data/Gemfile
CHANGED
@@ -2,11 +2,26 @@ source "http://rubygems.org"
|
|
2
2
|
|
3
3
|
gemspec
|
4
4
|
|
5
|
-
gem "rails", "3.0.
|
6
|
-
|
7
|
-
|
8
|
-
gem "
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
5
|
+
gem "rails", "~> 3.0.0"
|
6
|
+
|
7
|
+
group :test do
|
8
|
+
gem "webrat", "0.7.2", :require => false
|
9
|
+
gem "mocha", :require => false
|
10
|
+
end
|
11
|
+
|
12
|
+
platforms :jruby do
|
13
|
+
gem 'activerecord-jdbcsqlite3-adapter'
|
14
|
+
end
|
15
|
+
|
16
|
+
platforms :ruby do
|
17
|
+
group :test do
|
18
|
+
gem "sqlite3-ruby"
|
19
|
+
gem "ruby-debug", ">= 0.10.3" if RUBY_VERSION < '1.9'
|
20
|
+
end
|
21
|
+
|
22
|
+
group :mongoid do
|
23
|
+
gem "mongo", "1.1.2"
|
24
|
+
gem "mongoid", "2.0.0.beta.20"
|
25
|
+
gem "bson_ext", "1.1.2"
|
26
|
+
end
|
27
|
+
end
|
data/Gemfile.lock
CHANGED
@@ -9,35 +9,36 @@ GEM
|
|
9
9
|
remote: http://rubygems.org/
|
10
10
|
specs:
|
11
11
|
abstract (1.0.0)
|
12
|
-
actionmailer (3.0.
|
13
|
-
actionpack (= 3.0.
|
14
|
-
mail (~> 2.2.
|
15
|
-
actionpack (3.0.
|
16
|
-
activemodel (= 3.0.
|
17
|
-
activesupport (= 3.0.
|
12
|
+
actionmailer (3.0.3)
|
13
|
+
actionpack (= 3.0.3)
|
14
|
+
mail (~> 2.2.9)
|
15
|
+
actionpack (3.0.3)
|
16
|
+
activemodel (= 3.0.3)
|
17
|
+
activesupport (= 3.0.3)
|
18
18
|
builder (~> 2.1.2)
|
19
19
|
erubis (~> 2.6.6)
|
20
|
-
i18n (~> 0.4
|
20
|
+
i18n (~> 0.4)
|
21
21
|
rack (~> 1.2.1)
|
22
|
-
rack-mount (~> 0.6.
|
23
|
-
rack-test (~> 0.5.
|
22
|
+
rack-mount (~> 0.6.13)
|
23
|
+
rack-test (~> 0.5.6)
|
24
24
|
tzinfo (~> 0.3.23)
|
25
|
-
activemodel (3.0.
|
26
|
-
activesupport (= 3.0.
|
25
|
+
activemodel (3.0.3)
|
26
|
+
activesupport (= 3.0.3)
|
27
27
|
builder (~> 2.1.2)
|
28
|
-
i18n (~> 0.4
|
29
|
-
activerecord (3.0.
|
30
|
-
activemodel (= 3.0.
|
31
|
-
activesupport (= 3.0.
|
32
|
-
arel (~>
|
28
|
+
i18n (~> 0.4)
|
29
|
+
activerecord (3.0.3)
|
30
|
+
activemodel (= 3.0.3)
|
31
|
+
activesupport (= 3.0.3)
|
32
|
+
arel (~> 2.0.2)
|
33
33
|
tzinfo (~> 0.3.23)
|
34
|
-
activeresource (3.0.
|
35
|
-
activemodel (= 3.0.
|
36
|
-
activesupport (= 3.0.
|
37
|
-
activesupport (3.0.
|
38
|
-
arel (
|
39
|
-
activesupport (~> 3.0.0)
|
34
|
+
activeresource (3.0.3)
|
35
|
+
activemodel (= 3.0.3)
|
36
|
+
activesupport (= 3.0.3)
|
37
|
+
activesupport (3.0.3)
|
38
|
+
arel (2.0.4)
|
40
39
|
bcrypt-ruby (2.1.2)
|
40
|
+
bson (1.1.2)
|
41
|
+
bson_ext (1.1.2)
|
41
42
|
builder (2.1.2)
|
42
43
|
columnize (0.3.2)
|
43
44
|
erubis (2.6.6)
|
@@ -52,6 +53,13 @@ GEM
|
|
52
53
|
mime-types (1.16)
|
53
54
|
mocha (0.9.9)
|
54
55
|
rake
|
56
|
+
mongo (1.1.2)
|
57
|
+
bson (>= 1.1.1)
|
58
|
+
mongoid (2.0.0.beta.20)
|
59
|
+
activemodel (~> 3.0)
|
60
|
+
mongo (~> 1.1)
|
61
|
+
tzinfo (~> 0.3.22)
|
62
|
+
will_paginate (~> 3.0.pre)
|
55
63
|
nokogiri (1.4.4)
|
56
64
|
polyglot (0.3.1)
|
57
65
|
rack (1.2.1)
|
@@ -59,19 +67,19 @@ GEM
|
|
59
67
|
rack (>= 1.0.0)
|
60
68
|
rack-test (0.5.6)
|
61
69
|
rack (>= 1.0)
|
62
|
-
rails (3.0.
|
63
|
-
actionmailer (= 3.0.
|
64
|
-
actionpack (= 3.0.
|
65
|
-
activerecord (= 3.0.
|
66
|
-
activeresource (= 3.0.
|
67
|
-
activesupport (= 3.0.
|
68
|
-
bundler (~> 1.0
|
69
|
-
railties (= 3.0.
|
70
|
-
railties (3.0.
|
71
|
-
actionpack (= 3.0.
|
72
|
-
activesupport (= 3.0.
|
73
|
-
rake (>= 0.8.
|
74
|
-
thor (~> 0.14.
|
70
|
+
rails (3.0.3)
|
71
|
+
actionmailer (= 3.0.3)
|
72
|
+
actionpack (= 3.0.3)
|
73
|
+
activerecord (= 3.0.3)
|
74
|
+
activeresource (= 3.0.3)
|
75
|
+
activesupport (= 3.0.3)
|
76
|
+
bundler (~> 1.0)
|
77
|
+
railties (= 3.0.3)
|
78
|
+
railties (3.0.3)
|
79
|
+
actionpack (= 3.0.3)
|
80
|
+
activesupport (= 3.0.3)
|
81
|
+
rake (>= 0.8.7)
|
82
|
+
thor (~> 0.14.4)
|
75
83
|
rake (0.8.7)
|
76
84
|
ruby-debug (0.10.4)
|
77
85
|
columnize (>= 0.1)
|
@@ -85,20 +93,25 @@ GEM
|
|
85
93
|
tzinfo (0.3.23)
|
86
94
|
warden (1.0.2)
|
87
95
|
rack (>= 1.0.0)
|
88
|
-
webrat (0.7.
|
96
|
+
webrat (0.7.2)
|
89
97
|
nokogiri (>= 1.2.0)
|
90
98
|
rack (>= 1.0)
|
91
99
|
rack-test (>= 0.5.3)
|
100
|
+
will_paginate (3.0.pre2)
|
92
101
|
|
93
102
|
PLATFORMS
|
94
103
|
ruby
|
95
104
|
|
96
105
|
DEPENDENCIES
|
106
|
+
activerecord-jdbcsqlite3-adapter
|
97
107
|
bcrypt-ruby (~> 2.1.2)
|
108
|
+
bson_ext (= 1.1.2)
|
98
109
|
devise!
|
99
110
|
mocha
|
100
|
-
|
111
|
+
mongo (= 1.1.2)
|
112
|
+
mongoid (= 2.0.0.beta.20)
|
113
|
+
rails (~> 3.0.0)
|
101
114
|
ruby-debug (>= 0.10.3)
|
102
115
|
sqlite3-ruby
|
103
116
|
warden (~> 1.0.2)
|
104
|
-
webrat (= 0.7.
|
117
|
+
webrat (= 0.7.2)
|
data/lib/devise.rb
CHANGED
@@ -67,7 +67,7 @@ module Devise
|
|
67
67
|
|
68
68
|
# If http authentication is enabled by default.
|
69
69
|
mattr_accessor :http_authenticatable
|
70
|
-
@@http_authenticatable =
|
70
|
+
@@http_authenticatable = false
|
71
71
|
|
72
72
|
# If http authentication is used for ajax requests. True by default.
|
73
73
|
mattr_accessor :http_authenticatable_on_xhr
|
@@ -44,6 +44,10 @@ unless Devise.rack_session?
|
|
44
44
|
alias_method :regular_writer, :[]= unless method_defined?(:regular_writer)
|
45
45
|
alias_method :regular_update, :update unless method_defined?(:regular_update)
|
46
46
|
|
47
|
+
def [](key)
|
48
|
+
super(convert_key(key))
|
49
|
+
end
|
50
|
+
|
47
51
|
def []=(key, value)
|
48
52
|
regular_writer(convert_key(key), value)
|
49
53
|
end
|
@@ -88,6 +92,7 @@ unless Devise.rack_session?
|
|
88
92
|
def symbolize_keys; to_hash.symbolize_keys end
|
89
93
|
|
90
94
|
def to_options!; self end
|
95
|
+
def to_hash; Hash.new.update(self) end
|
91
96
|
|
92
97
|
protected
|
93
98
|
|
data/lib/devise/version.rb
CHANGED
@@ -25,8 +25,8 @@ Devise.setup do |config|
|
|
25
25
|
# Tell if authentication through request.params is enabled. True by default.
|
26
26
|
# config.params_authenticatable = true
|
27
27
|
|
28
|
-
# Tell if authentication through HTTP Basic Auth is enabled.
|
29
|
-
# config.http_authenticatable =
|
28
|
+
# Tell if authentication through HTTP Basic Auth is enabled. False by default.
|
29
|
+
# config.http_authenticatable = false
|
30
30
|
|
31
31
|
# Set this to true to use Basic Auth for AJAX requests. True by default.
|
32
32
|
# config.http_authenticatable_on_xhr = true
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class IndifferentHashTest < ActiveSupport::TestCase
|
4
|
+
setup do
|
5
|
+
@hash = Devise::IndifferentHash.new
|
6
|
+
end
|
7
|
+
|
8
|
+
test "it overwrites getter and setter" do
|
9
|
+
@hash[:foo] = "bar"
|
10
|
+
assert_equal "bar", @hash["foo"]
|
11
|
+
assert_equal "bar", @hash[:foo]
|
12
|
+
|
13
|
+
@hash["foo"] = "baz"
|
14
|
+
assert_equal "baz", @hash["foo"]
|
15
|
+
assert_equal "baz", @hash[:foo]
|
16
|
+
end
|
17
|
+
|
18
|
+
test "it overwrites update" do
|
19
|
+
@hash.update :foo => "bar"
|
20
|
+
assert_equal "bar", @hash["foo"]
|
21
|
+
assert_equal "bar", @hash[:foo]
|
22
|
+
|
23
|
+
@hash.update "foo" => "baz"
|
24
|
+
assert_equal "baz", @hash["foo"]
|
25
|
+
assert_equal "baz", @hash[:foo]
|
26
|
+
end
|
27
|
+
|
28
|
+
test "it returns a Hash on to_hash" do
|
29
|
+
@hash[:foo] = "bar"
|
30
|
+
assert_equal Hash["foo", "bar"], @hash.to_hash
|
31
|
+
assert_kind_of Hash, @hash.to_hash
|
32
|
+
end
|
33
|
+
end if defined?(Devise::IndifferentHash)
|
data/test/orm/mongoid.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
Mongoid.configure do |config|
|
2
|
-
config.master
|
2
|
+
config.master = Mongo::Connection.new('127.0.0.1', 27017).db("devise-test-suite")
|
3
|
+
config.use_utc = true
|
3
4
|
end
|
4
5
|
|
5
6
|
class ActiveSupport::TestCase
|
@@ -7,4 +8,4 @@ class ActiveSupport::TestCase
|
|
7
8
|
User.delete_all
|
8
9
|
Admin.delete_all
|
9
10
|
end
|
10
|
-
end
|
11
|
+
end
|
@@ -7,7 +7,7 @@ begin
|
|
7
7
|
rescue LoadError
|
8
8
|
require 'rubygems'
|
9
9
|
require 'bundler'
|
10
|
-
Bundler.setup :default, DEVISE_ORM
|
10
|
+
Bundler.setup :default, :test, DEVISE_ORM
|
11
11
|
end
|
12
12
|
|
13
|
-
$:.unshift File.expand_path('../../../../lib', __FILE__)
|
13
|
+
$:.unshift File.expand_path('../../../../lib', __FILE__)
|
@@ -26,7 +26,7 @@ Devise.setup do |config|
|
|
26
26
|
# config.params_authenticatable = true
|
27
27
|
|
28
28
|
# Tell if authentication through HTTP Basic Auth is enabled. True by default.
|
29
|
-
|
29
|
+
config.http_authenticatable = true
|
30
30
|
|
31
31
|
# The realm used in Http Basic Authentication
|
32
32
|
# config.http_authentication_realm = "Application"
|
data/test/test_helper.rb
CHANGED
@@ -9,8 +9,9 @@ require "rails/test_help"
|
|
9
9
|
require "orm/#{DEVISE_ORM}"
|
10
10
|
|
11
11
|
I18n.load_path << File.expand_path("../support/locale/en.yml", __FILE__)
|
12
|
-
require 'mocha'
|
13
12
|
|
13
|
+
require 'mocha'
|
14
|
+
require 'webrat'
|
14
15
|
Webrat.configure do |config|
|
15
16
|
config.mode = :rails
|
16
17
|
config.open_error_files = false
|
@@ -18,4 +19,4 @@ end
|
|
18
19
|
|
19
20
|
# Add support to load paths so we can overwrite broken webrat setup
|
20
21
|
$:.unshift File.expand_path('../support', __FILE__)
|
21
|
-
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
22
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devise
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 1.1.
|
9
|
+
- 5
|
10
|
+
version: 1.1.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- "Jos\xC3\xA9 Valim"
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2010-11-
|
19
|
+
date: 2010-11-27 00:00:00 +01:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
@@ -153,6 +153,7 @@ files:
|
|
153
153
|
- test/devise_test.rb
|
154
154
|
- test/encryptors_test.rb
|
155
155
|
- test/failure_app_test.rb
|
156
|
+
- test/indifferent_hash.rb
|
156
157
|
- test/integration/authenticatable_test.rb
|
157
158
|
- test/integration/confirmable_test.rb
|
158
159
|
- test/integration/database_authenticatable_test.rb
|
@@ -256,6 +257,7 @@ test_files:
|
|
256
257
|
- test/devise_test.rb
|
257
258
|
- test/encryptors_test.rb
|
258
259
|
- test/failure_app_test.rb
|
260
|
+
- test/indifferent_hash.rb
|
259
261
|
- test/integration/authenticatable_test.rb
|
260
262
|
- test/integration/confirmable_test.rb
|
261
263
|
- test/integration/database_authenticatable_test.rb
|