mm-devise 1.1.7 → 1.1.8
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +10 -4
- data/README.markdown +7 -6
- data/Rakefile +27 -14
- data/lib/devise/orm/mongo_mapper/compatibility.rb +2 -2
- data/lib/mm-devise/version.rb +1 -1
- data/mm-devise.gemspec +2 -2
- data/test/rails_app/config/application.rb +2 -0
- data/test/test_helper.rb +2 -2
- metadata +3 -3
data/Gemfile
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
source :rubygems
|
2
2
|
source 'http://gems.github.com/'
|
3
3
|
|
4
|
-
gem "rails"
|
4
|
+
gem "rails"
|
5
|
+
|
5
6
|
|
6
7
|
group :test do
|
7
8
|
gem "test-unit", "~> 2.0.9"
|
@@ -15,11 +16,16 @@ group :default do
|
|
15
16
|
gem "bcrypt-ruby", :require => "bcrypt"
|
16
17
|
gem "oauth2"
|
17
18
|
gem "warden", ">= 0.10.7"
|
18
|
-
gem 'mongo_mapper', '
|
19
|
-
gem 'sugar-high', '~> 0.
|
19
|
+
gem 'mongo_mapper', '>= 0.8.4'
|
20
|
+
gem 'sugar-high', '~> 0.3.0'
|
20
21
|
gem 'devise', '>= 1.1.1'
|
21
22
|
gem 'rails3-generators', '>= 0.13.0'
|
22
23
|
gem 'jnunemaker-validatable', '~> 1.8.1'
|
23
|
-
gem 'bson_ext', '
|
24
|
+
gem 'bson_ext', '>= 1.0.9'
|
25
|
+
|
26
|
+
gem "orm_adapter"
|
27
|
+
gem "omniauth"
|
28
|
+
|
29
|
+
|
24
30
|
end
|
25
31
|
|
data/README.markdown
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
*mm-devise* will let you use [devise](http://github.com/plataformatec/devise) with [MongoMapper](http://github.com/jnunemaker/mongomapper).
|
4
4
|
|
5
|
-
*mm-devise* is intended for use with *Rails 3* and *Devise 1.1.
|
5
|
+
*mm-devise* is intended for use with *Rails 3* and *Devise 1.1.5* and above. It may work with earlier versions of devise.
|
6
6
|
|
7
7
|
This README only covers *mm-devise* specifics. Make sure to read the [devise README](http://github.com/plataformatec/devise/blob/master/README.rdoc)
|
8
8
|
|
@@ -27,10 +27,10 @@ Add *devise*, *mm-devise* and *MongoMapper* gems to your Gemfile (your Rails app
|
|
27
27
|
|
28
28
|
<pre> gem 'mongo_mapper', '>= 0.8.2'
|
29
29
|
gem 'jnunemaker-validatable', '>= 1.8.4'
|
30
|
-
gem 'bson_ext', '>= 1.0.
|
31
|
-
gem 'devise', '
|
32
|
-
gem 'mm-devise', '>= 1.1.
|
33
|
-
gem 'rails3-generators', '>= 0.
|
30
|
+
gem 'bson_ext', '>= 1.0.9'
|
31
|
+
gem 'devise', '>= 1.1.1'
|
32
|
+
gem 'mm-devise', '>= 1.1.8'
|
33
|
+
# gem 'rails3-generators', '>= 0.14.0' # optional</pre>
|
34
34
|
|
35
35
|
You can install [rails3-generators](http://github.com/indirect/rails3-generators) which includes a *mongo_mapper* Model generator
|
36
36
|
|
@@ -49,7 +49,7 @@ configuration options and you MUST take a look at it. Make sure to specify
|
|
49
49
|
either <code>mongo_mapper</code> or <code>mongo_mapper_active_model</code> (ActiveModel::Validations)
|
50
50
|
as the orm in the configuration file.
|
51
51
|
|
52
|
-
|
52
|
+
<pre>require 'devise/orm/mongo_mapper'</pre>
|
53
53
|
|
54
54
|
Note: The model generator should do this automatically.
|
55
55
|
|
@@ -96,6 +96,7 @@ This is NOT due to any errors in <code>mm-devise</code> but rather due to a few
|
|
96
96
|
|
97
97
|
## Contributors
|
98
98
|
|
99
|
+
*bhbryant* - Fixed some issues and updated gem (Jan 2011)
|
99
100
|
*Jared Morgan* - Created the dm-devise gem which was used as a template for the development of this gem.
|
100
101
|
Also made suggestions for a few critical fixes and improvements in the code. Thanks :)
|
101
102
|
|
data/Rakefile
CHANGED
@@ -1,38 +1,50 @@
|
|
1
1
|
# encoding: UTF-8
|
2
2
|
|
3
3
|
require 'rake'
|
4
|
+
require 'bundler'
|
5
|
+
Bundler::GemHelper.install_tasks
|
6
|
+
|
7
|
+
|
4
8
|
require 'rake/testtask'
|
5
9
|
require 'rake/rdoctask'
|
6
10
|
require File.join(File.dirname(__FILE__), 'lib', 'mm-devise', 'version')
|
7
11
|
|
8
|
-
desc '
|
9
|
-
task :default => :pre_commit
|
12
|
+
desc 'Run Devise tests using MongoMapper. Specify path to devise with DEVISE_PATH'
|
10
13
|
|
11
|
-
desc 'Run Devise tests for all MongoMapper ORM setups.'
|
12
|
-
task :pre_commit do
|
13
|
-
Dir[File.join(File.dirname(__FILE__), 'test', 'orm', '*.rb')].each do |file|
|
14
|
-
orm = File.basename(file).split(".").first
|
15
|
-
ENV['DEVISE_PATH'] ||= File.expand_path('../devise')
|
16
|
-
system "rake test DEVISE_ORM=#{orm} DEVISE_PATH=#{ENV['DEVISE_PATH']}"
|
17
|
-
end
|
18
|
-
end
|
19
14
|
|
20
|
-
desc 'Run Devise tests using MongoMapper. Specify path to devise with DEVISE_PATH'
|
21
15
|
Rake::TestTask.new(:test) do |test|
|
22
16
|
ENV['DEVISE_ORM'] ||= 'mongo_mapper'
|
23
|
-
ENV['DEVISE_PATH'] ||=
|
17
|
+
ENV['DEVISE_PATH'] ||= File.join(File.dirname(__FILE__), '../devise')
|
24
18
|
unless File.exist?(ENV['DEVISE_PATH'])
|
25
19
|
puts "Specify the path to devise (e.g. rake DEVISE_PATH=/path/to/devise). Not found at #{ENV['DEVISE_PATH']}"
|
26
20
|
exit
|
27
21
|
end
|
22
|
+
|
28
23
|
test.libs << 'lib' << 'test'
|
29
24
|
test.libs << "#{ENV['DEVISE_PATH']}/lib"
|
30
25
|
test.libs << "#{ENV['DEVISE_PATH']}/test"
|
31
|
-
test.test_files = FileList["#{ENV['DEVISE_PATH']}/test/**/*_test.rb"] +
|
26
|
+
test.test_files = FileList["#{ENV['DEVISE_PATH']}/test/**/*_test.rb"] + FileList['test/**/*_test.rb']
|
32
27
|
test.verbose = true
|
33
28
|
end
|
34
29
|
|
35
|
-
|
30
|
+
desc 'Default: run tests for all ORMs.'
|
31
|
+
task :default => :tests
|
32
|
+
|
33
|
+
=begin
|
34
|
+
desc 'Default: run tests for all MongoMapper ORM setups.'
|
35
|
+
task :default => :pre_commit
|
36
|
+
|
37
|
+
desc 'Run Devise tests for all MongoMapper ORM setups.'
|
38
|
+
task :pre_commit do
|
39
|
+
Dir[File.join(File.dirname(__FILE__), 'test', 'orm', '*.rb')].each do |file|
|
40
|
+
orm = File.basename(file).split(".").first
|
41
|
+
ENV['DEVISE_PATH'] ||= File.expand_path('../devise')
|
42
|
+
system "rake test DEVISE_ORM=#{orm} DEVISE_PATH=#{ENV['DEVISE_PATH']}"
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
|
47
|
+
task :test
|
36
48
|
|
37
49
|
desc 'Generate documentation for dm-devise.'
|
38
50
|
Rake::RDocTask.new(:rdoc) do |rdoc|
|
@@ -67,3 +79,4 @@ begin
|
|
67
79
|
rescue LoadError
|
68
80
|
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
69
81
|
end
|
82
|
+
=end
|
@@ -63,7 +63,7 @@ module Devise
|
|
63
63
|
# def changed?
|
64
64
|
# dirty?
|
65
65
|
# end
|
66
|
-
|
66
|
+
=begin
|
67
67
|
def save(options=nil)
|
68
68
|
if options.is_a?(Hash) && options[:validate] == false
|
69
69
|
save!
|
@@ -79,7 +79,7 @@ module Devise
|
|
79
79
|
# def update_attributes(*args)
|
80
80
|
# update(*args)
|
81
81
|
# end
|
82
|
-
|
82
|
+
=end
|
83
83
|
def invalid?
|
84
84
|
!valid?
|
85
85
|
end
|
data/lib/mm-devise/version.rb
CHANGED
data/mm-devise.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{mm-devise}
|
8
|
-
s.version = "1.1.
|
8
|
+
s.version = "1.1.8"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Kristian Mandrup"]
|
12
|
-
s.date = %q{
|
12
|
+
s.date = %q{2011-01-11}
|
13
13
|
s.description = %q{dm-devise adds MongoMapper support to devise (http://github.com/plataformatec/devise) for authentication support for Rails}
|
14
14
|
s.email = %q{jmorgan@morgancreative.net}
|
15
15
|
s.extra_rdoc_files = [
|
data/test/test_helper.rb
CHANGED
@@ -8,7 +8,7 @@ require "rails_app/config/environment"
|
|
8
8
|
require "rails/test_help"
|
9
9
|
require "orm/#{DEVISE_ORM}"
|
10
10
|
|
11
|
-
MongoMapper.connection = Mongo::Connection.new('localhost')
|
11
|
+
MongoMapper.connection = Mongo::Connection.new(ENV['MONGO_RUBY_DRIVER_HOST'] || 'localhost')
|
12
12
|
MongoMapper.database = 'mm-devise-db'
|
13
13
|
|
14
14
|
I18n.load_path << "#{DEVISE_PATH}/test/support/locale/en.yml"
|
@@ -19,7 +19,7 @@ Webrat.configure do |config|
|
|
19
19
|
config.open_error_files = false
|
20
20
|
end
|
21
21
|
|
22
|
-
Devise::Oauth.test_mode!
|
22
|
+
#Devise::Oauth.test_mode!
|
23
23
|
|
24
24
|
# Add support to load paths so we can overwrite broken webrat setup
|
25
25
|
$:.unshift "#{DEVISE_PATH}/test/support"
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 1.1.
|
8
|
+
- 8
|
9
|
+
version: 1.1.8
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Kristian Mandrup
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date:
|
17
|
+
date: 2011-01-11 00:00:00 +01:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|