devise-mongo_mapper 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,4 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
data/.rvmrc ADDED
@@ -0,0 +1 @@
1
+ rvm use 1.9.2@devise-mm --create
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in devise-mongo_mapper.gemspec
4
+ gemspec
@@ -0,0 +1,23 @@
1
+ # Devise - MongoMapper
2
+
3
+ This gem lets you use devise with MongoMapper. It's based on the
4
+ [mongoid file](https://github.com/plataformatec/devise/blob/master/lib/devise/orm/mongoid.rb)
5
+ that's included in Devise.
6
+
7
+ ## Installation
8
+
9
+ First include this gem in your Gemfile for your devise project:
10
+
11
+ gem 'devise-mongo_mapper', :path => '~/src/devise-mongo_mapper'
12
+
13
+ Notes: This gem does require devise and mongo_mapper so you don't need to
14
+ specify those gems unless you want specific versions of them. You should also
15
+ probably add the bson_ext gem since it helps speed up the mongo ruby driver
16
+ significantly.
17
+
18
+ Next uncomment the following line in your config/intializers/devise.rb file:
19
+
20
+ require 'devise/orm/mongo_mapper'
21
+
22
+ This line was in my current devise.rb install, if it's not there make sure to
23
+ comment out any other devise/orm lines and add this one.
@@ -0,0 +1 @@
1
+ require 'bundler/gem_tasks'
@@ -0,0 +1,22 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "devise-mongo_mapper/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "devise-mongo_mapper"
7
+ s.version = Devise::MongoMapper::VERSION
8
+ s.authors = ["Christopher Giroir"]
9
+ s.email = ["kelsin@valefor.com"]
10
+ s.homepage = "https://github.com/Kelsin/devise-mongo_mapper"
11
+ s.summary = %q{ORM file for using Devise with MongoMapper}
12
+ s.description = %q{ORM file for using Devise with MongoMapper}
13
+
14
+ s.files = `git ls-files`.split("\n")
15
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
16
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
17
+ s.require_paths = ["lib"]
18
+
19
+ s.add_dependency 'orm_adapter', '>= 0.0.5'
20
+ s.add_dependency 'mongo_mapper'
21
+ s.add_dependency 'devise'
22
+ end
@@ -0,0 +1,7 @@
1
+ require 'devise'
2
+ require 'mongo_mapper'
3
+
4
+ module Devise
5
+ module MongoMapper
6
+ end
7
+ end
@@ -0,0 +1,5 @@
1
+ module Devise
2
+ module MongoMapper
3
+ VERSION = "0.0.2"
4
+ end
5
+ end
@@ -0,0 +1,31 @@
1
+ require 'orm_adapter/adapters/mongo_mapper'
2
+
3
+ module Devise
4
+ module Orm
5
+ module MongoMapper
6
+ module Hook
7
+ def devise_modules_hook!
8
+ extend Schema
9
+ yield
10
+ return unless Devise.apply_schema
11
+ devise_modules.each { |m| send(m) if respond_to?(m, true) }
12
+ end
13
+ end
14
+
15
+ module Schema
16
+ include Devise::Schema
17
+
18
+ # Tell how to apply schema methods
19
+ def apply_devise_schema(name, type, options={})
20
+ type = Time if type == DateTime
21
+ key name, type, options
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
27
+
28
+ MongoMapper::Document::ClassMethods.class_eval do
29
+ include Devise::Models
30
+ include Devise::Orm::MongoMapper::Hook
31
+ end
metadata ADDED
@@ -0,0 +1,89 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: devise-mongo_mapper
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Christopher Giroir
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2011-10-04 00:00:00.000000000 -04:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: orm_adapter
17
+ requirement: &2160265540 !ruby/object:Gem::Requirement
18
+ none: false
19
+ requirements:
20
+ - - ! '>='
21
+ - !ruby/object:Gem::Version
22
+ version: 0.0.5
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: *2160265540
26
+ - !ruby/object:Gem::Dependency
27
+ name: mongo_mapper
28
+ requirement: &2160265120 !ruby/object:Gem::Requirement
29
+ none: false
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: *2160265120
37
+ - !ruby/object:Gem::Dependency
38
+ name: devise
39
+ requirement: &2160264660 !ruby/object:Gem::Requirement
40
+ none: false
41
+ requirements:
42
+ - - ! '>='
43
+ - !ruby/object:Gem::Version
44
+ version: '0'
45
+ type: :runtime
46
+ prerelease: false
47
+ version_requirements: *2160264660
48
+ description: ORM file for using Devise with MongoMapper
49
+ email:
50
+ - kelsin@valefor.com
51
+ executables: []
52
+ extensions: []
53
+ extra_rdoc_files: []
54
+ files:
55
+ - .gitignore
56
+ - .rvmrc
57
+ - Gemfile
58
+ - README.md
59
+ - Rakefile
60
+ - devise-mongo_mapper.gemspec
61
+ - lib/devise-mongo_mapper.rb
62
+ - lib/devise-mongo_mapper/version.rb
63
+ - lib/devise/orm/mongo_mapper.rb
64
+ has_rdoc: true
65
+ homepage: https://github.com/Kelsin/devise-mongo_mapper
66
+ licenses: []
67
+ post_install_message:
68
+ rdoc_options: []
69
+ require_paths:
70
+ - lib
71
+ required_ruby_version: !ruby/object:Gem::Requirement
72
+ none: false
73
+ requirements:
74
+ - - ! '>='
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ required_rubygems_version: !ruby/object:Gem::Requirement
78
+ none: false
79
+ requirements:
80
+ - - ! '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ requirements: []
84
+ rubyforge_project:
85
+ rubygems_version: 1.6.2
86
+ signing_key:
87
+ specification_version: 3
88
+ summary: ORM file for using Devise with MongoMapper
89
+ test_files: []