hobo 0.8 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES.txt +56 -0
- data/Manifest +2 -0
- data/Rakefile +116 -0
- data/dryml_generators/rapid/forms.dryml.erb +6 -4
- data/dryml_generators/rapid/pages.dryml.erb +9 -7
- data/hobo.gemspec +316 -162
- data/lib/hobo/controller.rb +14 -1
- data/lib/hobo/hobo_helper.rb +2 -2
- data/lib/hobo/lifecycles/actions.rb +1 -0
- data/lib/hobo/lifecycles/creator.rb +3 -2
- data/lib/hobo/lifecycles/lifecycle.rb +10 -5
- data/lib/hobo/lifecycles/transition.rb +3 -2
- data/lib/hobo/lifecycles.rb +1 -1
- data/lib/hobo/model.rb +5 -1
- data/lib/hobo/model_controller.rb +5 -1
- data/lib/hobo/model_router.rb +7 -5
- data/lib/hobo/rapid_helper.rb +1 -5
- data/lib/hobo/user.rb +4 -0
- data/lib/hobo/user_controller.rb +2 -4
- data/lib/hobo.rb +2 -2
- data/rails_generators/hobo/hobo_generator.rb +1 -0
- data/rails_generators/hobo/templates/patch_routing.rb +32 -0
- data/rails_generators/hobo_rapid/templates/hobo-rapid.js +8 -7
- data/rails_generators/hobo_subsite/hobo_subsite_generator.rb +1 -1
- data/rails_generators/hobo_user_model/templates/forgot_password.erb +2 -2
- data/rails_generators/hobo_user_model/templates/mailer.rb +1 -1
- data/rails_generators/hobo_user_model/templates/model.rb +2 -2
- data/taglibs/rapid_forms.dryml +4 -1
- data/taglibs/rapid_plus.dryml +1 -1
- metadata +18 -6
data/hobo.gemspec
CHANGED
@@ -1,168 +1,322 @@
|
|
1
1
|
|
2
|
-
# Gem::Specification for Hobo-0.8
|
2
|
+
# Gem::Specification for Hobo-0.8.1
|
3
3
|
# Originally generated by Echoe
|
4
4
|
|
5
|
-
Gem::Specification
|
6
|
-
|
7
|
-
|
5
|
+
--- !ruby/object:Gem::Specification
|
6
|
+
name: hobo
|
7
|
+
version: !ruby/object:Gem::Version
|
8
|
+
version: 0.8.1
|
9
|
+
platform: ruby
|
10
|
+
authors:
|
11
|
+
- Tom Locke
|
12
|
+
autorequire:
|
13
|
+
bindir: bin
|
8
14
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
15
|
+
date: 2008-09-08 00:00:00 +01:00
|
16
|
+
default_executable:
|
17
|
+
dependencies:
|
18
|
+
- !ruby/object:Gem::Dependency
|
19
|
+
name: hobosupport
|
20
|
+
type: :runtime
|
21
|
+
version_requirement:
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.8.1
|
27
|
+
version:
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: hobofields
|
30
|
+
type: :runtime
|
31
|
+
version_requirement:
|
32
|
+
version_requirements: !ruby/object:Gem::Requirement
|
33
|
+
requirements:
|
34
|
+
- - ">="
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: 0.8.1
|
37
|
+
version:
|
38
|
+
- !ruby/object:Gem::Dependency
|
39
|
+
name: rails
|
40
|
+
type: :runtime
|
41
|
+
version_requirement:
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - "="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: "2.1"
|
47
|
+
version:
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: mislav-will_paginate
|
50
|
+
type: :runtime
|
51
|
+
version_requirement:
|
52
|
+
version_requirements: !ruby/object:Gem::Requirement
|
53
|
+
requirements:
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: 2.2.1
|
57
|
+
version:
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: echoe
|
60
|
+
type: :development
|
61
|
+
version_requirement:
|
62
|
+
version_requirements: !ruby/object:Gem::Requirement
|
63
|
+
requirements:
|
64
|
+
- - ">="
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: "0"
|
67
|
+
version:
|
68
|
+
description: The web app builder for Rails
|
69
|
+
email: tom@tomlocke.com
|
70
|
+
executables:
|
71
|
+
- hobo
|
72
|
+
extensions: []
|
26
73
|
|
27
|
-
|
28
|
-
|
29
|
-
|
74
|
+
extra_rdoc_files:
|
75
|
+
- bin/hobo
|
76
|
+
- lib/action_view_extensions/helpers/tag_helper.rb
|
77
|
+
- lib/active_record/association_collection.rb
|
78
|
+
- lib/active_record/association_proxy.rb
|
79
|
+
- lib/active_record/association_reflection.rb
|
80
|
+
- lib/extensions/test_case.rb
|
81
|
+
- lib/hobo/authentication_support.rb
|
82
|
+
- lib/hobo/bundle.rb
|
83
|
+
- lib/hobo/composite_model.rb
|
84
|
+
- lib/hobo/controller.rb
|
85
|
+
- lib/hobo/dev_controller.rb
|
86
|
+
- lib/hobo/dryml/dryml_builder.rb
|
87
|
+
- lib/hobo/dryml/dryml_generator.rb
|
88
|
+
- lib/hobo/dryml/dryml_support_controller.rb
|
89
|
+
- lib/hobo/dryml/parser/attribute.rb
|
90
|
+
- lib/hobo/dryml/parser/base_parser.rb
|
91
|
+
- lib/hobo/dryml/parser/document.rb
|
92
|
+
- lib/hobo/dryml/parser/element.rb
|
93
|
+
- lib/hobo/dryml/parser/elements.rb
|
94
|
+
- lib/hobo/dryml/parser/source.rb
|
95
|
+
- lib/hobo/dryml/parser/text.rb
|
96
|
+
- lib/hobo/dryml/parser/tree_parser.rb
|
97
|
+
- lib/hobo/dryml/parser.rb
|
98
|
+
- lib/hobo/dryml/part_context.rb
|
99
|
+
- lib/hobo/dryml/scoped_variables.rb
|
100
|
+
- lib/hobo/dryml/tag_parameters.rb
|
101
|
+
- lib/hobo/dryml/taglib.rb
|
102
|
+
- lib/hobo/dryml/template.rb
|
103
|
+
- lib/hobo/dryml/template_environment.rb
|
104
|
+
- lib/hobo/dryml/template_handler.rb
|
105
|
+
- lib/hobo/dryml.rb
|
106
|
+
- lib/hobo/find_for.rb
|
107
|
+
- lib/hobo/generator.rb
|
108
|
+
- lib/hobo/guest.rb
|
109
|
+
- lib/hobo/hobo_helper.rb
|
110
|
+
- lib/hobo/include_in_save.rb
|
111
|
+
- lib/hobo/lifecycles/actions.rb
|
112
|
+
- lib/hobo/lifecycles/creator.rb
|
113
|
+
- lib/hobo/lifecycles/lifecycle.rb
|
114
|
+
- lib/hobo/lifecycles/state.rb
|
115
|
+
- lib/hobo/lifecycles/transition.rb
|
116
|
+
- lib/hobo/lifecycles.rb
|
117
|
+
- lib/hobo/model.rb
|
118
|
+
- lib/hobo/model_controller.rb
|
119
|
+
- lib/hobo/model_router.rb
|
120
|
+
- lib/hobo/model_support.rb
|
121
|
+
- lib/hobo/rapid_helper.rb
|
122
|
+
- lib/hobo/scopes/apply_scopes.rb
|
123
|
+
- lib/hobo/scopes/association_proxy_extensions.rb
|
124
|
+
- lib/hobo/scopes/automatic_scopes.rb
|
125
|
+
- lib/hobo/scopes/named_scope_extensions.rb
|
126
|
+
- lib/hobo/scopes.rb
|
127
|
+
- lib/hobo/static_tags
|
128
|
+
- lib/hobo/undefined.rb
|
129
|
+
- lib/hobo/undefined_access_error.rb
|
130
|
+
- lib/hobo/user.rb
|
131
|
+
- lib/hobo/user_controller.rb
|
132
|
+
- lib/hobo.rb
|
133
|
+
- LICENSE.txt
|
134
|
+
- README
|
135
|
+
- tasks/environments.rake
|
136
|
+
- tasks/fix_dryml.rake
|
137
|
+
- tasks/generate_tag_reference.rb
|
138
|
+
- tasks/hobo_tasks.rake
|
139
|
+
files:
|
140
|
+
- bin/hobo
|
141
|
+
- CHANGES.txt
|
142
|
+
- dryml_generators/rapid/cards.dryml.erb
|
143
|
+
- dryml_generators/rapid/forms.dryml.erb
|
144
|
+
- dryml_generators/rapid/pages.dryml.erb
|
145
|
+
- init.rb
|
146
|
+
- lib/action_view_extensions/helpers/tag_helper.rb
|
147
|
+
- lib/active_record/association_collection.rb
|
148
|
+
- lib/active_record/association_proxy.rb
|
149
|
+
- lib/active_record/association_reflection.rb
|
150
|
+
- lib/extensions/test_case.rb
|
151
|
+
- lib/hobo/authentication_support.rb
|
152
|
+
- lib/hobo/bundle.rb
|
153
|
+
- lib/hobo/composite_model.rb
|
154
|
+
- lib/hobo/controller.rb
|
155
|
+
- lib/hobo/dev_controller.rb
|
156
|
+
- lib/hobo/dryml/dryml_builder.rb
|
157
|
+
- lib/hobo/dryml/dryml_generator.rb
|
158
|
+
- lib/hobo/dryml/dryml_support_controller.rb
|
159
|
+
- lib/hobo/dryml/parser/attribute.rb
|
160
|
+
- lib/hobo/dryml/parser/base_parser.rb
|
161
|
+
- lib/hobo/dryml/parser/document.rb
|
162
|
+
- lib/hobo/dryml/parser/element.rb
|
163
|
+
- lib/hobo/dryml/parser/elements.rb
|
164
|
+
- lib/hobo/dryml/parser/source.rb
|
165
|
+
- lib/hobo/dryml/parser/text.rb
|
166
|
+
- lib/hobo/dryml/parser/tree_parser.rb
|
167
|
+
- lib/hobo/dryml/parser.rb
|
168
|
+
- lib/hobo/dryml/part_context.rb
|
169
|
+
- lib/hobo/dryml/scoped_variables.rb
|
170
|
+
- lib/hobo/dryml/tag_parameters.rb
|
171
|
+
- lib/hobo/dryml/taglib.rb
|
172
|
+
- lib/hobo/dryml/template.rb
|
173
|
+
- lib/hobo/dryml/template_environment.rb
|
174
|
+
- lib/hobo/dryml/template_handler.rb
|
175
|
+
- lib/hobo/dryml.rb
|
176
|
+
- lib/hobo/find_for.rb
|
177
|
+
- lib/hobo/generator.rb
|
178
|
+
- lib/hobo/guest.rb
|
179
|
+
- lib/hobo/hobo_helper.rb
|
180
|
+
- lib/hobo/include_in_save.rb
|
181
|
+
- lib/hobo/lifecycles/actions.rb
|
182
|
+
- lib/hobo/lifecycles/creator.rb
|
183
|
+
- lib/hobo/lifecycles/lifecycle.rb
|
184
|
+
- lib/hobo/lifecycles/state.rb
|
185
|
+
- lib/hobo/lifecycles/transition.rb
|
186
|
+
- lib/hobo/lifecycles.rb
|
187
|
+
- lib/hobo/model.rb
|
188
|
+
- lib/hobo/model_controller.rb
|
189
|
+
- lib/hobo/model_router.rb
|
190
|
+
- lib/hobo/model_support.rb
|
191
|
+
- lib/hobo/rapid_helper.rb
|
192
|
+
- lib/hobo/scopes/apply_scopes.rb
|
193
|
+
- lib/hobo/scopes/association_proxy_extensions.rb
|
194
|
+
- lib/hobo/scopes/automatic_scopes.rb
|
195
|
+
- lib/hobo/scopes/named_scope_extensions.rb
|
196
|
+
- lib/hobo/scopes.rb
|
197
|
+
- lib/hobo/static_tags
|
198
|
+
- lib/hobo/undefined.rb
|
199
|
+
- lib/hobo/undefined_access_error.rb
|
200
|
+
- lib/hobo/user.rb
|
201
|
+
- lib/hobo/user_controller.rb
|
202
|
+
- lib/hobo.rb
|
203
|
+
- LICENSE.txt
|
204
|
+
- Manifest
|
205
|
+
- rails_generators/hobo/hobo_generator.rb
|
206
|
+
- rails_generators/hobo/templates/application.css
|
207
|
+
- rails_generators/hobo/templates/application.dryml
|
208
|
+
- rails_generators/hobo/templates/dryml-support.js
|
209
|
+
- rails_generators/hobo/templates/guest.rb
|
210
|
+
- rails_generators/hobo/templates/initializer.rb
|
211
|
+
- rails_generators/hobo/templates/patch_routing.rb
|
212
|
+
- rails_generators/hobo_front_controller/hobo_front_controller_generator.rb
|
213
|
+
- rails_generators/hobo_front_controller/templates/controller.rb
|
214
|
+
- rails_generators/hobo_front_controller/templates/functional_test.rb
|
215
|
+
- rails_generators/hobo_front_controller/templates/helper.rb
|
216
|
+
- rails_generators/hobo_front_controller/templates/index.dryml
|
217
|
+
- rails_generators/hobo_front_controller/USAGE
|
218
|
+
- rails_generators/hobo_model/hobo_model_generator.rb
|
219
|
+
- rails_generators/hobo_model/templates/fixtures.yml
|
220
|
+
- rails_generators/hobo_model/templates/model.rb
|
221
|
+
- rails_generators/hobo_model/templates/unit_test.rb
|
222
|
+
- rails_generators/hobo_model/USAGE
|
223
|
+
- rails_generators/hobo_model_controller/hobo_model_controller_generator.rb
|
224
|
+
- rails_generators/hobo_model_controller/templates/controller.rb
|
225
|
+
- rails_generators/hobo_model_controller/templates/functional_test.rb
|
226
|
+
- rails_generators/hobo_model_controller/templates/helper.rb
|
227
|
+
- rails_generators/hobo_model_controller/USAGE
|
228
|
+
- rails_generators/hobo_model_resource/hobo_model_resource_generator.rb
|
229
|
+
- rails_generators/hobo_model_resource/templates/controller.rb
|
230
|
+
- rails_generators/hobo_model_resource/templates/functional_test.rb
|
231
|
+
- rails_generators/hobo_model_resource/templates/helper.rb
|
232
|
+
- rails_generators/hobo_rapid/hobo_rapid_generator.rb
|
233
|
+
- rails_generators/hobo_rapid/templates/blank.gif
|
234
|
+
- rails_generators/hobo_rapid/templates/hobo-rapid.css
|
235
|
+
- rails_generators/hobo_rapid/templates/hobo-rapid.js
|
236
|
+
- rails_generators/hobo_rapid/templates/IE7.js
|
237
|
+
- rails_generators/hobo_rapid/templates/lowpro.js
|
238
|
+
- rails_generators/hobo_rapid/templates/nicedit.js
|
239
|
+
- rails_generators/hobo_rapid/templates/nicEditorIcons.gif
|
240
|
+
- rails_generators/hobo_rapid/templates/reset.css
|
241
|
+
- rails_generators/hobo_rapid/templates/themes/clean/public/images/fieldbg.gif
|
242
|
+
- rails_generators/hobo_rapid/templates/themes/clean/public/images/pencil.png
|
243
|
+
- rails_generators/hobo_rapid/templates/themes/clean/public/images/small_close.png
|
244
|
+
- rails_generators/hobo_rapid/templates/themes/clean/public/images/spinner.gif
|
245
|
+
- rails_generators/hobo_rapid/templates/themes/clean/public/stylesheets/clean.css
|
246
|
+
- rails_generators/hobo_rapid/templates/themes/clean/public/stylesheets/rapid-ui.css
|
247
|
+
- rails_generators/hobo_rapid/templates/themes/clean/views/clean.dryml
|
248
|
+
- rails_generators/hobo_subsite/hobo_subsite_generator.rb
|
249
|
+
- rails_generators/hobo_subsite/templates/application.dryml
|
250
|
+
- rails_generators/hobo_subsite/templates/controller.rb
|
251
|
+
- rails_generators/hobo_subsite/templates/site_taglib.dryml
|
252
|
+
- rails_generators/hobo_user_controller/hobo_user_controller_generator.rb
|
253
|
+
- rails_generators/hobo_user_controller/templates/controller.rb
|
254
|
+
- rails_generators/hobo_user_controller/templates/functional_test.rb
|
255
|
+
- rails_generators/hobo_user_controller/templates/helper.rb
|
256
|
+
- rails_generators/hobo_user_controller/USAGE
|
257
|
+
- rails_generators/hobo_user_model/hobo_user_model_generator.rb
|
258
|
+
- rails_generators/hobo_user_model/templates/fixtures.yml
|
259
|
+
- rails_generators/hobo_user_model/templates/forgot_password.erb
|
260
|
+
- rails_generators/hobo_user_model/templates/mailer.rb
|
261
|
+
- rails_generators/hobo_user_model/templates/model.rb
|
262
|
+
- rails_generators/hobo_user_model/templates/unit_test.rb
|
263
|
+
- rails_generators/hobo_user_model/USAGE
|
264
|
+
- Rakefile
|
265
|
+
- README
|
266
|
+
- script/destroy
|
267
|
+
- script/generate
|
268
|
+
- taglibs/core.dryml
|
269
|
+
- taglibs/rapid.dryml
|
270
|
+
- taglibs/rapid_document_tags.dryml
|
271
|
+
- taglibs/rapid_editing.dryml
|
272
|
+
- taglibs/rapid_forms.dryml
|
273
|
+
- taglibs/rapid_generics.dryml
|
274
|
+
- taglibs/rapid_lifecycles.dryml
|
275
|
+
- taglibs/rapid_navigation.dryml
|
276
|
+
- taglibs/rapid_pages.dryml
|
277
|
+
- taglibs/rapid_plus.dryml
|
278
|
+
- taglibs/rapid_support.dryml
|
279
|
+
- taglibs/rapid_user_pages.dryml
|
280
|
+
- tasks/environments.rake
|
281
|
+
- tasks/fix_dryml.rake
|
282
|
+
- tasks/generate_tag_reference.rb
|
283
|
+
- tasks/hobo_tasks.rake
|
284
|
+
- test/test_generator_helper.rb
|
285
|
+
- test/test_helper.rb
|
286
|
+
- test/test_hobo_model_controller_generator.rb
|
287
|
+
- uninstall.rb
|
288
|
+
- hobo.gemspec
|
289
|
+
has_rdoc: true
|
290
|
+
homepage: http://hobocentral.net/
|
291
|
+
post_install_message:
|
292
|
+
rdoc_options:
|
293
|
+
- --line-numbers
|
294
|
+
- --inline-source
|
295
|
+
- --title
|
296
|
+
- Hobo
|
297
|
+
- --main
|
298
|
+
- README
|
299
|
+
require_paths:
|
300
|
+
- lib
|
301
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
302
|
+
requirements:
|
303
|
+
- - ">="
|
304
|
+
- !ruby/object:Gem::Version
|
305
|
+
version: "0"
|
306
|
+
version:
|
307
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
308
|
+
requirements:
|
309
|
+
- - "="
|
310
|
+
- !ruby/object:Gem::Version
|
311
|
+
version: "1.2"
|
312
|
+
version:
|
313
|
+
requirements: []
|
30
314
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
s.add_dependency(%q<rails>, ["= 2.1"])
|
40
|
-
s.add_dependency(%q<mislav-will_paginate>, [">= 2.2.1"])
|
41
|
-
end
|
42
|
-
else
|
43
|
-
s.add_dependency(%q<hobosupport>, [">= 0.8"])
|
44
|
-
s.add_dependency(%q<hobofields>, [">= 0.8"])
|
45
|
-
s.add_dependency(%q<rails>, ["= 2.1"])
|
46
|
-
s.add_dependency(%q<mislav-will_paginate>, [">= 2.2.1"])
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
|
51
|
-
# # Original Rakefile source (requires the Echoe gem):
|
52
|
-
#
|
53
|
-
# require 'rake'
|
54
|
-
# require 'rake/rdoctask'
|
55
|
-
# require 'rake/testtask'
|
56
|
-
#
|
57
|
-
# load "tasks/generate_tag_reference.rb"
|
58
|
-
#
|
59
|
-
# desc 'Default: run specs.'
|
60
|
-
# task :default => :spec
|
61
|
-
#
|
62
|
-
# desc 'Generate documentation for the Hobo plugin.'
|
63
|
-
# Rake::RDocTask.new(:rdoc) do |rdoc|
|
64
|
-
# rdoc.rdoc_dir = 'rdoc'
|
65
|
-
# rdoc.title = 'Hobo'
|
66
|
-
# rdoc.options << '--line-numbers' << '--inline-source'
|
67
|
-
# rdoc.rdoc_files.include('README')
|
68
|
-
# rdoc.rdoc_files.include('lib/**/*.rb')
|
69
|
-
# end
|
70
|
-
#
|
71
|
-
# require 'echoe'
|
72
|
-
#
|
73
|
-
# Echoe.new('hobo') do |p|
|
74
|
-
# p.author = "Tom Locke"
|
75
|
-
# p.email = "tom@tomlocke.com"
|
76
|
-
# p.summary = "The web app builder for Rails"
|
77
|
-
# p.url = "http://hobocentral.net/"
|
78
|
-
# p.project = "hobo"
|
79
|
-
#
|
80
|
-
# p.changelog = "CHANGES.txt"
|
81
|
-
# p.version = "0.8"
|
82
|
-
#
|
83
|
-
# p.dependencies = [
|
84
|
-
# 'hobosupport >=0.8',
|
85
|
-
# 'hobofields >=0.8',
|
86
|
-
# 'rails =2.1',
|
87
|
-
# 'mislav-will_paginate >=2.2.1']
|
88
|
-
# end
|
89
|
-
#
|
90
|
-
#
|
91
|
-
#
|
92
|
-
#
|
93
|
-
# # --- RSpec --- #
|
94
|
-
#
|
95
|
-
# # In rails 1.2, plugins aren't available in the path until they're loaded.
|
96
|
-
# # Check to see if the rspec plugin is installed first and require
|
97
|
-
# # it if it is. If not, use the gem version.
|
98
|
-
# PLUGIN_DIR = File.dirname(__FILE__)
|
99
|
-
#
|
100
|
-
# rspec_base = File.expand_path(PLUGIN_DIR + '/spec/rails_root/vendor/plugins/rspec/lib')
|
101
|
-
# $LOAD_PATH.unshift(rspec_base) if File.exist?(rspec_base)
|
102
|
-
# require '../hobo_spec/rails_root/vendor/plugins/rspec/lib/spec/rake/spectask'
|
103
|
-
# require '../hobo_spec/rails_root/vendor/plugins/rspec/lib/spec/translator'
|
104
|
-
#
|
105
|
-
# spec_prereq = :noop # File.exist?(File.join(PLUGIN_DIR, 'config', 'database.yml')) ? "db:test:prepare" : :noop
|
106
|
-
# task :noop do
|
107
|
-
# end
|
108
|
-
#
|
109
|
-
# task :stats => "spec:statsetup"
|
110
|
-
#
|
111
|
-
# SPEC_HOME = "#{PLUGIN_DIR}/../hobo_spec"
|
112
|
-
#
|
113
|
-
# desc "Run all specs in spec directory (excluding plugin specs)"
|
114
|
-
# Spec::Rake::SpecTask.new(:spec => spec_prereq) do |t|
|
115
|
-
# t.spec_opts = ['--options', "\"#{SPEC_HOME}/spec.opts\""]
|
116
|
-
# t.spec_files = FileList["#{SPEC_HOME}/unit/**/*_spec.rb"]
|
117
|
-
# end
|
118
|
-
#
|
119
|
-
# namespace :spec do
|
120
|
-
# desc "Run all specs in spec directory with RCov (excluding plugin specs)"
|
121
|
-
# Spec::Rake::SpecTask.new(:rcov) do |t|
|
122
|
-
# t.spec_opts = ['--options', "\"#{SPEC_HOME}/spec.opts\""]
|
123
|
-
# t.spec_files = FileList["#{SPEC_HOME}/unit/**/*_spec.rb"]
|
124
|
-
# t.rcov = true
|
125
|
-
# t.rcov_opts = ['--exclude', 'spec', '--rails']
|
126
|
-
# end
|
127
|
-
#
|
128
|
-
# desc "Print Specdoc for all specs (excluding plugin specs)"
|
129
|
-
# Spec::Rake::SpecTask.new(:doc) do |t|
|
130
|
-
# t.spec_opts = ["--format", "specdoc", "--dry-run"]
|
131
|
-
# t.spec_files = FileList["#{SPEC_HOME}/unit/**/*_spec.rb"]
|
132
|
-
# end
|
133
|
-
#
|
134
|
-
# [:models, :controllers, :views, :helpers].each do |sub|
|
135
|
-
# desc "Run the specs under spec/#{sub}"
|
136
|
-
# Spec::Rake::SpecTask.new(sub => spec_prereq) do |t|
|
137
|
-
# t.spec_opts = ['--options', "\"#{SPEC_HOME}/spec.opts\""]
|
138
|
-
# t.spec_files = FileList["#{SPEC_HOME}/#{sub}/**/*_spec.rb"]
|
139
|
-
# end
|
140
|
-
# end
|
141
|
-
#
|
142
|
-
# # Setup specs for stats
|
143
|
-
# task :statsetup do
|
144
|
-
# require 'code_statistics'
|
145
|
-
# ::STATS_DIRECTORIES << %w(Model\ specs spec/models)
|
146
|
-
# ::STATS_DIRECTORIES << %w(View\ specs spec/views)
|
147
|
-
# ::STATS_DIRECTORIES << %w(Controller\ specs spec/controllers)
|
148
|
-
# ::STATS_DIRECTORIES << %w(Helper\ specs spec/views)
|
149
|
-
# ::CodeStatistics::TEST_TYPES << "Model specs"
|
150
|
-
# ::CodeStatistics::TEST_TYPES << "View specs"
|
151
|
-
# ::CodeStatistics::TEST_TYPES << "Controller specs"
|
152
|
-
# ::CodeStatistics::TEST_TYPES << "Helper specs"
|
153
|
-
# ::STATS_DIRECTORIES.delete_if {|a| a[0] =~ /test/}
|
154
|
-
# end
|
155
|
-
#
|
156
|
-
# namespace :db do
|
157
|
-
# namespace :fixtures do
|
158
|
-
# desc "Load fixtures (from spec/fixtures) into the current environment's database. Load specific fixtures using FIXTURES=x,y"
|
159
|
-
# task :load => :environment do
|
160
|
-
# require 'active_record/fixtures'
|
161
|
-
# ActiveRecord::Base.establish_connection(RAILS_ENV.to_sym)
|
162
|
-
# (ENV['FIXTURES'] ? ENV['FIXTURES'].split(/,/) : Dir.glob(File.join(SPEC_HOME, 'fixtures', '*.{yml,csv}'))).each do |fixture_file|
|
163
|
-
# Fixtures.create_fixtures("#{SPEC_HOME}/fixtures", File.basename(fixture_file, '.*'))
|
164
|
-
# end
|
165
|
-
# end
|
166
|
-
# end
|
167
|
-
# end
|
168
|
-
# end
|
315
|
+
rubyforge_project: hobo
|
316
|
+
rubygems_version: 1.2.0
|
317
|
+
specification_version: 2
|
318
|
+
summary: The web app builder for Rails
|
319
|
+
test_files:
|
320
|
+
- test/test_generator_helper.rb
|
321
|
+
- test/test_helper.rb
|
322
|
+
- test/test_hobo_model_controller_generator.rb
|
data/lib/hobo/controller.rb
CHANGED
@@ -16,17 +16,30 @@ module Hobo
|
|
16
16
|
klass.extend(ClassMethods)
|
17
17
|
klass.class_eval do
|
18
18
|
alias_method_chain :redirect_to, :object_url
|
19
|
+
around_filter do |controller, action|
|
20
|
+
Thread.current['Hobo::current_controller'] = controller
|
21
|
+
action.call
|
22
|
+
Thread.current['Hobo::current_controller'] = nil # should avoid memory-leakage
|
23
|
+
end
|
19
24
|
@included_taglibs = []
|
20
25
|
end
|
21
26
|
Hobo::HoboHelper.add_to_controller(klass)
|
22
27
|
end
|
23
28
|
|
24
|
-
|
29
|
+
attr_writer :request_host, :app_name # DEPRECIATED AFTER 0.9 - setting them should not be needed
|
25
30
|
|
26
31
|
def controller_and_view_for(page_path)
|
27
32
|
page_path.match(/(.*)\/([^\/]+)/)[1..2]
|
28
33
|
end
|
29
34
|
|
35
|
+
def request_host
|
36
|
+
@request_host || Thread.current['Hobo::current_controller'].request.host_with_port
|
37
|
+
end
|
38
|
+
|
39
|
+
def app_name
|
40
|
+
@app_name || Thread.current['Hobo::current_controller'].send(:call_tag, :app_name)
|
41
|
+
end
|
42
|
+
|
30
43
|
end
|
31
44
|
|
32
45
|
module ClassMethods
|
data/lib/hobo/hobo_helper.rb
CHANGED
@@ -235,8 +235,8 @@ module Hobo
|
|
235
235
|
|
236
236
|
@can_view_cache ||= {}
|
237
237
|
@can_view_cache[ [object, field] ] ||=
|
238
|
-
if !field && object.
|
239
|
-
Hobo.can_view?(current_user,
|
238
|
+
if !field && (origin = object.try.origin)
|
239
|
+
Hobo.can_view?(current_user, origin, object.origin_attribute)
|
240
240
|
else
|
241
241
|
Hobo.can_view?(current_user, object, field)
|
242
242
|
end
|
@@ -57,8 +57,9 @@ module Hobo
|
|
57
57
|
def run!(user, attributes)
|
58
58
|
record = lifecycle.model.new
|
59
59
|
if prepare_and_check!(record, user, attributes)
|
60
|
-
|
61
|
-
|
60
|
+
if change_state(record)
|
61
|
+
fire_event(record, on_create)
|
62
|
+
end
|
62
63
|
record
|
63
64
|
else
|
64
65
|
raise Hobo::Model::PermissionDeniedError
|
@@ -144,18 +144,22 @@ module Hobo
|
|
144
144
|
end
|
145
145
|
|
146
146
|
|
147
|
-
def
|
147
|
+
def become(state_name, validate=false)
|
148
148
|
state_name = state_name.to_s
|
149
149
|
if self.state != state_name
|
150
150
|
record.write_attribute self.class.state_field, state_name
|
151
151
|
|
152
152
|
if state_name == "destroy"
|
153
153
|
record.destroy
|
154
|
+
true
|
154
155
|
else
|
155
156
|
s = self.class.states[state_name]
|
156
157
|
raise ArgumentError, "No such state '#{state_name}' for #{record.class.name}" unless s
|
157
|
-
if record.save
|
158
|
+
if record.save(validate)
|
158
159
|
s.activate! record
|
160
|
+
true
|
161
|
+
else
|
162
|
+
false
|
159
163
|
end
|
160
164
|
end
|
161
165
|
end
|
@@ -173,11 +177,11 @@ module Hobo
|
|
173
177
|
end
|
174
178
|
key_timestamp = Time.now.utc
|
175
179
|
record.write_attribute key_timestamp_field, key_timestamp
|
176
|
-
|
180
|
+
key
|
177
181
|
end
|
178
182
|
|
179
183
|
|
180
|
-
def
|
184
|
+
def key
|
181
185
|
require 'digest/sha1'
|
182
186
|
timestamp = record.read_attribute(key_timestamp_field)
|
183
187
|
if timestamp
|
@@ -187,7 +191,7 @@ module Hobo
|
|
187
191
|
end
|
188
192
|
|
189
193
|
def valid_key?
|
190
|
-
provided_key && provided_key ==
|
194
|
+
provided_key && provided_key == key
|
191
195
|
end
|
192
196
|
|
193
197
|
|
@@ -195,6 +199,7 @@ module Hobo
|
|
195
199
|
self.class.invariants.all? { |i| record.instance_eval(&i) }
|
196
200
|
end
|
197
201
|
|
202
|
+
|
198
203
|
def preconditions_satisfied?
|
199
204
|
self.class.preconditions.all? { |i| record.instance_eval(&i) }
|
200
205
|
end
|
@@ -36,8 +36,9 @@ module Hobo
|
|
36
36
|
|
37
37
|
def run!(record, user, attributes)
|
38
38
|
if prepare_and_check!(record, user, attributes)
|
39
|
-
|
40
|
-
|
39
|
+
if record.lifecycle.become end_state
|
40
|
+
fire_event(record, on_transition)
|
41
|
+
end
|
41
42
|
else
|
42
43
|
raise Hobo::Model::PermissionDeniedError
|
43
44
|
end
|
data/lib/hobo/lifecycles.rb
CHANGED
data/lib/hobo/model.rb
CHANGED
@@ -284,7 +284,11 @@ module Hobo
|
|
284
284
|
options = if default_order.blank?
|
285
285
|
options.except :order
|
286
286
|
else
|
287
|
-
options.merge(:order =>
|
287
|
+
options.merge(:order => if default_order[/(\.|\(|,| )/]
|
288
|
+
default_order
|
289
|
+
else
|
290
|
+
"#{table_name}.#{default_order}"
|
291
|
+
end)
|
288
292
|
end
|
289
293
|
end
|
290
294
|
result = super(*args + [options])
|