trusty-cms 4.1.8 → 4.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +70 -73
- data/INSTALL.md +2 -0
- data/config/environments/development.rb +2 -0
- data/lib/generators/extension/USAGE +30 -0
- data/lib/generators/extension/extension_generator.rb +97 -0
- data/lib/generators/extension/templates/README.md +6 -0
- data/lib/generators/extension/templates/RSpecRakefile +109 -0
- data/lib/generators/extension/templates/Rakefile +25 -0
- data/lib/generators/extension/templates/cucumber.yml +1 -0
- data/lib/generators/extension/templates/cucumber_env.rb +11 -0
- data/lib/generators/extension/templates/cucumber_paths.rb +22 -0
- data/lib/generators/extension/templates/en.yml +3 -0
- data/lib/generators/extension/templates/extension.rb +21 -0
- data/lib/generators/extension/templates/functional_test.rb +15 -0
- data/lib/generators/extension/templates/gemspec.rb +29 -0
- data/lib/generators/extension/templates/lib.rb +8 -0
- data/lib/generators/extension/templates/migration.rb +9 -0
- data/lib/generators/extension/templates/radiant_config.rb +3 -0
- data/lib/generators/extension/templates/routes.rb +5 -0
- data/lib/generators/extension/templates/spec.opts +6 -0
- data/lib/generators/extension/templates/spec_helper.rb +42 -0
- data/lib/generators/extension/templates/tasks.rake +47 -0
- data/lib/generators/extension/templates/test_helper.rb +26 -0
- data/lib/generators/extension_controller/USAGE +36 -0
- data/lib/generators/extension_controller/extension_controller_generator.rb +84 -0
- data/lib/generators/extension_controller/templates/controller.rb +10 -0
- data/lib/generators/extension_controller/templates/controller_spec.rb +23 -0
- data/lib/generators/extension_controller/templates/functional_test.rb +11 -0
- data/lib/generators/extension_controller/templates/helper.rb +2 -0
- data/lib/generators/extension_controller/templates/helper_spec.rb +11 -0
- data/lib/generators/extension_controller/templates/helper_test.rb +4 -0
- data/lib/generators/extension_controller/templates/view.html.erb +2 -0
- data/lib/generators/extension_controller/templates/view_spec.rb +12 -0
- data/lib/generators/extension_mailer/USAGE +17 -0
- data/lib/generators/extension_mailer/extension_mailer_generator.rb +68 -0
- data/lib/generators/extension_mailer/templates/fixture.erb +3 -0
- data/lib/generators/extension_mailer/templates/mailer.rb +15 -0
- data/lib/generators/extension_mailer/templates/unit_test.rb +21 -0
- data/lib/generators/extension_mailer/templates/view.erb +3 -0
- data/lib/generators/extension_migration/USAGE +34 -0
- data/lib/generators/extension_migration/extension_migration_generator.rb +25 -0
- data/lib/generators/extension_migration/templates/migration.rb +11 -0
- data/lib/generators/extension_model/USAGE +35 -0
- data/lib/generators/extension_model/extension_model_generator.rb +68 -0
- data/lib/generators/extension_model/templates/fixtures.yml +19 -0
- data/lib/generators/extension_model/templates/migration.rb +16 -0
- data/lib/generators/extension_model/templates/model.rb +2 -0
- data/lib/generators/extension_model/templates/model_spec.rb +11 -0
- data/lib/generators/extension_model/templates/unit_test.rb +8 -0
- data/lib/generators/generator_base_extension.rb +18 -0
- data/lib/generators/instance/instance_generator.rb +148 -0
- data/lib/generators/instance/templates/databases/db2.yml +40 -0
- data/lib/generators/instance/templates/databases/mysql.yml +47 -0
- data/lib/generators/instance/templates/databases/postgresql.yml +44 -0
- data/lib/generators/instance/templates/databases/sqlite3.yml +16 -0
- data/lib/generators/instance/templates/databases/sqlserver.yml +21 -0
- data/lib/generators/instance/templates/instance_boot.rb +122 -0
- data/lib/generators/instance/templates/instance_config.ru +2 -0
- data/lib/generators/instance/templates/instance_environment.rb +93 -0
- data/lib/generators/instance/templates/instance_gemfile +78 -0
- data/lib/generators/instance/templates/instance_generate +6 -0
- data/lib/generators/instance/templates/instance_radiant_config.rb +16 -0
- data/lib/generators/instance/templates/instance_rakefile +3 -0
- data/lib/generators/instance/templates/instance_routes.rb +1 -0
- data/lib/generators/language_extension/USAGE +27 -0
- data/lib/generators/language_extension/language_extension_generator.rb +71 -0
- data/lib/generators/language_extension/templates/README +3 -0
- data/lib/generators/language_extension/templates/RSpecRakefile +123 -0
- data/lib/generators/language_extension/templates/Rakefile +25 -0
- data/lib/generators/language_extension/templates/available_tags.yml +553 -0
- data/lib/generators/language_extension/templates/cucumber.yml +1 -0
- data/lib/generators/language_extension/templates/cucumber_env.rb +16 -0
- data/lib/generators/language_extension/templates/cucumber_paths.rb +14 -0
- data/lib/generators/language_extension/templates/extension.rb +12 -0
- data/lib/generators/language_extension/templates/functional_test.rb +15 -0
- data/lib/generators/language_extension/templates/gemspec.rb +24 -0
- data/lib/generators/language_extension/templates/lang.yml +181 -0
- data/lib/generators/language_extension/templates/lib.rb +8 -0
- data/lib/generators/language_extension/templates/spec.opts +6 -0
- data/lib/generators/language_extension/templates/spec_helper.rb +36 -0
- data/lib/generators/language_extension/templates/tasks.rake +28 -0
- data/lib/generators/language_extension/templates/test_helper.rb +26 -0
- data/lib/generators/trusty_cms/USAGE +8 -0
- data/lib/generators/trusty_cms/templates/Rakefile.erb +7 -0
- data/lib/generators/trusty_cms/templates/application.rb.erb +149 -0
- data/lib/generators/trusty_cms/templates/boot.rb.erb +9 -0
- data/lib/generators/trusty_cms/templates/config.ru.erb +4 -0
- data/lib/generators/trusty_cms/templates/database.yml.erb +28 -0
- data/lib/generators/trusty_cms/templates/environment.rb.erb +5 -0
- data/lib/generators/trusty_cms/templates/environments/development.rb.erb +24 -0
- data/lib/generators/trusty_cms/templates/environments/production.rb.erb +26 -0
- data/lib/generators/trusty_cms/templates/environments/test.rb.erb +35 -0
- data/lib/generators/trusty_cms/templates/initializers/secret_token.rb.erb +13 -0
- data/lib/generators/trusty_cms/templates/initializers/session_store.rb.erb +8 -0
- data/lib/generators/trusty_cms/templates/initializers/trusty_cms_config.rb.erb +16 -0
- data/lib/generators/trusty_cms/templates/preinitializer.rb.erb +18 -0
- data/lib/generators/trusty_cms/templates/routes.rb.erb +0 -0
- data/lib/generators/trusty_cms/trusty_cms_generator.rb +32 -0
- data/lib/trusty_cms.rb +1 -1
- data/lib/trusty_cms/setup.rb +7 -7
- metadata +131 -60
- data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/core.js +0 -126
- data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/failsafe/index.js +0 -4
- data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/failsafe/map.js +0 -56
- data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/failsafe/seq.js +0 -43
- data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/failsafe/string.js +0 -28
- data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/index.js +0 -36
- data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/json.js +0 -76
- data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/options.js +0 -23
- data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/yaml-1.1/binary.js +0 -87
- data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/yaml-1.1/index.js +0 -157
- data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/yaml-1.1/omap.js +0 -142
- data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/yaml-1.1/pairs.js +0 -81
- data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/yaml-1.1/set.js +0 -114
- data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/yaml-1.1/timestamp.js +0 -97
- data/spec/spec/dummy/node_modules/yaml/dist/tags/core.js +0 -114
- data/spec/spec/dummy/node_modules/yaml/dist/tags/failsafe/index.js +0 -17
- data/spec/spec/dummy/node_modules/yaml/dist/tags/failsafe/map.js +0 -37
- data/spec/spec/dummy/node_modules/yaml/dist/tags/failsafe/seq.js +0 -34
- data/spec/spec/dummy/node_modules/yaml/dist/tags/failsafe/string.js +0 -40
- data/spec/spec/dummy/node_modules/yaml/dist/tags/index.js +0 -62
- data/spec/spec/dummy/node_modules/yaml/dist/tags/json.js +0 -60
- data/spec/spec/dummy/node_modules/yaml/dist/tags/options.js +0 -35
- data/spec/spec/dummy/node_modules/yaml/dist/tags/yaml-1.1/binary.js +0 -97
- data/spec/spec/dummy/node_modules/yaml/dist/tags/yaml-1.1/index.js +0 -131
- data/spec/spec/dummy/node_modules/yaml/dist/tags/yaml-1.1/omap.js +0 -105
- data/spec/spec/dummy/node_modules/yaml/dist/tags/yaml-1.1/pairs.js +0 -80
- data/spec/spec/dummy/node_modules/yaml/dist/tags/yaml-1.1/set.js +0 -91
- data/spec/spec/dummy/node_modules/yaml/dist/tags/yaml-1.1/timestamp.js +0 -93
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4fb05c8f28c0097f216371ee9b64551430ef41f134939c45db99af078f16a909
|
4
|
+
data.tar.gz: a774319265c2377af1242e05337c59e5310188f7259330adcf56e138407c9a32
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b77c5e66a0793e654d506cf7b07fda3e04b90869e515e181e6a96c42659e65876d2dfe0d436f8ef6aa8bd1a14cbfa1136f0a21a92a99912edaefb8d545c76885
|
7
|
+
data.tar.gz: 0eee0cbdcc348c0ea3a5c9167c7622eba56a88ebf02d3430ba31b92020e780da3889f01179bcc07ff235f8fa2ea6a47d2ffd99189c4a431b779d69866a420de5
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
trusty-cms (4.1.
|
4
|
+
trusty-cms (4.1.9)
|
5
5
|
RedCloth (= 4.3.2)
|
6
6
|
acts_as_list (>= 0.9.5, < 1.1.0)
|
7
7
|
acts_as_tree (>= 2.6.1, < 2.9.0)
|
@@ -34,65 +34,61 @@ GEM
|
|
34
34
|
remote: https://rubygems.org/
|
35
35
|
specs:
|
36
36
|
RedCloth (4.3.2)
|
37
|
-
actioncable (6.
|
38
|
-
actionpack (= 6.
|
39
|
-
activesupport (= 6.1.0)
|
37
|
+
actioncable (6.0.3.4)
|
38
|
+
actionpack (= 6.0.3.4)
|
40
39
|
nio4r (~> 2.0)
|
41
40
|
websocket-driver (>= 0.6.1)
|
42
|
-
actionmailbox (6.
|
43
|
-
actionpack (= 6.
|
44
|
-
activejob (= 6.
|
45
|
-
activerecord (= 6.
|
46
|
-
activestorage (= 6.
|
47
|
-
activesupport (= 6.
|
41
|
+
actionmailbox (6.0.3.4)
|
42
|
+
actionpack (= 6.0.3.4)
|
43
|
+
activejob (= 6.0.3.4)
|
44
|
+
activerecord (= 6.0.3.4)
|
45
|
+
activestorage (= 6.0.3.4)
|
46
|
+
activesupport (= 6.0.3.4)
|
48
47
|
mail (>= 2.7.1)
|
49
|
-
actionmailer (6.
|
50
|
-
actionpack (= 6.
|
51
|
-
actionview (= 6.
|
52
|
-
activejob (= 6.
|
53
|
-
activesupport (= 6.1.0)
|
48
|
+
actionmailer (6.0.3.4)
|
49
|
+
actionpack (= 6.0.3.4)
|
50
|
+
actionview (= 6.0.3.4)
|
51
|
+
activejob (= 6.0.3.4)
|
54
52
|
mail (~> 2.5, >= 2.5.4)
|
55
53
|
rails-dom-testing (~> 2.0)
|
56
|
-
actionpack (6.
|
57
|
-
actionview (= 6.
|
58
|
-
activesupport (= 6.
|
59
|
-
rack (~> 2.0, >= 2.0.
|
54
|
+
actionpack (6.0.3.4)
|
55
|
+
actionview (= 6.0.3.4)
|
56
|
+
activesupport (= 6.0.3.4)
|
57
|
+
rack (~> 2.0, >= 2.0.8)
|
60
58
|
rack-test (>= 0.6.3)
|
61
59
|
rails-dom-testing (~> 2.0)
|
62
60
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
63
|
-
actiontext (6.
|
64
|
-
actionpack (= 6.
|
65
|
-
activerecord (= 6.
|
66
|
-
activestorage (= 6.
|
67
|
-
activesupport (= 6.
|
61
|
+
actiontext (6.0.3.4)
|
62
|
+
actionpack (= 6.0.3.4)
|
63
|
+
activerecord (= 6.0.3.4)
|
64
|
+
activestorage (= 6.0.3.4)
|
65
|
+
activesupport (= 6.0.3.4)
|
68
66
|
nokogiri (>= 1.8.5)
|
69
|
-
actionview (6.
|
70
|
-
activesupport (= 6.
|
67
|
+
actionview (6.0.3.4)
|
68
|
+
activesupport (= 6.0.3.4)
|
71
69
|
builder (~> 3.1)
|
72
70
|
erubi (~> 1.4)
|
73
71
|
rails-dom-testing (~> 2.0)
|
74
72
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
75
|
-
activejob (6.
|
76
|
-
activesupport (= 6.
|
73
|
+
activejob (6.0.3.4)
|
74
|
+
activesupport (= 6.0.3.4)
|
77
75
|
globalid (>= 0.3.6)
|
78
|
-
activemodel (6.
|
79
|
-
activesupport (= 6.
|
80
|
-
activerecord (6.
|
81
|
-
activemodel (= 6.
|
82
|
-
activesupport (= 6.
|
83
|
-
activestorage (6.
|
84
|
-
actionpack (= 6.
|
85
|
-
activejob (= 6.
|
86
|
-
activerecord (= 6.
|
87
|
-
activesupport (= 6.1.0)
|
76
|
+
activemodel (6.0.3.4)
|
77
|
+
activesupport (= 6.0.3.4)
|
78
|
+
activerecord (6.0.3.4)
|
79
|
+
activemodel (= 6.0.3.4)
|
80
|
+
activesupport (= 6.0.3.4)
|
81
|
+
activestorage (6.0.3.4)
|
82
|
+
actionpack (= 6.0.3.4)
|
83
|
+
activejob (= 6.0.3.4)
|
84
|
+
activerecord (= 6.0.3.4)
|
88
85
|
marcel (~> 0.3.1)
|
89
|
-
|
90
|
-
activesupport (6.1.0)
|
86
|
+
activesupport (6.0.3.4)
|
91
87
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
92
|
-
i18n (>=
|
93
|
-
minitest (
|
94
|
-
tzinfo (~>
|
95
|
-
zeitwerk (~> 2.
|
88
|
+
i18n (>= 0.7, < 2)
|
89
|
+
minitest (~> 5.1)
|
90
|
+
tzinfo (~> 1.1)
|
91
|
+
zeitwerk (~> 2.2, >= 2.2.2)
|
96
92
|
acts_as_list (1.0.3)
|
97
93
|
activerecord (>= 4.2)
|
98
94
|
acts_as_tree (2.8.0)
|
@@ -102,7 +98,7 @@ GEM
|
|
102
98
|
bcrypt (3.1.16)
|
103
99
|
builder (3.2.4)
|
104
100
|
byebug (11.1.3)
|
105
|
-
capybara (3.
|
101
|
+
capybara (3.34.0)
|
106
102
|
addressable
|
107
103
|
mini_mime (>= 0.1.3)
|
108
104
|
nokogiri (~> 1.8)
|
@@ -132,7 +128,7 @@ GEM
|
|
132
128
|
responders
|
133
129
|
warden (~> 1.2.3)
|
134
130
|
diff-lcs (1.4.4)
|
135
|
-
docile (1.3.
|
131
|
+
docile (1.3.4)
|
136
132
|
erubi (1.10.0)
|
137
133
|
erubis (2.7.0)
|
138
134
|
execjs (2.7.0)
|
@@ -172,7 +168,7 @@ GEM
|
|
172
168
|
multipart-post
|
173
169
|
launchy (2.5.0)
|
174
170
|
addressable (~> 2.7)
|
175
|
-
libv8 (8.4.255.0
|
171
|
+
libv8 (8.4.255.0)
|
176
172
|
loofah (2.8.0)
|
177
173
|
crass (~> 1.0.2)
|
178
174
|
nokogiri (>= 1.5.9)
|
@@ -189,12 +185,12 @@ GEM
|
|
189
185
|
mini_portile2 (2.5.0)
|
190
186
|
mini_racer (0.3.1)
|
191
187
|
libv8 (~> 8.4.255)
|
192
|
-
minitest (5.14.
|
188
|
+
minitest (5.14.3)
|
193
189
|
multi_xml (0.6.0)
|
194
190
|
multipart-post (2.1.1)
|
195
191
|
mysql2 (0.5.3)
|
196
192
|
nio4r (2.5.4)
|
197
|
-
nokogiri (1.11.
|
193
|
+
nokogiri (1.11.1)
|
198
194
|
mini_portile2 (~> 2.5.0)
|
199
195
|
racc (~> 1.4)
|
200
196
|
orm_adapter (0.5.0)
|
@@ -222,20 +218,20 @@ GEM
|
|
222
218
|
rack-test (1.1.0)
|
223
219
|
rack (>= 1.0, < 3)
|
224
220
|
radius (0.7.5)
|
225
|
-
rails (6.
|
226
|
-
actioncable (= 6.
|
227
|
-
actionmailbox (= 6.
|
228
|
-
actionmailer (= 6.
|
229
|
-
actionpack (= 6.
|
230
|
-
actiontext (= 6.
|
231
|
-
actionview (= 6.
|
232
|
-
activejob (= 6.
|
233
|
-
activemodel (= 6.
|
234
|
-
activerecord (= 6.
|
235
|
-
activestorage (= 6.
|
236
|
-
activesupport (= 6.
|
237
|
-
bundler (>= 1.
|
238
|
-
railties (= 6.
|
221
|
+
rails (6.0.3.4)
|
222
|
+
actioncable (= 6.0.3.4)
|
223
|
+
actionmailbox (= 6.0.3.4)
|
224
|
+
actionmailer (= 6.0.3.4)
|
225
|
+
actionpack (= 6.0.3.4)
|
226
|
+
actiontext (= 6.0.3.4)
|
227
|
+
actionview (= 6.0.3.4)
|
228
|
+
activejob (= 6.0.3.4)
|
229
|
+
activemodel (= 6.0.3.4)
|
230
|
+
activerecord (= 6.0.3.4)
|
231
|
+
activestorage (= 6.0.3.4)
|
232
|
+
activesupport (= 6.0.3.4)
|
233
|
+
bundler (>= 1.3.0)
|
234
|
+
railties (= 6.0.3.4)
|
239
235
|
sprockets-rails (>= 2.0.0)
|
240
236
|
rails-dom-testing (2.0.3)
|
241
237
|
activesupport (>= 4.2.0)
|
@@ -244,15 +240,15 @@ GEM
|
|
244
240
|
loofah (~> 2.3)
|
245
241
|
rails-observers (0.1.5)
|
246
242
|
activemodel (>= 4.0)
|
247
|
-
railties (6.
|
248
|
-
actionpack (= 6.
|
249
|
-
activesupport (= 6.
|
243
|
+
railties (6.0.3.4)
|
244
|
+
actionpack (= 6.0.3.4)
|
245
|
+
activesupport (= 6.0.3.4)
|
250
246
|
method_source
|
251
247
|
rake (>= 0.8.7)
|
252
|
-
thor (
|
248
|
+
thor (>= 0.20.3, < 2.0)
|
253
249
|
rake (13.0.3)
|
254
250
|
rdoc (6.3.0)
|
255
|
-
regexp_parser (1.
|
251
|
+
regexp_parser (1.8.2)
|
256
252
|
responders (3.0.1)
|
257
253
|
actionpack (>= 5.0)
|
258
254
|
railties (>= 5.0)
|
@@ -279,7 +275,7 @@ GEM
|
|
279
275
|
rspec-mocks (~> 3.10)
|
280
276
|
rspec-support (~> 3.10)
|
281
277
|
rspec-support (3.10.1)
|
282
|
-
ruby_parser (3.15.
|
278
|
+
ruby_parser (3.15.1)
|
283
279
|
sexp_processor (~> 4.9)
|
284
280
|
sassc (2.4.0)
|
285
281
|
ffi (~> 1.9)
|
@@ -289,8 +285,8 @@ GEM
|
|
289
285
|
sprockets (> 3.0)
|
290
286
|
sprockets-rails
|
291
287
|
tilt
|
292
|
-
sexp_processor (4.15.
|
293
|
-
simplecov (0.
|
288
|
+
sexp_processor (4.15.2)
|
289
|
+
simplecov (0.21.2)
|
294
290
|
docile (~> 1.1)
|
295
291
|
simplecov-html (~> 0.11)
|
296
292
|
simplecov_json_formatter (~> 0.1)
|
@@ -308,11 +304,12 @@ GEM
|
|
308
304
|
terrapin (0.6.0)
|
309
305
|
climate_control (>= 0.0.3, < 1.0)
|
310
306
|
thor (1.0.1)
|
307
|
+
thread_safe (0.3.6)
|
311
308
|
tilt (2.0.10)
|
312
309
|
trustygems (0.2.1)
|
313
310
|
rake
|
314
|
-
tzinfo (2.
|
315
|
-
|
311
|
+
tzinfo (1.2.9)
|
312
|
+
thread_safe (~> 0.1)
|
316
313
|
uglifier (4.2.0)
|
317
314
|
execjs (>= 0.3.0, < 3)
|
318
315
|
uuidtools (2.2.0)
|
data/INSTALL.md
CHANGED
@@ -15,4 +15,6 @@ From within the directory containing your TrustyCMS instance:
|
|
15
15
|
|
16
16
|
5. add config.extensions = [ :snippets, :clipped, :layouts, :multi_site ] to enable them in application.rb
|
17
17
|
|
18
|
+
7. Add utf8 encoding to your db.yml
|
19
|
+
|
18
20
|
6. Run `bundle exec rake db:setup`, `bundle exec rake trusty_cms_engine:install:migrations`, then `bundle exec rake db:bootstrap`.
|
@@ -0,0 +1,30 @@
|
|
1
|
+
Description:
|
2
|
+
The extension generator creates stubs for a new TrustyCms extension.
|
3
|
+
|
4
|
+
The generator takes an extension name as its argument. The extension name may be
|
5
|
+
given in CamelCase or under_score and should not be suffixed with 'Extension'.
|
6
|
+
|
7
|
+
The generator creates an extension directory in vendor/extensions that includes
|
8
|
+
<extension_name>_extension.rb, README and Rakefile files as well as db, lib, task,
|
9
|
+
and test directories.
|
10
|
+
|
11
|
+
Example:
|
12
|
+
./script/generate extension AssetManagement
|
13
|
+
|
14
|
+
This will create:
|
15
|
+
vendor/extensions/asset_management/app/controllers
|
16
|
+
vendor/extensions/asset_management/app/helpers
|
17
|
+
vendor/extensions/asset_management/app/models
|
18
|
+
vendor/extensions/asset_management/app/views
|
19
|
+
vendor/extensions/asset_management/db/migrate
|
20
|
+
vendor/extensions/asset_management/lib/tasks
|
21
|
+
vendor/extensions/asset_management/README
|
22
|
+
vendor/extensions/asset_management/asset_management_extension.rb
|
23
|
+
vendor/extensions/asset_management/lib/tasks/asset_management_extension_tasks.rake
|
24
|
+
vendor/extensions/asset_management/spec/controllers
|
25
|
+
vendor/extensions/asset_management/spec/models
|
26
|
+
vendor/extensions/asset_management/spec/views
|
27
|
+
vendor/extensions/asset_management/spec/helpers
|
28
|
+
vendor/extensions/asset_management/Rakefile
|
29
|
+
vendor/extensions/asset_management/spec/spec_helper.rb
|
30
|
+
vendor/extensions/asset_management/spec/spec.opts
|
@@ -0,0 +1,97 @@
|
|
1
|
+
begin
|
2
|
+
require 'git'
|
3
|
+
rescue LoadError
|
4
|
+
end
|
5
|
+
|
6
|
+
class ExtensionGenerator < Rails::Generator::NamedBase
|
7
|
+
default_options :with_test_unit => false
|
8
|
+
|
9
|
+
attr_reader :extension_path, :extension_file_name
|
10
|
+
|
11
|
+
def initialize(runtime_args, runtime_options = {})
|
12
|
+
super
|
13
|
+
@extension_file_name = "#{file_name}_extension"
|
14
|
+
@extension_path = "vendor/extensions/#{file_name}"
|
15
|
+
end
|
16
|
+
|
17
|
+
def manifest
|
18
|
+
record do |m|
|
19
|
+
m.directory "#{extension_path}/app/controllers"
|
20
|
+
m.directory "#{extension_path}/app/helpers"
|
21
|
+
m.directory "#{extension_path}/app/models"
|
22
|
+
m.directory "#{extension_path}/app/views"
|
23
|
+
m.directory "#{extension_path}/config/locales"
|
24
|
+
m.directory "#{extension_path}/config/initializers"
|
25
|
+
m.directory "#{extension_path}/db/migrate"
|
26
|
+
m.directory "#{extension_path}/lib/tasks"
|
27
|
+
|
28
|
+
m.template 'README.md', "#{extension_path}/README.md"
|
29
|
+
m.template 'extension.rb', "#{extension_path}/#{extension_file_name}.rb"
|
30
|
+
m.template 'tasks.rake', "#{extension_path}/lib/tasks/#{extension_file_name}_tasks.rake"
|
31
|
+
m.template 'en.yml', "#{extension_path}/config/locales/en.yml"
|
32
|
+
m.template 'routes.rb', "#{extension_path}/config/routes.rb"
|
33
|
+
m.template 'radiant_config.rb', "#{extension_path}/config/initializers/radiant_config.rb"
|
34
|
+
m.template 'lib.rb', "#{extension_path}/lib/radiant-#{file_name}-extension.rb"
|
35
|
+
m.template 'gemspec.rb', "#{extension_path}/radiant-#{file_name}-extension.gemspec"
|
36
|
+
|
37
|
+
if options[:with_test_unit]
|
38
|
+
m.directory "#{extension_path}/test/fixtures"
|
39
|
+
m.directory "#{extension_path}/test/functional"
|
40
|
+
m.directory "#{extension_path}/test/unit"
|
41
|
+
|
42
|
+
m.template 'Rakefile', "#{extension_path}/Rakefile"
|
43
|
+
m.template 'test_helper.rb', "#{extension_path}/test/test_helper.rb"
|
44
|
+
m.template 'functional_test.rb', "#{extension_path}/test/functional/#{extension_file_name}_test.rb"
|
45
|
+
else
|
46
|
+
m.directory "#{extension_path}/spec/controllers"
|
47
|
+
m.directory "#{extension_path}/spec/models"
|
48
|
+
m.directory "#{extension_path}/spec/views"
|
49
|
+
m.directory "#{extension_path}/spec/helpers"
|
50
|
+
m.directory "#{extension_path}/features/support"
|
51
|
+
m.directory "#{extension_path}/features/step_definitions/admin"
|
52
|
+
|
53
|
+
m.template 'RSpecRakefile', "#{extension_path}/Rakefile"
|
54
|
+
m.template 'spec_helper.rb', "#{extension_path}/spec/spec_helper.rb"
|
55
|
+
m.file 'spec.opts', "#{extension_path}/spec/spec.opts"
|
56
|
+
m.file 'cucumber.yml', "#{extension_path}/cucumber.yml"
|
57
|
+
m.template 'cucumber_env.rb', "#{extension_path}/features/support/env.rb"
|
58
|
+
m.template 'cucumber_paths.rb', "#{extension_path}/features/support/paths.rb"
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
def class_name
|
64
|
+
super.to_name.gsub(' ', '') + 'Extension'
|
65
|
+
end
|
66
|
+
|
67
|
+
def extension_name
|
68
|
+
class_name.to_name('Extension')
|
69
|
+
end
|
70
|
+
|
71
|
+
def author_info
|
72
|
+
@author_info ||= begin
|
73
|
+
Git.global_config
|
74
|
+
rescue NameError
|
75
|
+
{}
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
def homepage
|
80
|
+
author_info['github.user'] ? "http://github.com/#{author_info['github.user']}/radiant-#{file_name}-extension" : "http://example.com/#{file_name}"
|
81
|
+
end
|
82
|
+
|
83
|
+
def author_email
|
84
|
+
author_info['user.email'] || 'your email'
|
85
|
+
end
|
86
|
+
|
87
|
+
def author_name
|
88
|
+
author_info['user.name'] || 'Your Name'
|
89
|
+
end
|
90
|
+
|
91
|
+
def add_options!(opt)
|
92
|
+
opt.separator ''
|
93
|
+
opt.separator 'Options:'
|
94
|
+
opt.on("--with-test-unit",
|
95
|
+
"Use Test::Unit for this extension instead of RSpec") { |v| options[:with_test_unit] = v }
|
96
|
+
end
|
97
|
+
end
|
@@ -0,0 +1,6 @@
|
|
1
|
+
# <%= extension_name %>
|
2
|
+
|
3
|
+
TrustyCms is _so_ freaking awesome, but I made it better through this extension.
|
4
|
+
|
5
|
+
Created by <%= author_name %>. <%- if author_email.include?('@') -%>If I don't update this content with real details,
|
6
|
+
please contact me at <%= author_email %> with annoying messages telling me to do it.<%- end -%>
|
@@ -0,0 +1,109 @@
|
|
1
|
+
# Determine where the RSpec plugin is by loading the boot
|
2
|
+
unless defined? TRUSTY_CMS_ROOT
|
3
|
+
ENV["Rails.env"] = "test"
|
4
|
+
case
|
5
|
+
when ENV["RADIANT_ENV_FILE"]
|
6
|
+
require File.dirname(ENV["RADIANT_ENV_FILE"]) + "/boot"
|
7
|
+
when File.dirname(__FILE__) =~ %r{vendor/trusty_cms/vendor/extensions}
|
8
|
+
require "#{File.expand_path(File.dirname(__FILE__) + "/../../../../../")}/config/boot"
|
9
|
+
else
|
10
|
+
require "#{File.expand_path(File.dirname(__FILE__) + "/../../../")}/config/boot"
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
require 'rake'
|
15
|
+
require 'rdoc/task'
|
16
|
+
require 'rake/testtask'
|
17
|
+
|
18
|
+
rspec_base = File.expand_path(TRUSTY_CMS_ROOT + '/vendor/plugins/rspec/lib')
|
19
|
+
$LOAD_PATH.unshift(rspec_base) if File.exist?(rspec_base)
|
20
|
+
require 'spec/rake/spectask'
|
21
|
+
require 'cucumber'
|
22
|
+
require 'cucumber/rake/task'
|
23
|
+
|
24
|
+
# Cleanup the TRUSTY_CMS_ROOT constant so specs will load the environment
|
25
|
+
Object.send(:remove_const, :TRUSTY_CMS_ROOT)
|
26
|
+
|
27
|
+
extension_root = File.expand_path(File.dirname(__FILE__))
|
28
|
+
|
29
|
+
task :default => [:spec, :features]
|
30
|
+
task :stats => "spec:statsetup"
|
31
|
+
|
32
|
+
desc "Run all specs in spec directory"
|
33
|
+
Spec::Rake::SpecTask.new(:spec) do |t|
|
34
|
+
t.spec_opts = ['--options', "\"#{extension_root}/spec/spec.opts\""]
|
35
|
+
t.spec_files = FileList['spec/**/*_spec.rb']
|
36
|
+
end
|
37
|
+
|
38
|
+
task :features => 'spec:integration'
|
39
|
+
|
40
|
+
namespace :spec do
|
41
|
+
desc "Run all specs in spec directory with RCov"
|
42
|
+
Spec::Rake::SpecTask.new(:rcov) do |t|
|
43
|
+
t.spec_opts = ['--options', "\"#{extension_root}/spec/spec.opts\""]
|
44
|
+
t.spec_files = FileList['spec/**/*_spec.rb']
|
45
|
+
t.rcov = true
|
46
|
+
t.rcov_opts = ['--exclude', 'spec', '--rails']
|
47
|
+
end
|
48
|
+
|
49
|
+
desc "Print Specdoc for all specs"
|
50
|
+
Spec::Rake::SpecTask.new(:doc) do |t|
|
51
|
+
t.spec_opts = ["--format", "specdoc", "--dry-run"]
|
52
|
+
t.spec_files = FileList['spec/**/*_spec.rb']
|
53
|
+
end
|
54
|
+
|
55
|
+
[:models, :controllers, :views, :helpers].each do |sub|
|
56
|
+
desc "Run the specs under spec/#{sub}"
|
57
|
+
Spec::Rake::SpecTask.new(sub) do |t|
|
58
|
+
t.spec_opts = ['--options', "\"#{extension_root}/spec/spec.opts\""]
|
59
|
+
t.spec_files = FileList["spec/#{sub}/**/*_spec.rb"]
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
desc "Run the Cucumber features"
|
64
|
+
Cucumber::Rake::Task.new(:integration) do |t|
|
65
|
+
t.fork = true
|
66
|
+
t.cucumber_opts = ['--format', (ENV['CUCUMBER_FORMAT'] || 'pretty')]
|
67
|
+
# t.feature_pattern = "#{extension_root}/features/**/*.feature"
|
68
|
+
t.profile = "default"
|
69
|
+
end
|
70
|
+
|
71
|
+
# Setup specs for stats
|
72
|
+
task :statsetup do
|
73
|
+
require 'code_statistics'
|
74
|
+
::STATS_DIRECTORIES << %w(Model\ specs spec/models)
|
75
|
+
::STATS_DIRECTORIES << %w(View\ specs spec/views)
|
76
|
+
::STATS_DIRECTORIES << %w(Controller\ specs spec/controllers)
|
77
|
+
::STATS_DIRECTORIES << %w(Helper\ specs spec/views)
|
78
|
+
::CodeStatistics::TEST_TYPES << "Model specs"
|
79
|
+
::CodeStatistics::TEST_TYPES << "View specs"
|
80
|
+
::CodeStatistics::TEST_TYPES << "Controller specs"
|
81
|
+
::CodeStatistics::TEST_TYPES << "Helper specs"
|
82
|
+
::STATS_DIRECTORIES.delete_if {|a| a[0] =~ /test/}
|
83
|
+
end
|
84
|
+
|
85
|
+
namespace :db do
|
86
|
+
namespace :fixtures do
|
87
|
+
desc "Load fixtures (from spec/fixtures) into the current environment's database. Load specific fixtures using FIXTURES=x,y"
|
88
|
+
task :load => :environment do
|
89
|
+
require 'active_record/fixtures'
|
90
|
+
ActiveRecord::Base.establish_connection(Rails.env.to_sym)
|
91
|
+
(ENV['FIXTURES'] ? ENV['FIXTURES'].split(/,/) : Dir.glob(File.join(Rails.root, 'spec', 'fixtures', '*.{yml,csv}'))).each do |fixture_file|
|
92
|
+
Fixtures.create_fixtures('spec/fixtures', File.basename(fixture_file, '.*'))
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
desc 'Generate documentation for the <%= file_name %> extension.'
|
100
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
101
|
+
rdoc.rdoc_dir = 'rdoc'
|
102
|
+
rdoc.title = '<%= class_name %>'
|
103
|
+
rdoc.options << '--line-numbers' << '--inline-source'
|
104
|
+
rdoc.rdoc_files.include('README')
|
105
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
106
|
+
end
|
107
|
+
|
108
|
+
# Load any custom rakefiles for extension
|
109
|
+
Dir[File.dirname(__FILE__) + '/tasks/*.rake'].sort.each { |f| require f }
|