dm-devise 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/.document ADDED
@@ -0,0 +1,5 @@
1
+ README.rdoc
2
+ lib/**/*.rb
3
+ bin/*
4
+ features/**/*.feature
5
+ LICENSE
data/.gitignore ADDED
@@ -0,0 +1,5 @@
1
+ coverage/*
2
+ .bundle
3
+ rdoc/*
4
+ pkg
5
+ log
data/Gemfile ADDED
@@ -0,0 +1,20 @@
1
+ source :rubygems
2
+
3
+ gem "rails", :git => "git://github.com/rails/rails.git"
4
+
5
+ gem "warden", "0.10.7"
6
+ gem "webrat", "0.7.0"
7
+ gem "mocha", :require => false
8
+ gem "bcrypt-ruby", :require => "bcrypt"
9
+ gem 'devise', '~> 1.1.0', :git => 'git://github.com/plataformatec/devise'
10
+
11
+ gem 'dm-core', '~> 1.0.0'
12
+ gem 'dm-migrations', '~> 1.0.0'
13
+ gem 'dm-sqlite-adapter', '~> 1.0.0'
14
+ gem 'dm-serializer', '~> 1.0.0'
15
+ gem 'dm-timestamps', '~> 1.0.0'
16
+ gem 'dm-rails', '~> 1.0.0', :git => 'git://github.com/datamapper/dm-rails'
17
+
18
+ group :data_mapper do
19
+ gem 'dm-validations', '~> 1.0.0'
20
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,252 @@
1
+ GIT
2
+ remote: git://github.com/datamapper/dm-rails
3
+ revision: e2ee760
4
+ specs:
5
+ dm-rails (1.0.0)
6
+ actionpack (~> 3.0.0.beta3)
7
+ activesupport (~> 3.0.0.beta3)
8
+ dm-active_model (~> 1.0.0)
9
+ dm-core (~> 1.0.0)
10
+ railties (~> 3.0.0.beta3)
11
+ dm-rails (1.0.0)
12
+ actionpack (~> 3.0.0.beta3)
13
+ activesupport (~> 3.0.0.beta3)
14
+ dm-active_model (~> 1.0.0)
15
+ dm-core (~> 1.0.0)
16
+ railties (~> 3.0.0.beta3)
17
+
18
+ GIT
19
+ remote: git://github.com/plataformatec/devise
20
+ revision: ae6322e
21
+ specs:
22
+ devise (1.1.0)
23
+ bcrypt-ruby (~> 2.1.2)
24
+ warden (~> 0.10.7)
25
+ devise (1.1.0)
26
+ bcrypt-ruby (~> 2.1.2)
27
+ warden (~> 0.10.7)
28
+
29
+ GIT
30
+ remote: git://github.com/rails/rails.git
31
+ revision: 8079484
32
+ specs:
33
+ actionmailer (3.0.0.beta4)
34
+ actionpack (= 3.0.0.beta4)
35
+ mail (~> 2.2.3)
36
+ actionmailer (3.0.0.beta4)
37
+ actionpack (= 3.0.0.beta4)
38
+ mail (~> 2.2.3)
39
+ actionpack (3.0.0.beta4)
40
+ activemodel (= 3.0.0.beta4)
41
+ activesupport (= 3.0.0.beta4)
42
+ builder (~> 2.1.2)
43
+ erubis (~> 2.6.6)
44
+ i18n (~> 0.4.1)
45
+ rack (~> 1.2.1)
46
+ rack-test (~> 0.5.4)
47
+ tzinfo (~> 0.3.16)
48
+ actionpack (3.0.0.beta4)
49
+ activemodel (= 3.0.0.beta4)
50
+ activesupport (= 3.0.0.beta4)
51
+ builder (~> 2.1.2)
52
+ erubis (~> 2.6.6)
53
+ i18n (~> 0.4.1)
54
+ rack (~> 1.2.1)
55
+ rack-test (~> 0.5.4)
56
+ tzinfo (~> 0.3.16)
57
+ activemodel (3.0.0.beta4)
58
+ activesupport (= 3.0.0.beta4)
59
+ builder (~> 2.1.2)
60
+ i18n (~> 0.4.1)
61
+ activemodel (3.0.0.beta4)
62
+ activesupport (= 3.0.0.beta4)
63
+ builder (~> 2.1.2)
64
+ i18n (~> 0.4.1)
65
+ activerecord (3.0.0.beta4)
66
+ activemodel (= 3.0.0.beta4)
67
+ activesupport (= 3.0.0.beta4)
68
+ arel (~> 0.4.0)
69
+ tzinfo (~> 0.3.16)
70
+ activerecord (3.0.0.beta4)
71
+ activemodel (= 3.0.0.beta4)
72
+ activesupport (= 3.0.0.beta4)
73
+ arel (~> 0.4.0)
74
+ tzinfo (~> 0.3.16)
75
+ activeresource (3.0.0.beta4)
76
+ activemodel (= 3.0.0.beta4)
77
+ activesupport (= 3.0.0.beta4)
78
+ activeresource (3.0.0.beta4)
79
+ activemodel (= 3.0.0.beta4)
80
+ activesupport (= 3.0.0.beta4)
81
+ activesupport (3.0.0.beta4)
82
+ activesupport (3.0.0.beta4)
83
+ rails (3.0.0.beta4)
84
+ actionmailer (= 3.0.0.beta4)
85
+ actionpack (= 3.0.0.beta4)
86
+ activerecord (= 3.0.0.beta4)
87
+ activeresource (= 3.0.0.beta4)
88
+ activesupport (= 3.0.0.beta4)
89
+ bundler (>= 1.0.0.beta.2)
90
+ railties (= 3.0.0.beta4)
91
+ rails (3.0.0.beta4)
92
+ actionmailer (= 3.0.0.beta4)
93
+ actionpack (= 3.0.0.beta4)
94
+ activerecord (= 3.0.0.beta4)
95
+ activeresource (= 3.0.0.beta4)
96
+ activesupport (= 3.0.0.beta4)
97
+ bundler (>= 1.0.0.beta.2)
98
+ railties (= 3.0.0.beta4)
99
+ railties (3.0.0.beta4)
100
+ actionpack (= 3.0.0.beta4)
101
+ activesupport (= 3.0.0.beta4)
102
+ rake (>= 0.8.3)
103
+ thor (~> 0.13.7)
104
+ railties (3.0.0.beta4)
105
+ actionpack (= 3.0.0.beta4)
106
+ activesupport (= 3.0.0.beta4)
107
+ rake (>= 0.8.3)
108
+ thor (~> 0.13.7)
109
+
110
+ GEM
111
+ remote: http://rubygems.org/
112
+ specs:
113
+ abstract (1.0.0)
114
+ abstract (1.0.0)
115
+ addressable (2.1.2)
116
+ addressable (2.1.2)
117
+ arel (0.4.0)
118
+ activesupport (>= 3.0.0.beta)
119
+ arel (0.4.0)
120
+ activesupport (>= 3.0.0.beta)
121
+ bcrypt-ruby (2.1.2)
122
+ bcrypt-ruby (2.1.2)
123
+ builder (2.1.2)
124
+ builder (2.1.2)
125
+ data_objects (0.10.2)
126
+ addressable (~> 2.1)
127
+ data_objects (0.10.2)
128
+ addressable (~> 2.1)
129
+ dm-active_model (1.0.0)
130
+ activemodel (~> 3.0.0.beta3)
131
+ dm-core (~> 1.0.0)
132
+ dm-active_model (1.0.0)
133
+ activemodel (~> 3.0.0.beta3)
134
+ dm-core (~> 1.0.0)
135
+ dm-core (1.0.0)
136
+ addressable (~> 2.1)
137
+ extlib (~> 0.9.15)
138
+ dm-core (1.0.0)
139
+ addressable (~> 2.1)
140
+ extlib (~> 0.9.15)
141
+ dm-do-adapter (1.0.0)
142
+ data_objects (~> 0.10.1)
143
+ dm-core (~> 1.0.0)
144
+ dm-do-adapter (1.0.0)
145
+ data_objects (~> 0.10.1)
146
+ dm-core (~> 1.0.0)
147
+ dm-migrations (1.0.0)
148
+ dm-core (~> 1.0.0)
149
+ dm-migrations (1.0.0)
150
+ dm-core (~> 1.0.0)
151
+ dm-serializer (1.0.0)
152
+ dm-core (~> 1.0.0)
153
+ fastercsv (~> 1.5.3)
154
+ json_pure (~> 1.4.3)
155
+ dm-serializer (1.0.0)
156
+ dm-core (~> 1.0.0)
157
+ fastercsv (~> 1.5.3)
158
+ json_pure (~> 1.4.3)
159
+ dm-sqlite-adapter (1.0.0)
160
+ dm-do-adapter (~> 1.0.0)
161
+ do_sqlite3 (~> 0.10.2)
162
+ dm-sqlite-adapter (1.0.0)
163
+ dm-do-adapter (~> 1.0.0)
164
+ do_sqlite3 (~> 0.10.2)
165
+ dm-timestamps (1.0.0)
166
+ dm-core (~> 1.0.0)
167
+ dm-timestamps (1.0.0)
168
+ dm-core (~> 1.0.0)
169
+ dm-validations (1.0.0)
170
+ dm-core (~> 1.0.0)
171
+ dm-validations (1.0.0)
172
+ dm-core (~> 1.0.0)
173
+ do_sqlite3 (0.10.2)
174
+ data_objects (= 0.10.2)
175
+ do_sqlite3 (0.10.2)
176
+ data_objects (= 0.10.2)
177
+ erubis (2.6.6)
178
+ abstract (>= 1.0.0)
179
+ erubis (2.6.6)
180
+ abstract (>= 1.0.0)
181
+ extlib (0.9.15)
182
+ extlib (0.9.15)
183
+ fastercsv (1.5.3)
184
+ fastercsv (1.5.3)
185
+ i18n (0.4.1)
186
+ i18n (0.4.1)
187
+ json_pure (1.4.3)
188
+ json_pure (1.4.3)
189
+ mail (2.2.5)
190
+ activesupport (>= 2.3.6)
191
+ mime-types
192
+ treetop (>= 1.4.5)
193
+ mail (2.2.5)
194
+ activesupport (>= 2.3.6)
195
+ mime-types
196
+ treetop (>= 1.4.5)
197
+ mime-types (1.16)
198
+ mime-types (1.16)
199
+ mocha (0.9.8)
200
+ rake
201
+ mocha (0.9.8)
202
+ rake
203
+ nokogiri (1.4.2)
204
+ nokogiri (1.4.2)
205
+ polyglot (0.3.1)
206
+ polyglot (0.3.1)
207
+ rack (1.2.1)
208
+ rack (1.2.1)
209
+ rack-test (0.5.4)
210
+ rack (>= 1.0)
211
+ rack-test (0.5.4)
212
+ rack (>= 1.0)
213
+ rake (0.8.7)
214
+ rake (0.8.7)
215
+ thor (0.13.7)
216
+ thor (0.13.7)
217
+ treetop (1.4.8)
218
+ polyglot (>= 0.3.1)
219
+ treetop (1.4.8)
220
+ polyglot (>= 0.3.1)
221
+ tzinfo (0.3.22)
222
+ tzinfo (0.3.22)
223
+ warden (0.10.7)
224
+ rack (>= 1.0.0)
225
+ warden (0.10.7)
226
+ rack (>= 1.0.0)
227
+ webrat (0.7.0)
228
+ nokogiri (>= 1.2.0)
229
+ rack (>= 1.0)
230
+ rack-test (>= 0.5.3)
231
+ webrat (0.7.0)
232
+ nokogiri (>= 1.2.0)
233
+ rack (>= 1.0)
234
+ rack-test (>= 0.5.3)
235
+
236
+ PLATFORMS
237
+ ruby
238
+
239
+ DEPENDENCIES
240
+ bcrypt-ruby
241
+ devise (~> 1.1.0)!
242
+ dm-core (~> 1.0.0)
243
+ dm-migrations (~> 1.0.0)
244
+ dm-rails (~> 1.0.0)!
245
+ dm-serializer (~> 1.0.0)
246
+ dm-sqlite-adapter (~> 1.0.0)
247
+ dm-timestamps (~> 1.0.0)
248
+ dm-validations (~> 1.0.0)
249
+ mocha
250
+ rails!
251
+ warden (= 0.10.7)
252
+ webrat (= 0.7.0)
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2009 Jared Morgan
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,96 @@
1
+ = dm-devise
2
+
3
+ dm-devise lets you use devise (http://github.com/plataformatec/devise) with
4
+ DataMapper. The gem gives you the options of 2 ORM setups depending on what
5
+ library you wish to use for validations:
6
+
7
+ :data_mapper::
8
+ Uses dm-validations. This involves a bit of monkey-patching, but you need to
9
+ use this if you want auto-validations in *any* of your models.
10
+ :data_mapper_active_model::
11
+ Uses ActiveModel::Validations. Do not use if you require 'dm-validations'
12
+ anywhere in your app (or include it in your Gemfile). Things will break.
13
+ The advantage to this is ActiveModel's I18n support for error messages, and
14
+ it uses the same validations lib as devise does by default.
15
+
16
+ dm-devise is intended for use with Rails 3 and devise 1.1. It may work with
17
+ earlier versions, but it's not been tested (if you try, please let Jared Morgan
18
+ (http://github.com/jm81) know how it goes.)
19
+
20
+ This README only covers dm-devise specifics. Make sure to read the devise
21
+ README http://github.com/plataformatec/devise/blob/master/README.rdoc
22
+
23
+ == Installation
24
+
25
+ Rails, devise and dm-rails all need to be following master while rails and
26
+ devise are in beta/pre-release stage.
27
+
28
+ Make sure the following are in your Gemfile (the :git => 'path' arguments are
29
+ needed for now):
30
+
31
+ gem "rails", :git => "git://github.com/rails/rails.git"
32
+
33
+ gem 'dm-core', '~> 1.0.0'
34
+ gem 'dm-migrations', '~> 1.0.0'
35
+ gem 'dm-sqlite-adapter', '~> 1.0.0' # or your preferred adapter
36
+ gem 'dm-serializer', '~> 1.0.0'
37
+ gem 'dm-timestamps', '~> 1.0.0'
38
+ gem 'dm-rails', '~> 1.0.0', :git => 'git://github.com/datamapper/dm-rails'
39
+ gem 'dm-validations', '~> 1.0.0' # Do not include if using data_mapper_active_model
40
+
41
+ gem 'devise', '~> 1.1.0', :git => 'git://github.com/plataformatec/devise'
42
+ gem 'dm-devise', '~> 0.1.0', :git => 'git://github.com/jm81/dm-devise'
43
+
44
+ If you're using data_mapper_active_model do not include dm-validations in your
45
+ Gemfile. Note that it's fine to follow master on DM gems other than dm-rails,
46
+ but dm-rails is the only one where it's needed.
47
+
48
+ Run the generator:
49
+
50
+ rails generate devise:install
51
+
52
+ The generator will install an initializer which describes ALL Devise's
53
+ configuration options and you MUST take a look at it. Make sure to specify
54
+ either data_mapper (for using dm-validations) or data_mapper_active_model
55
+ (ActiveModel::Validations) as the orm in the configuration file.
56
+
57
+ To add Devise to any of your models using the generator:
58
+
59
+ rails generate data_mapper:devise MODEL
60
+
61
+ Read the README for devise at http://github.com/plataformatec/devise/blob/master/README.rdoc
62
+
63
+ == TODO
64
+
65
+ * Example app
66
+ * Publish gem
67
+ * Updates when Rails 3 / Devise 1.1 are released (remove :git sources in Gemfile)
68
+ * Rails templates
69
+
70
+ == Note on Patches/Pull Requests
71
+
72
+ * Fork the project.
73
+ * Make your feature addition or bug fix.
74
+ * Add tests for it. This is important so I don't break it in a
75
+ future version unintentionally.
76
+ * Commit, do not mess with rakefile, version, or history.
77
+ (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
78
+ * Send me a pull request. Bonus points for topic branches.
79
+
80
+ == Maintainers
81
+
82
+ * Jared Morgan (http://github.com/jm81)
83
+
84
+ == Contributors
85
+
86
+ http://github.com/jm81/dm-devise/contributors
87
+
88
+ == Bugs and Feedback
89
+
90
+ For dm-devise specific issues, please create an issue on GitHub at:
91
+
92
+ http://github.com/jm81/dm-devise/issues
93
+
94
+ == Copyright
95
+
96
+ Copyright (c) 2010 Jared Morgan. See LICENSE for details.
data/Rakefile ADDED
@@ -0,0 +1,73 @@
1
+ # encoding: UTF-8
2
+
3
+ require 'rake'
4
+ require 'rake/testtask'
5
+ require 'rake/rdoctask'
6
+ require File.join(File.dirname(__FILE__), 'lib', 'dm-devise', 'version')
7
+
8
+ desc 'Default: run tests for all DataMapper ORM setups.'
9
+ task :default => :pre_commit
10
+
11
+ desc 'Run Devise tests for all DataMapper 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
+
20
+ desc 'Run Devise tests using DataMapper. Specify path to devise with DEVISE_PATH'
21
+ Rake::TestTask.new(:test) do |test|
22
+ ENV['DEVISE_ORM'] ||= 'data_mapper'
23
+ ENV['DEVISE_PATH'] ||= File.expand_path('../devise')
24
+ unless File.exist?(ENV['DEVISE_PATH'])
25
+ puts "Specify the path to devise (e.g. rake DEVISE_PATH=/path/to/devise). Not found at #{ENV['DEVISE_PATH']}"
26
+ exit
27
+ end
28
+ test.libs << 'lib' << 'test'
29
+ test.libs << "#{ENV['DEVISE_PATH']}/lib"
30
+ test.libs << "#{ENV['DEVISE_PATH']}/test"
31
+ # Need to ensure overrides tests are loaded last
32
+ overrides = ['test/overrides/data_mapper_test.rb']
33
+ overrides += ['test/overrides/dm_validations_test.rb'] if ENV['DEVISE_ORM'] == 'data_mapper'
34
+ test.test_files = FileList["#{ENV['DEVISE_PATH']}/test/**/*_test.rb"] + overrides
35
+ test.verbose = true
36
+ end
37
+
38
+ task :test => :check_dependencies
39
+
40
+ desc 'Generate documentation for dm-devise.'
41
+ Rake::RDocTask.new(:rdoc) do |rdoc|
42
+ rdoc.rdoc_dir = 'rdoc'
43
+ rdoc.title = 'dm-devise #{version}'
44
+ rdoc.options << '--line-numbers' << '--inline-source'
45
+ rdoc.rdoc_files.include('README.rdoc')
46
+ rdoc.rdoc_files.include('lib/**/*.rb')
47
+ end
48
+
49
+ begin
50
+ require 'jeweler'
51
+ Jeweler::Tasks.new do |gem|
52
+ gem.name = "dm-devise"
53
+ gem.version = DataMapper::Devise::VERSION.dup
54
+ gem.summary = %Q{Support for using DataMapper ORM with devise}
55
+ gem.description = %Q{dm-devise adds DataMapper support to devise (http://github.com/plataformatec/devise) for authentication support for Rails}
56
+ gem.email = "jmorgan@morgancreative.net"
57
+ gem.homepage = "http://github.com/jm81/dm-devise"
58
+ gem.authors = ["Jared Morgan"]
59
+ gem.add_dependency 'dm-core', '~> 1.0.0'
60
+ gem.add_dependency 'dm-migrations', '~> 1.0.0'
61
+ gem.add_dependency 'dm-validations', '~> 1.0.0'
62
+ gem.add_dependency 'dm-serializer', '~> 1.0.0'
63
+ gem.add_dependency 'dm-timestamps', '~> 1.0.0'
64
+ gem.add_dependency 'dm-rails', '~> 1.0.0'
65
+ # gem.add_dependency 'devise', '~> 1.1.0'
66
+ gem.add_dependency 'warden', '~> 0.10.7'
67
+ gem.add_dependency 'bcrypt-ruby', '~> 2.1.2'
68
+ # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
69
+ end
70
+ Jeweler::GemcutterTasks.new
71
+ rescue LoadError
72
+ puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
73
+ end