rails3-generators 0.10.3 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.bundle/config +2 -0
- data/CHANGELOG.rdoc +18 -2
- data/README.rdoc +5 -1
- data/Rakefile +5 -2
- data/VERSION +1 -1
- data/lib/generators/{datamapper.rb → data_mapper.rb} +6 -3
- data/lib/generators/{datamapper → data_mapper}/migration/migration_generator.rb +2 -2
- data/lib/generators/{datamapper → data_mapper}/migration/templates/migration.rb +0 -0
- data/lib/generators/{datamapper → data_mapper}/model/model_generator.rb +27 -3
- data/lib/generators/{datamapper → data_mapper}/model/templates/migration.rb +0 -0
- data/lib/generators/{datamapper → data_mapper}/model/templates/model.rb +4 -2
- data/lib/generators/{datamapper → data_mapper}/observer/observer_generator.rb +2 -2
- data/lib/generators/{datamapper → data_mapper}/observer/templates/observer.rb +1 -1
- data/lib/generators/helpers/migration_helper.rb +53 -0
- data/lib/generators/helpers/model_helper.rb +75 -0
- data/lib/generators/jquery/install/install_generator.rb +6 -6
- data/lib/generators/jquery/install/templates/README +10 -0
- data/lib/generators/{mongomapper.rb → mongo_mapper.rb} +3 -24
- data/lib/generators/mongo_mapper/install/install_generator.rb +30 -0
- data/lib/generators/mongo_mapper/install/templates/database.mongo.yml +25 -0
- data/lib/generators/mongo_mapper/install/templates/mongo_mapper.rb +9 -0
- data/lib/generators/mongo_mapper/model/model_generator.rb +84 -0
- data/lib/generators/mongo_mapper/model/templates/model.rb +36 -0
- data/lib/generators/{mongomapper → mongo_mapper}/observer/observer_generator.rb +2 -2
- data/lib/generators/mongo_mapper/observer/templates/observer.rb +3 -0
- data/lib/generators/mongoid.rb +24 -0
- data/lib/generators/mongoid/install/install_generator.rb +35 -0
- data/lib/generators/mongoid/install/templates/database.mongo.yml +25 -0
- data/lib/generators/mongoid/install/templates/mongoid.rb +12 -0
- data/lib/generators/mongoid/model/model_generator.rb +111 -0
- data/lib/generators/{mongomapper → mongoid}/model/templates/model.rb +11 -9
- data/lib/generators/mustache/install/templates/lib/mustache_rails.rb +1 -3
- data/lib/rails3-generators.rb +1 -1
- data/rails3-generators.gemspec +60 -29
- data/test/lib/generators/data_mapper/migration_generator_test.rb +40 -0
- data/test/lib/generators/data_mapper/model_generator_test.rb +53 -0
- data/test/lib/generators/data_mapper/observer_generator_test.rb +22 -0
- data/test/lib/generators/haml/controller_generator_test.rb +1 -0
- data/test/lib/generators/haml/install_generator_test.rb +1 -0
- data/test/lib/generators/haml/scaffold_generator_test.rb +1 -0
- data/test/lib/generators/haml/testing_helper.rb +1 -0
- data/test/lib/generators/jquery/install_generator_test.rb +0 -1
- data/test/lib/generators/mongo_mapper/install_generator_test.rb +17 -0
- data/test/lib/generators/mongo_mapper/model_generator_test.rb +73 -0
- data/test/lib/generators/mongo_mapper/observer_generator_test.rb +20 -0
- data/test/lib/generators/mongo_mapper/testing_helper.rb +1 -0
- data/test/lib/generators/mongoid/install_generator_test.rb +18 -0
- data/test/lib/generators/mongoid/model_generator_test.rb +72 -0
- data/test/lib/generators/mongoid/testing_helper.rb +1 -0
- data/test/lib/generators/mustache/controller_generator_test.rb +1 -0
- data/test/lib/generators/mustache/scaffold_generator_test.rb +1 -0
- data/test/lib/generators/mustache/testing_helper.rb +1 -0
- data/test/test_helper.rb +31 -28
- metadata +61 -30
- data/lib/generators/jquery/install/templates/config/initializers/jquery.rb.tt +0 -9
- data/lib/generators/mongomapper/model/model_generator.rb +0 -29
- data/test/lib/generators/datamapper/migration_generator_test.rb +0 -13
- data/test/lib/generators/datamapper/model_generator_test.rb +0 -13
- data/test/lib/generators/datamapper/observer_generator_test.rb +0 -13
- data/test/lib/generators/mongomapper/model_generator_test.rb +0 -13
- data/test/lib/generators/mongomapper/observer_generator_test.rb +0 -13
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 0
|
7
|
-
-
|
8
|
-
-
|
9
|
-
version: 0.
|
7
|
+
- 11
|
8
|
+
- 0
|
9
|
+
version: 0.11.0
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Jose Valim
|
@@ -18,15 +18,16 @@ authors:
|
|
18
18
|
- Darcy Laycock
|
19
19
|
- Peter Haza
|
20
20
|
- Peter Gumeson
|
21
|
+
- Kristian Mandrup
|
21
22
|
autorequire:
|
22
23
|
bindir: bin
|
23
24
|
cert_chain: []
|
24
25
|
|
25
|
-
date: 2010-07-
|
26
|
+
date: 2010-07-22 00:00:00 -04:00
|
26
27
|
default_executable:
|
27
28
|
dependencies: []
|
28
29
|
|
29
|
-
description: Rails 3 compatible generators for DataMapper, Haml, Factory-girl, Authlogic, Mongomapper, Shoulda, Formtastic and SimpleForm
|
30
|
+
description: Rails 3 compatible generators for DataMapper, Haml, Factory-girl, Authlogic, Mongomapper, Mongoid, Shoulda, Formtastic and SimpleForm
|
30
31
|
email: andre@arko.net
|
31
32
|
executables: []
|
32
33
|
|
@@ -35,6 +36,7 @@ extensions: []
|
|
35
36
|
extra_rdoc_files:
|
36
37
|
- README.rdoc
|
37
38
|
files:
|
39
|
+
- .bundle/config
|
38
40
|
- .gitignore
|
39
41
|
- CHANGELOG.rdoc
|
40
42
|
- Gemfile
|
@@ -44,14 +46,14 @@ files:
|
|
44
46
|
- lib/generators/authlogic.rb
|
45
47
|
- lib/generators/authlogic/session/session_generator.rb
|
46
48
|
- lib/generators/authlogic/session/templates/session.rb
|
47
|
-
- lib/generators/
|
48
|
-
- lib/generators/
|
49
|
-
- lib/generators/
|
50
|
-
- lib/generators/
|
51
|
-
- lib/generators/
|
52
|
-
- lib/generators/
|
53
|
-
- lib/generators/
|
54
|
-
- lib/generators/
|
49
|
+
- lib/generators/data_mapper.rb
|
50
|
+
- lib/generators/data_mapper/migration/migration_generator.rb
|
51
|
+
- lib/generators/data_mapper/migration/templates/migration.rb
|
52
|
+
- lib/generators/data_mapper/model/model_generator.rb
|
53
|
+
- lib/generators/data_mapper/model/templates/migration.rb
|
54
|
+
- lib/generators/data_mapper/model/templates/model.rb
|
55
|
+
- lib/generators/data_mapper/observer/observer_generator.rb
|
56
|
+
- lib/generators/data_mapper/observer/templates/observer.rb
|
55
57
|
- lib/generators/erubis.rb
|
56
58
|
- lib/generators/erubis/controller/controller_generator.rb
|
57
59
|
- lib/generators/erubis/controller/templates/view.html.erb
|
@@ -79,9 +81,11 @@ files:
|
|
79
81
|
- lib/generators/haml/scaffold/templates/index.html.haml.erb
|
80
82
|
- lib/generators/haml/scaffold/templates/new.html.haml.erb
|
81
83
|
- lib/generators/haml/scaffold/templates/show.html.haml.erb
|
84
|
+
- lib/generators/helpers/migration_helper.rb
|
85
|
+
- lib/generators/helpers/model_helper.rb
|
82
86
|
- lib/generators/jquery.rb
|
83
87
|
- lib/generators/jquery/install/install_generator.rb
|
84
|
-
- lib/generators/jquery/install/templates/
|
88
|
+
- lib/generators/jquery/install/templates/README
|
85
89
|
- lib/generators/koala.rb
|
86
90
|
- lib/generators/koala/install/install_generator.rb
|
87
91
|
- lib/generators/koala/install/templates/app/helpers/facebook_helper.rb.tt
|
@@ -91,10 +95,21 @@ files:
|
|
91
95
|
- lib/generators/machinist/model/model_generator.rb
|
92
96
|
- lib/generators/machinist/model/templates/blueprint.rb
|
93
97
|
- lib/generators/machinist/model/templates/machinist_initializer.rb
|
94
|
-
- lib/generators/
|
95
|
-
- lib/generators/
|
96
|
-
- lib/generators/
|
97
|
-
- lib/generators/
|
98
|
+
- lib/generators/mongo_mapper.rb
|
99
|
+
- lib/generators/mongo_mapper/.DS_Store
|
100
|
+
- lib/generators/mongo_mapper/install/install_generator.rb
|
101
|
+
- lib/generators/mongo_mapper/install/templates/database.mongo.yml
|
102
|
+
- lib/generators/mongo_mapper/install/templates/mongo_mapper.rb
|
103
|
+
- lib/generators/mongo_mapper/model/model_generator.rb
|
104
|
+
- lib/generators/mongo_mapper/model/templates/model.rb
|
105
|
+
- lib/generators/mongo_mapper/observer/observer_generator.rb
|
106
|
+
- lib/generators/mongo_mapper/observer/templates/observer.rb
|
107
|
+
- lib/generators/mongoid.rb
|
108
|
+
- lib/generators/mongoid/install/install_generator.rb
|
109
|
+
- lib/generators/mongoid/install/templates/database.mongo.yml
|
110
|
+
- lib/generators/mongoid/install/templates/mongoid.rb
|
111
|
+
- lib/generators/mongoid/model/model_generator.rb
|
112
|
+
- lib/generators/mongoid/model/templates/model.rb
|
98
113
|
- lib/generators/mustache.rb
|
99
114
|
- lib/generators/mustache/README.md
|
100
115
|
- lib/generators/mustache/controller/controller_generator.rb
|
@@ -126,9 +141,9 @@ files:
|
|
126
141
|
- rails3-generators.gemspec
|
127
142
|
- test/fixtures/routes.rb
|
128
143
|
- test/lib/generators/authlogic/session_generator_test.rb
|
129
|
-
- test/lib/generators/
|
130
|
-
- test/lib/generators/
|
131
|
-
- test/lib/generators/
|
144
|
+
- test/lib/generators/data_mapper/migration_generator_test.rb
|
145
|
+
- test/lib/generators/data_mapper/model_generator_test.rb
|
146
|
+
- test/lib/generators/data_mapper/observer_generator_test.rb
|
132
147
|
- test/lib/generators/erubis/controller_generator_test.rb
|
133
148
|
- test/lib/generators/erubis/scaffold_generator_test.rb
|
134
149
|
- test/lib/generators/factory_girl/model_generator_test.rb
|
@@ -136,13 +151,20 @@ files:
|
|
136
151
|
- test/lib/generators/haml/controller_generator_test.rb
|
137
152
|
- test/lib/generators/haml/install_generator_test.rb
|
138
153
|
- test/lib/generators/haml/scaffold_generator_test.rb
|
154
|
+
- test/lib/generators/haml/testing_helper.rb
|
139
155
|
- test/lib/generators/jquery/install_generator_test.rb
|
140
156
|
- test/lib/generators/koala/install_generator_test.rb
|
141
157
|
- test/lib/generators/machinist/model_generator_test.rb
|
142
|
-
- test/lib/generators/
|
143
|
-
- test/lib/generators/
|
158
|
+
- test/lib/generators/mongo_mapper/install_generator_test.rb
|
159
|
+
- test/lib/generators/mongo_mapper/model_generator_test.rb
|
160
|
+
- test/lib/generators/mongo_mapper/observer_generator_test.rb
|
161
|
+
- test/lib/generators/mongo_mapper/testing_helper.rb
|
162
|
+
- test/lib/generators/mongoid/install_generator_test.rb
|
163
|
+
- test/lib/generators/mongoid/model_generator_test.rb
|
164
|
+
- test/lib/generators/mongoid/testing_helper.rb
|
144
165
|
- test/lib/generators/mustache/controller_generator_test.rb
|
145
166
|
- test/lib/generators/mustache/scaffold_generator_test.rb
|
167
|
+
- test/lib/generators/mustache/testing_helper.rb
|
146
168
|
- test/lib/generators/shoulda/controller_generator_test.rb
|
147
169
|
- test/lib/generators/simple_form/scaffold_generators_test.rb
|
148
170
|
- test/test_helper.rb
|
@@ -151,9 +173,11 @@ homepage: http://github.com/indirect/rails3-generators
|
|
151
173
|
licenses: []
|
152
174
|
|
153
175
|
post_install_message: "\n\
|
154
|
-
rails3-generators-0.
|
176
|
+
rails3-generators-0.11.0\n\n\
|
155
177
|
Be sure to check out the wiki, http://wiki.github.com/indirect/rails3-generators/,\n\
|
156
|
-
for information about recent changes to this project.\n\n\
|
178
|
+
for information about recent changes to this project.\n \n\
|
179
|
+
note: ORM :datamapper has been renamed to :data_mapper\n\
|
180
|
+
note: ORM :mongomapper has been renamed to :mongo_mapper\n\n\
|
157
181
|
note: if you use erb templates add the follow to your generators block to take full advantage of this gem.\n\
|
158
182
|
g.template_engine :erubis\n\n"
|
159
183
|
rdoc_options:
|
@@ -186,9 +210,9 @@ summary: Rails 3 compatible generators
|
|
186
210
|
test_files:
|
187
211
|
- test/fixtures/routes.rb
|
188
212
|
- test/lib/generators/authlogic/session_generator_test.rb
|
189
|
-
- test/lib/generators/
|
190
|
-
- test/lib/generators/
|
191
|
-
- test/lib/generators/
|
213
|
+
- test/lib/generators/data_mapper/migration_generator_test.rb
|
214
|
+
- test/lib/generators/data_mapper/model_generator_test.rb
|
215
|
+
- test/lib/generators/data_mapper/observer_generator_test.rb
|
192
216
|
- test/lib/generators/erubis/controller_generator_test.rb
|
193
217
|
- test/lib/generators/erubis/scaffold_generator_test.rb
|
194
218
|
- test/lib/generators/factory_girl/model_generator_test.rb
|
@@ -196,13 +220,20 @@ test_files:
|
|
196
220
|
- test/lib/generators/haml/controller_generator_test.rb
|
197
221
|
- test/lib/generators/haml/install_generator_test.rb
|
198
222
|
- test/lib/generators/haml/scaffold_generator_test.rb
|
223
|
+
- test/lib/generators/haml/testing_helper.rb
|
199
224
|
- test/lib/generators/jquery/install_generator_test.rb
|
200
225
|
- test/lib/generators/koala/install_generator_test.rb
|
201
226
|
- test/lib/generators/machinist/model_generator_test.rb
|
202
|
-
- test/lib/generators/
|
203
|
-
- test/lib/generators/
|
227
|
+
- test/lib/generators/mongo_mapper/install_generator_test.rb
|
228
|
+
- test/lib/generators/mongo_mapper/model_generator_test.rb
|
229
|
+
- test/lib/generators/mongo_mapper/observer_generator_test.rb
|
230
|
+
- test/lib/generators/mongo_mapper/testing_helper.rb
|
231
|
+
- test/lib/generators/mongoid/install_generator_test.rb
|
232
|
+
- test/lib/generators/mongoid/model_generator_test.rb
|
233
|
+
- test/lib/generators/mongoid/testing_helper.rb
|
204
234
|
- test/lib/generators/mustache/controller_generator_test.rb
|
205
235
|
- test/lib/generators/mustache/scaffold_generator_test.rb
|
236
|
+
- test/lib/generators/mustache/testing_helper.rb
|
206
237
|
- test/lib/generators/shoulda/controller_generator_test.rb
|
207
238
|
- test/lib/generators/simple_form/scaffold_generators_test.rb
|
208
239
|
- test/test_helper.rb
|
@@ -1,9 +0,0 @@
|
|
1
|
-
# Switch the javascript_include_tag :defaults to use jQuery instead of
|
2
|
-
# the default prototype helpers.
|
3
|
-
# Credits: http://github.com/lleger/Rails-3-jQuery/
|
4
|
-
|
5
|
-
if ActionView::Helpers::AssetTagHelper.const_defined?(:JAVASCRIPT_DEFAULT_SOURCES)
|
6
|
-
ActionView::Helpers::AssetTagHelper.send(:remove_const, "JAVASCRIPT_DEFAULT_SOURCES")
|
7
|
-
end
|
8
|
-
ActionView::Helpers::AssetTagHelper::JAVASCRIPT_DEFAULT_SOURCES = ['jquery', 'rails']
|
9
|
-
ActionView::Helpers::AssetTagHelper::reset_javascript_include_default
|
@@ -1,29 +0,0 @@
|
|
1
|
-
require 'generators/mongomapper'
|
2
|
-
|
3
|
-
module Mongomapper
|
4
|
-
module Generators
|
5
|
-
class ModelGenerator < Base
|
6
|
-
argument :attributes, :type => :array, :default => [], :banner => "field:type field:type"
|
7
|
-
# class_option :_id, :type => :numeric, :desc => "The id to used in the migration"
|
8
|
-
|
9
|
-
check_class_collision
|
10
|
-
|
11
|
-
# class_option :migration, :type => :boolean
|
12
|
-
class_option :timestamps, :type => :boolean
|
13
|
-
class_option :parent, :type => :string, :desc => "The parent class for the generated model"
|
14
|
-
|
15
|
-
# def create_migration_file
|
16
|
-
# if options[:migration] && options[:parent].nil?
|
17
|
-
# file_name = "create_#{file_path.gsub(/\//, '_').pluralize}"
|
18
|
-
# migration_template "migration.rb", "db/migrate/#{file_name}.rb"
|
19
|
-
# end
|
20
|
-
# end
|
21
|
-
|
22
|
-
def create_model_file
|
23
|
-
template 'model.rb', File.join('app/models', class_path, "#{file_name}.rb")
|
24
|
-
end
|
25
|
-
|
26
|
-
hook_for :test_framework
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class Datamapper::Generators::MigrationGeneratorTest < Rails::Generators::TestCase
|
4
|
-
destination File.join(Rails.root)
|
5
|
-
tests Datamapper::Generators::MigrationGenerator
|
6
|
-
|
7
|
-
setup :prepare_destination
|
8
|
-
setup :copy_routes
|
9
|
-
|
10
|
-
test "invoke" do
|
11
|
-
flunk "I don't use Datamapper. If you use it please add tests."
|
12
|
-
end
|
13
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class Datamapper::Generators::ModelGeneratorTest < Rails::Generators::TestCase
|
4
|
-
destination File.join(Rails.root)
|
5
|
-
tests Datamapper::Generators::ModelGenerator
|
6
|
-
|
7
|
-
setup :prepare_destination
|
8
|
-
setup :copy_routes
|
9
|
-
|
10
|
-
test "invoke" do
|
11
|
-
flunk "I don't use Datamapper. If you use it please add tests."
|
12
|
-
end
|
13
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class Datamapper::Generators::ObserverGeneratorTest < Rails::Generators::TestCase
|
4
|
-
destination File.join(Rails.root)
|
5
|
-
tests Datamapper::Generators::ObserverGenerator
|
6
|
-
|
7
|
-
setup :prepare_destination
|
8
|
-
setup :copy_routes
|
9
|
-
|
10
|
-
test "invoke" do
|
11
|
-
flunk "I don't use Datamapper. If you use it please add tests."
|
12
|
-
end
|
13
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class Mongomapper::Generators::ModelGeneratorTest < Rails::Generators::TestCase
|
4
|
-
destination File.join(Rails.root)
|
5
|
-
tests Mongomapper::Generators::ModelGenerator
|
6
|
-
|
7
|
-
setup :prepare_destination
|
8
|
-
setup :copy_routes
|
9
|
-
|
10
|
-
test "invoke" do
|
11
|
-
flunk "I don't use Mongomapper. If you use it please add tests."
|
12
|
-
end
|
13
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class Mongomapper::Generators::ObserverGeneratorTest < Rails::Generators::TestCase
|
4
|
-
destination File.join(Rails.root)
|
5
|
-
tests Mongomapper::Generators::ObserverGenerator
|
6
|
-
|
7
|
-
setup :prepare_destination
|
8
|
-
setup :copy_routes
|
9
|
-
|
10
|
-
test "invoke" do
|
11
|
-
flunk "I don't use Mongomapper. If you use it please add tests."
|
12
|
-
end
|
13
|
-
end
|