hobo 0.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. data/LICENSE.txt +22 -0
  2. data/README.txt +18 -0
  3. data/bin/hobo +81 -0
  4. data/hobo_files/plugin/CHANGES.txt +963 -0
  5. data/hobo_files/plugin/LICENSE.txt +22 -0
  6. data/hobo_files/plugin/README +4 -0
  7. data/hobo_files/plugin/Rakefile +11 -0
  8. data/hobo_files/plugin/generators/hobo/hobo_generator.rb +37 -0
  9. data/hobo_files/plugin/generators/hobo/templates/application.dryml +2 -0
  10. data/hobo_files/plugin/generators/hobo/templates/guest.rb +31 -0
  11. data/hobo_files/plugin/generators/hobo_front_controller/USAGE +11 -0
  12. data/hobo_files/plugin/generators/hobo_front_controller/hobo_front_controller_generator.rb +90 -0
  13. data/hobo_files/plugin/generators/hobo_front_controller/templates/controller.rb +51 -0
  14. data/hobo_files/plugin/generators/hobo_front_controller/templates/functional_test.rb +18 -0
  15. data/hobo_files/plugin/generators/hobo_front_controller/templates/helper.rb +2 -0
  16. data/hobo_files/plugin/generators/hobo_front_controller/templates/index.dryml +43 -0
  17. data/hobo_files/plugin/generators/hobo_front_controller/templates/login.dryml +44 -0
  18. data/hobo_files/plugin/generators/hobo_front_controller/templates/search.dryml +18 -0
  19. data/hobo_files/plugin/generators/hobo_front_controller/templates/signup.dryml +45 -0
  20. data/hobo_files/plugin/generators/hobo_model/USAGE +26 -0
  21. data/hobo_files/plugin/generators/hobo_model/hobo_model_generator.rb +38 -0
  22. data/hobo_files/plugin/generators/hobo_model/templates/fixtures.yml +11 -0
  23. data/hobo_files/plugin/generators/hobo_model/templates/migration.rb +13 -0
  24. data/hobo_files/plugin/generators/hobo_model/templates/model.rb +24 -0
  25. data/hobo_files/plugin/generators/hobo_model/templates/unit_test.rb +10 -0
  26. data/hobo_files/plugin/generators/hobo_model_controller/USAGE +30 -0
  27. data/hobo_files/plugin/generators/hobo_model_controller/hobo_model_controller_generator.rb +43 -0
  28. data/hobo_files/plugin/generators/hobo_model_controller/templates/controller.rb +5 -0
  29. data/hobo_files/plugin/generators/hobo_model_controller/templates/functional_test.rb +18 -0
  30. data/hobo_files/plugin/generators/hobo_model_controller/templates/helper.rb +2 -0
  31. data/hobo_files/plugin/generators/hobo_model_controller/templates/view.rhtml +2 -0
  32. data/hobo_files/plugin/generators/hobo_rapid/hobo_rapid_generator.rb +51 -0
  33. data/hobo_files/plugin/generators/hobo_rapid/templates/hobo_rapid.js +436 -0
  34. data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/default_mapping.rb +11 -0
  35. data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/banner.gif +0 -0
  36. data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/bkg_bodytop.gif +0 -0
  37. data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/bkg_corner_01.gif +0 -0
  38. data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/bkg_corner_02.gif +0 -0
  39. data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/bkg_corner_03.gif +0 -0
  40. data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/bkg_corner_04.gif +0 -0
  41. data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/bkg_shadow_bottom.gif +0 -0
  42. data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/bkg_shadow_left.gif +0 -0
  43. data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/bkg_shadow_right.gif +0 -0
  44. data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/bkg_shadow_top.gif +0 -0
  45. data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/header_blue.gif +0 -0
  46. data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/header_dblue.gif +0 -0
  47. data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/header_green.gif +0 -0
  48. data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/header_purple.gif +0 -0
  49. data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/header_red.gif +0 -0
  50. data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/logo.gif +0 -0
  51. data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/spinner.gif +0 -0
  52. data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/txt_list_img_dblue.gif +0 -0
  53. data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/txt_list_img_green.gif +0 -0
  54. data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/txt_list_img_purple.gif +0 -0
  55. data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/txt_list_img_red.gif +0 -0
  56. data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/window_corner_01.gif +0 -0
  57. data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/window_corner_02.gif +0 -0
  58. data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/window_corner_03.gif +0 -0
  59. data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/window_corner_04.gif +0 -0
  60. data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/window_shadow_bottom.gif +0 -0
  61. data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/window_shadow_left.gif +0 -0
  62. data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/window_shadow_right.gif +0 -0
  63. data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/window_shadow_top.gif +0 -0
  64. data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/stylesheets/application.css +390 -0
  65. data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/views/application.dryml +104 -0
  66. data/hobo_files/plugin/generators/hobo_user_model/USAGE +26 -0
  67. data/hobo_files/plugin/generators/hobo_user_model/hobo_user_model_generator.rb +38 -0
  68. data/hobo_files/plugin/generators/hobo_user_model/templates/fixtures.yml +11 -0
  69. data/hobo_files/plugin/generators/hobo_user_model/templates/migration.rb +15 -0
  70. data/hobo_files/plugin/generators/hobo_user_model/templates/model.rb +58 -0
  71. data/hobo_files/plugin/generators/hobo_user_model/templates/unit_test.rb +10 -0
  72. data/hobo_files/plugin/init.rb +44 -0
  73. data/hobo_files/plugin/lib/action_view_extensions/base.rb +14 -0
  74. data/hobo_files/plugin/lib/active_record/has_many_association.rb +54 -0
  75. data/hobo_files/plugin/lib/active_record/has_many_through_association.rb +22 -0
  76. data/hobo_files/plugin/lib/active_record/table_definition.rb +34 -0
  77. data/hobo_files/plugin/lib/extensions.rb +245 -0
  78. data/hobo_files/plugin/lib/extensions/test_case.rb +130 -0
  79. data/hobo_files/plugin/lib/hobo.rb +353 -0
  80. data/hobo_files/plugin/lib/hobo/HtmlString +3 -0
  81. data/hobo_files/plugin/lib/hobo/authenticated_user.rb +106 -0
  82. data/hobo_files/plugin/lib/hobo/authentication_support.rb +108 -0
  83. data/hobo_files/plugin/lib/hobo/composite_model.rb +66 -0
  84. data/hobo_files/plugin/lib/hobo/controller.rb +134 -0
  85. data/hobo_files/plugin/lib/hobo/controller_helpers.rb +135 -0
  86. data/hobo_files/plugin/lib/hobo/core.rb +475 -0
  87. data/hobo_files/plugin/lib/hobo/define_tags.rb +56 -0
  88. data/hobo_files/plugin/lib/hobo/dryml.rb +161 -0
  89. data/hobo_files/plugin/lib/hobo/dryml/dryml_builder.rb +126 -0
  90. data/hobo_files/plugin/lib/hobo/dryml/tag_module.rb +9 -0
  91. data/hobo_files/plugin/lib/hobo/dryml/taglib.rb +57 -0
  92. data/hobo_files/plugin/lib/hobo/dryml/template.rb +586 -0
  93. data/hobo_files/plugin/lib/hobo/dryml/template_environment.rb +302 -0
  94. data/hobo_files/plugin/lib/hobo/dryml/template_handler.rb +19 -0
  95. data/hobo_files/plugin/lib/hobo/generator.rb +25 -0
  96. data/hobo_files/plugin/lib/hobo/html_string.rb +3 -0
  97. data/hobo_files/plugin/lib/hobo/lazy_hash.rb +28 -0
  98. data/hobo_files/plugin/lib/hobo/mapping_tags.rb +262 -0
  99. data/hobo_files/plugin/lib/hobo/markdown_string.rb +7 -0
  100. data/hobo_files/plugin/lib/hobo/model.rb +391 -0
  101. data/hobo_files/plugin/lib/hobo/model_controller.rb +676 -0
  102. data/hobo_files/plugin/lib/hobo/model_queries.rb +92 -0
  103. data/hobo_files/plugin/lib/hobo/model_support.rb +44 -0
  104. data/hobo_files/plugin/lib/hobo/password_string.rb +3 -0
  105. data/hobo_files/plugin/lib/hobo/predicate_dispatch.rb +78 -0
  106. data/hobo_files/plugin/lib/hobo/proc_binding.rb +32 -0
  107. data/hobo_files/plugin/lib/hobo/rapid.rb +447 -0
  108. data/hobo_files/plugin/lib/hobo/static_tags +92 -0
  109. data/hobo_files/plugin/lib/hobo/text.rb +3 -0
  110. data/hobo_files/plugin/lib/hobo/textile_string.rb +13 -0
  111. data/hobo_files/plugin/lib/hobo/undefined.rb +41 -0
  112. data/hobo_files/plugin/lib/hobo/undefined_access_error.rb +5 -0
  113. data/hobo_files/plugin/lib/hobo/where_fragment.rb +23 -0
  114. data/hobo_files/plugin/lib/rexml.rb +345 -0
  115. data/hobo_files/plugin/tags/core.dryml +6 -0
  116. data/hobo_files/plugin/tags/rapid.dryml +177 -0
  117. data/hobo_files/plugin/tags/rapid_editing.dryml +168 -0
  118. data/hobo_files/plugin/tags/rapid_navigation.dryml +95 -0
  119. data/hobo_files/plugin/tags/rapid_pages.dryml +175 -0
  120. data/hobo_files/plugin/tasks/environments.rake +19 -0
  121. data/hobo_files/plugin/tasks/hobo_tasks.rake +4 -0
  122. data/hobo_files/plugin/test/hobo_dryml_template_test.rb +7 -0
  123. data/hobo_files/plugin/test/hobo_test.rb +7 -0
  124. data/hobo_files/plugin/uninstall.rb +1 -0
  125. metadata +206 -0
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2006 Tom Locke
2
+
3
+ Permission is hereby granted, free of charge, to any person
4
+ obtaining a copy of this software and associated documentation
5
+ files (the "Software"), to deal in the Software without
6
+ restriction, including without limitation the rights to use,
7
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the
9
+ Software is furnished to do so, subject to the following
10
+ conditions:
11
+
12
+ The above copyright notice and this permission notice shall be
13
+ included in all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
+ OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,18 @@
1
+ Hobo - The web app builder for Rails
2
+
3
+ See http://hobocentral.net for more info
4
+
5
+
6
+ This gem installs a single command: hobo
7
+
8
+
9
+ --- hobo command ---
10
+
11
+ Usage: hobo <app-path> [ --user-model <model-name-or-false> ]
12
+
13
+ Creates a Rails app at <app-path> pre-configured for Hobo. That is,
14
+ the Hobo plugin is installed, various Hobo generators are run, and
15
+ routing is configured.
16
+
17
+ Also creates a user model and controller, unless "--user-model false"
18
+ is given. By default the user model is called "user".
@@ -0,0 +1,81 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'fileutils'
4
+ Signal.trap("INT") { puts; exit }
5
+
6
+ SRC_FILES = File.join(File.dirname(__FILE__), "../hobo_files")
7
+
8
+ USAGE = "USAGE: hobo <app-path> [ --user-model <model-name-or-false> ] [ --svn ]"
9
+
10
+ HOBO_REPO = "svn://hobocentral.net/hobo/trunk"
11
+
12
+
13
+ ### Nasty stuff needed for Windows :-( ###
14
+ require 'rbconfig'
15
+
16
+ if Config::CONFIG["arch"] =~ /win32/
17
+ require "win32/registry"
18
+ def system(command)
19
+ win = Win32API.new("crtdll", "system", ['P'], 'L').Call(command)
20
+ end
21
+ end
22
+ ### end nasty stuff ###
23
+
24
+
25
+ def command(s)
26
+ ok = system(s)
27
+ exit(1) unless ok
28
+ end
29
+
30
+ if ARGV.length == 0
31
+ puts USAGE
32
+ exit 1
33
+ end
34
+
35
+ app_path = ARGV.shift
36
+
37
+ user_model = "user"
38
+ hobo_svn = false
39
+
40
+ until ARGV.empty?
41
+ case ARGV.shift
42
+ when "--user-model"
43
+ arg = ARGV.shift
44
+ user_model = arg == "false" ? nil : arg
45
+ when "--svn"
46
+ hobo_svn = true
47
+ else
48
+ puts USAGE
49
+ exit 1
50
+ end
51
+ end
52
+
53
+ command("rails #{app_path}")
54
+
55
+ Dir.chdir(app_path) do
56
+ if hobo_svn
57
+ puts "\nInstalling Hobo plugin via svn checkout...\n"
58
+ command("svn co #{HOBO_REPO} vendor/plugins/hobo")
59
+ else
60
+ puts "\nInstalling Hobo plugin from gem...\n"
61
+ FileUtils.cp_r File.join(SRC_FILES, "plugin"), "vendor/plugins/hobo"
62
+ end
63
+
64
+ gen = "ruby #{File.join('script', 'generate')}"
65
+
66
+ puts "\nInitialising Hobo...\n"
67
+ command("#{gen} hobo --add-routes")
68
+
69
+ puts "\nInstalling Hobo Rapid and default theme...\n"
70
+ command("#{gen} hobo_rapid --import-tags")
71
+
72
+ if user_model
73
+ puts "\nCreating #{user_model} model and controller...\n"
74
+ command("#{gen} hobo_user_model #{user_model}")
75
+ command("#{gen} hobo_model_controller #{user_model}")
76
+ end
77
+
78
+ puts "\nCreating standard pages...\n"
79
+ command("#{gen} hobo_front_controller front " +
80
+ "#{'--no-user' unless user_model} --delete-index --add-routes")
81
+ end
@@ -0,0 +1,963 @@
1
+ === Release 0.5.3 ===
2
+
3
+ Core tags
4
+
5
+ Fix: <show> tag was broken - it wasn't displaying the surrounding
6
+ <span> or any associations
7
+
8
+ <show> now handles all kinds of Numeric types
9
+
10
+
11
+ DRYML
12
+
13
+ DRYML Build cache: reloading unchanged DRYML files in dev mode is
14
+ now *much* faster.
15
+
16
+
17
+ Model extensions
18
+
19
+ Fixes to the id_name feature
20
+
21
+
22
+ Hobo model controller
23
+
24
+ Fix: :permission_denied_response was not supported on several
25
+ actions
26
+
27
+
28
+ Hobo Rapid
29
+
30
+ Hobo::Rapid::TYPE_NAMES added - a hash that maps classes to names
31
+ (symbols) that are used when looking for an editor / form field for
32
+ a given type. Allows you to extend the <edit> tag to support your
33
+ own types.
34
+
35
+
36
+ === Release 0.5.2 ===
37
+
38
+ Misuse of classify changed throughout to camelize. Bugs related to
39
+ certain model names fixed as a result.
40
+
41
+ Added Hobo::LazyHash. If a value is a proc, the proc is called on the
42
+ first access of that key, and the result of the proc becomes the
43
+ value. These are used in the new controller customisation mechanism.
44
+
45
+
46
+ Hobo Rapid
47
+
48
+ New ajax options reset_form and refocus_form for ajax forms. Default
49
+ is true
50
+
51
+ toggle: new function like Element.toggle in prototype (Hobo uses the
52
+ css class 'hidden' instead of an inline 'style' attribute.
53
+
54
+ In place editing: various fixes related to HTML/URL encoding.
55
+
56
+ New option 'fade' to delete button. Pass fade="#false" to supress
57
+ the fade effect.
58
+
59
+ <hobo_rapid_javascripts> now takes an attribute tiny_mce. Set to
60
+ true to enable TinyMCE support for html editors.
61
+
62
+ <hobo_rapid_javascripts> within the <page> tag now available as
63
+ inner-tag 'rapid_javascripts'. e.g. you can do
64
+
65
+ <page rapid_javascripts.tiny_mce="#true">
66
+
67
+ to enable TinyMCE support.
68
+
69
+ Removed helper current_user_in?
70
+
71
+ Editors now have a css class added automatically:
72
+ "<class>_<feild>_editor", e.g. "person_name_editor"
73
+
74
+ In place editors now wrap the content in a div if the editor will be
75
+ a textarea or an html editor (was a span).
76
+
77
+ All the buttons now have automatically added css classes like
78
+ "delete_person_button", "create_person_button".
79
+
80
+ create_button now uses any passed field values in the check for
81
+ create permission.
82
+
83
+ object form now has a css class added: either the model class name, or
84
+ "new_<class>"
85
+
86
+ New tag <remote_method_form> for calling remote methods with parameters, either with a traditional
87
+
88
+
89
+ Model Extensions
90
+
91
+ Fix to HasManyAssociation#new (didn't support parameters)
92
+
93
+ Added block queries to has_many associations,
94
+ e.g. post.comments.find { published = 1 }
95
+
96
+ MyModel[...] equivalent to MyModel.find(...) (Thanks to Jamis Buck's
97
+ tip on his blog)
98
+
99
+ New feature: defined scopes
100
+
101
+ Field types set by set_field_type are now inherited
102
+
103
+ Model#conditions { ... } generates an sql where clause from a query
104
+ block.
105
+
106
+ Fix to #subclass_associations with has_many :through
107
+
108
+ Method #changed_fields? to complement #same_fields?. Useful in
109
+ permission methods.
110
+
111
+
112
+ Integration test extensions
113
+
114
+ #visits now can now be given http get parameters
115
+
116
+ #deletes added: bob.deletes(some_object)
117
+
118
+ #calls_method added: bob.calls_method(object, some_method)
119
+
120
+
121
+ General extensions
122
+
123
+ #extract_options_from_args! added to Kernel
124
+
125
+ Object#is_a? extended to support multiple args:
126
+
127
+ if foo.is_a?(Symbol, String)
128
+
129
+ _why's metaid added to Object
130
+
131
+ Added Hash#map_hash. e.g. a new hash with all values incremented
132
+ by 1:
133
+
134
+ my_hash.map_hash {|k, v| v+1}
135
+
136
+
137
+ Controller extensions
138
+
139
+ redirect_to can be passed an object, equivalent to
140
+ redirect_to(object_url(x)), e.g.
141
+
142
+ redirect_to current_user.adverts
143
+
144
+
145
+ Model controllers
146
+
147
+ Removed customisation hooks, create_response,
148
+ invalid_create_response, update_response etc.
149
+
150
+ New mechanism for customising actions.
151
+
152
+ def create
153
+ hobo_create ...customisation args...
154
+ end
155
+
156
+ web_method, show_method, and publish_collection declarations are now
157
+ inherited.
158
+
159
+
160
+ Helpers
161
+
162
+ debug can now be passed multiple values you'd like to inspect
163
+
164
+ param_name_for now accepts a string as well as an array for the
165
+ field path, e.g. param_name_for(current_user, "account.name")
166
+
167
+ Core tags
168
+
169
+ object_link automatically adds a css class "<class>_link",
170
+ e.g. "person_link"
171
+
172
+ Changed default date formatting to to_s(:long) for dates and times.
173
+
174
+ New tag transpose_and_repeat, useful for those tables when you wish
175
+ HTML grouped cells by column instead of by row.
176
+
177
+ New tag if_blank
178
+
179
+
180
+ Permission system
181
+
182
+ Hobo::Undefined#undefined? renamed to hobo_undefined?
183
+
184
+ can_edit? now works better with boolean fields
185
+
186
+ can_call_<method>? renamed to <method>_callable_by?
187
+
188
+
189
+ DRYML
190
+
191
+ Fix: options to inner-tags were leaking through to the HTML output.
192
+
193
+ Debug feature -- if the <def> tag has an attribute
194
+ hobo_debug_source, the generated ERB source will be output to
195
+ logger.debug
196
+
197
+ Dryml now reports an error if a part name occurs more than once
198
+
199
+ Inner tag names can now be generated at runtime, this allows
200
+ e.g. the object_table tag to generate inner-tags on the fly for
201
+ every editor and label:
202
+
203
+ <object_table fields.name_editor.update="my_part" />
204
+
205
+ Go read that last one again - it's awesome
206
+
207
+ New rake tasks
208
+
209
+ environments.rake defines tasks like dev, prod, testing so you can
210
+ e.g.:
211
+
212
+ rake prod db:migrate
213
+
214
+ (thanks to err.the_blog IIRC)
215
+
216
+
217
+ === Release 0.5.1 ===
218
+
219
+ Fix to model extensions: hobo_user_model generator could not complete
220
+ because an attempt to access the database before the table exists was
221
+ made.
222
+
223
+ === Release 0.5 ===
224
+
225
+ Tabla theme
226
+
227
+ Changed some heading levels to be more logical - e.g. now use H2 and
228
+ H3 inside a panel instead of H1 and H2
229
+
230
+ Various CSS tweaks
231
+
232
+ <page>
233
+
234
+ Upgraded to use inner tags
235
+
236
+ No longer imports public/stylesheets/application.css by default -
237
+ can easily be added using inner-tags
238
+
239
+ <application_nav> and <application_logo> moved into the theme (were
240
+ in Rapid)
241
+
242
+ Frontpage generator
243
+
244
+ Page templates modified to use <:intro>, <:main> etc
245
+
246
+
247
+ hobo_rapid generator
248
+
249
+ --import-tags option will add two tags to application.dryml:
250
+
251
+ <taglib src="plugins/hobo/tags/rapid"/>
252
+ <set_theme name="default"/>
253
+
254
+
255
+ Plugin initialisation
256
+
257
+ Theme no longer set to default in hobo/init.rb. Instead use
258
+ <set_theme> in application.dryml
259
+
260
+
261
+ Core extentions
262
+
263
+ Enumerable#map_with_index
264
+
265
+
266
+ Ajax Mechanism
267
+
268
+ Render parameters (http parameters) are passed in as a hash of
269
+ requests with numeric keys rather than an array.
270
+ (e.g. render[1][id]=foo rather than render[][id]=foo
271
+
272
+ Hobo.ajaxRequest (javascript) now displays error messages in an
273
+ alert box. (Known issue: seems to show these twice for some reason)
274
+
275
+ In-place-editor support extended to allow other parts to be updated at
276
+ the same time.
277
+
278
+ Automatic mechanism for updating multiple displays of the same field
279
+ after an in-place-edit
280
+
281
+ In-place-editor for html fields will now use TinyMCE if installed
282
+ (integrated with Ajax.InPlaceEditor)
283
+
284
+ Select based ajax editor for numbers, suited for small ranges,
285
+ e.g. 1 to 10
286
+
287
+ Hobo.removeButton (javascript) now supports updating of other parts
288
+ along with the removal.
289
+
290
+ Dom attribute "model_id" renamed to "hobo_model_id"
291
+
292
+ Fix to Ajax.InPlaceEditor - no longer removes <p> tags
293
+
294
+ before_ajax hook. This method is called immediately before the ajax
295
+ response is performed. A chance for the controller to make extra
296
+ instance variabled available to the part methods.
297
+
298
+ If a custom JS function is specified for an ajax update
299
+ (render[...][function]=f), this name is no longer camelised - it is
300
+ called as-is.
301
+
302
+ The object (render[...][object]=...) is now allowed to be nil
303
+
304
+ In-place-editor fields now reset automatically to a preset message
305
+ when the field is blank (e.g. "click to edit")
306
+
307
+
308
+ Core helpers
309
+
310
+ Fix: object_url gives correct urls when the action is a web-method
311
+ (controller-name/id/method-name)
312
+
313
+ <show> will wrap the displayed content in a <span> with a
314
+ hobo_model_id. This enables the automatic update of multiple
315
+ displays of a field value after an ajax edit.
316
+
317
+ <show> uses the new type-system added to Hobo models. The main
318
+ benefit is that values that don't come directly from AR should
319
+ display without problem, and more types are supported (e.g. float)
320
+
321
+ <show> supports a format attribute for numbers:
322
+ <show attr="price" format="%.2f"/>
323
+
324
+ <show> will not display password attributes (e.g. in your model
325
+ set_field_type :password => :password)
326
+
327
+ New tags <show_belongs_to> and <show_has_many> can be overriden to
328
+ handle the way these relationships are displayed by <show>
329
+
330
+ display_name moved into core (was in Rapid, but is needed by <show>)
331
+
332
+ display_name uses <show>, so will wrap the name in a span with a
333
+ hobo_model_id
334
+
335
+ <repeat> supports an 'else' attribute, used when the collection is
336
+ empty.
337
+
338
+ Debug methods abort_with and debug are now helpers so they are
339
+ available from views as well as controllers.
340
+
341
+
342
+ User Authentication
343
+
344
+ Username validations are customisable - pass a block to
345
+ set_login_attr and do validations in there. Otherwise default
346
+ validations are used.
347
+
348
+
349
+ Hobo::Controller
350
+
351
+ hobo_ajax_reponse will use @this if no page context is passed
352
+
353
+
354
+ Module defined tags
355
+
356
+ Can provide a predicate as a block, e.g. to have a different nav bar onced logged in.
357
+
358
+ def_tag :nav, (proc {logged_in?}) do ...
359
+ def_tag :nav do ...
360
+
361
+ The tag with no predicate will always take precedence if no
362
+ predicate is true. If the proc has a single parameter, it is
363
+ passed the options hash.
364
+
365
+
366
+ DRYML
367
+
368
+ Changes to taglib cache system.
369
+
370
+ A list of known HTML tags is defined in lib/hobo/static_tags. These
371
+ are available as an array by calling Hobo.static_tags. Any tags
372
+ parsed that are not in here are compiled as method calls. Thus the
373
+ order of tag definitions is no longer as critical, making it easier
374
+ to split large taglibs into multiple files. As a result, tag modules
375
+ no longer need to track defined tags in a module variable.
376
+
377
+ XML comments now passed through to the generated HTML.
378
+
379
+ <set_theme> tag to set current theme. Was previously a configuration
380
+ variable. This way it is easier to change or disable the theme.
381
+
382
+ New feature - inner tags
383
+
384
+ <def> now supports alias_current attribute, e.g.
385
+
386
+ <def tag="page" alias_current="theme_page">
387
+
388
+ This overrides the current <page> definition and makes the old one
389
+ available as <theme_page>
390
+
391
+ <tagbody> supports obj= and attr= at the same time, as with regular
392
+ tag calls
393
+
394
+
395
+
396
+ Hobo models
397
+
398
+ New type system. This is the extended type system that allows you to
399
+ say, e.g. `set_field_type :intro => :html`. Previously this was
400
+ returned as a symbol from MyModel.field_type(:intro). The new system
401
+ uses wrapper types (simple subclasses of String), and modified your
402
+ model to return these. e.g.
403
+
404
+ MyModel.find(:first).intro.class => Hobo::HtmlString
405
+
406
+ There are similar types for textile, markdown, passwords, and text
407
+ (the text type just denotes a longer string, and is used for the
408
+ 'text' sql type).
409
+
410
+
411
+ Hobo model controller
412
+
413
+ `show_method` renamed to `show_action`
414
+
415
+ New class method `publish_collection`. Any `has_many` collections
416
+ are published automatically. This method allows custom collections,
417
+ i.e. model methods that return arrays, to be published also.
418
+
419
+ create action for an STI base-class controller can now be used to
420
+ create subclass instances by passing the 'type' parameter.
421
+
422
+ update action enhanced to allow a full Hobo ajax-reponse (i.e. part
423
+ updates) after in-place-edits.
424
+
425
+ Controllers can define a `find_for_show` method to provide a custom
426
+ instance finder, e.g. a chance to perform eager loading.
427
+
428
+ Association actions now check for permission to view the association
429
+ owner
430
+
431
+
432
+ Model Queries
433
+
434
+ <field>_is predicates now work with belongs_to associations.
435
+
436
+
437
+ Hobo Rapid
438
+
439
+ rapid.dryml split up into rapid.dryml, rapid_pages.dryml
440
+ rapid_editing.dryml and rapid_navigation.dryml
441
+
442
+ New set of tags for creating navigation bars.
443
+
444
+ <no_break> tag replaces spaces with &nbsp; in entire content.
445
+
446
+ <edit> tag customisation - for form fields (i.e. new records), will
447
+ delegate to one of:
448
+
449
+ has_many_field
450
+ belongs_to_field
451
+
452
+ string_field
453
+ textarea_field
454
+ password_field
455
+ html_field
456
+
457
+ boolean_field
458
+
459
+ date_field
460
+ datetime_field
461
+
462
+ integer_field
463
+ float_field
464
+
465
+ Redfine these to customise forms throughout the app.
466
+
467
+ Similarly, editor fields (i.e. ajax fields for existing records)
468
+ use:
469
+
470
+ has_many_editor
471
+ belongs_to_editor
472
+
473
+ string_editor
474
+ textarea_editor
475
+ password_editor
476
+ html_editor
477
+
478
+ boolean_editor
479
+
480
+ datetime_editor
481
+ date_editor
482
+
483
+ integer_editor
484
+ float_editor
485
+
486
+ Redefine these to customise ajax editors throughout the app.
487
+
488
+ Note has_many_field and has_many_editor are just placeholders,
489
+ they are not implemented.
490
+
491
+ <update_button> supports a params attribute, to send extra params
492
+ along with the HTTP PUT.
493
+
494
+ <delete_button> now supports part updates and use of
495
+ Hobo.removeButton together. (i.e. you can have the fade effect and
496
+ also have other parts updated)
497
+
498
+ <object_form> does not create a hidden field for the STI 'type' field.
499
+
500
+
501
+ New feature - Composite models
502
+
503
+ Experimental new feature - mapping tags
504
+
505
+ New feature - Predicate dispatch modules
506
+
507
+
508
+ === Release 0.4.3 ===
509
+
510
+ Front-controller now filters parameter logging so that passwords are
511
+ not logged.
512
+
513
+ Check if a controller is a Hobo model-controller before installing
514
+ Hobo routes.
515
+
516
+ DRYML
517
+
518
+ Can now use obj= and attr= on the same tag, so you can e.g.
519
+
520
+ <edit obj="#@this" attr="name"/>
521
+
522
+ (The alternative, <edit obj="@this.name"> would not work as
523
+ <edit> needs this_field which would be nil)
524
+
525
+ Shorthand obj="page" for obj="#@this"
526
+
527
+ Various fixes and enhancements to the permission system. Things are somewhat
528
+ experimental and subject to change!
529
+
530
+ Core tags/helpers
531
+
532
+ `viewable` method filters a collection down to objects that are
533
+ viewable.
534
+
535
+
536
+ Hobo Rapid:
537
+
538
+ <new_in_collection_page> now includes belongs_to associations in the
539
+ form.
540
+
541
+ Cleanup of form field / editor tags
542
+
543
+ <ul_for> and <table_for> now skip non-viewable objects
544
+
545
+ Fix: even/odd cycle in table_for and ul_for was broken with nested lists/tables.
546
+
547
+ Page navigation enhanced to allow URL query parameters to be
548
+ maintained from page to page.
549
+
550
+ <show_collection_page> now only includes a "New Whatever" link if
551
+ the collection is a "simple" has_many collection (no conditions, not
552
+ :through)
553
+
554
+ <object_link> now has a view attribute to link to alternate views of
555
+ the object (see below: alternate show pages)
556
+
557
+ <object_table>
558
+
559
+ Now allows additional rows to be added by giving a tag-body.
560
+
561
+ skip_fields attribute to remove fields from the table
562
+
563
+ Better support for confirmation dialogues in <delete_button>
564
+
565
+
566
+ Tabla theme:
567
+
568
+ Increased width to 800px;
569
+
570
+ Small style enhancements
571
+
572
+
573
+ Hobo Module
574
+
575
+ Fix to dom_id for objects in an array that is not an AR association
576
+ (e.g. an array returned by find(:all))
577
+
578
+
579
+ Support for alternative "show" pages. E.g. to add a "profile" page to a User, add
580
+
581
+ show_method :profile
582
+
583
+ To the UsersController and create
584
+ app/views/people/profile.dryml. You also get a named route
585
+ "user_profile" (e.g. you can call user_profile_url(fred) )
586
+
587
+ (Using Hobo Rapid you can link to these with <object_link view="profile"/>)
588
+
589
+ Fix to template lookup for association pages (e.g. posts/12/comments
590
+ and posts/12/comments/new)
591
+
592
+ Support for permission class methods (experimental). If you can define
593
+ permission without access to the object state, you can now do so on
594
+ the class:
595
+
596
+ def self.viewable_by(viewer, field)
597
+ false
598
+ end
599
+
600
+ This helps Hobo in places where there is no object. e.g. in deciding
601
+ whether or not to present a "New Whatsit" link
602
+
603
+ Fix: pagination was broken on index pages with data-filters.
604
+
605
+
606
+ Hobo::ModelController
607
+
608
+ Enhanced to allow updating of date and datetime fields. Dates and
609
+ date-times can be provided either as strings (Hobo will use Chronic
610
+ for parsing if it's installed) or hashes with :year, :month, :day
611
+ etc. keys (as used by the select_date helper).
612
+
613
+ find_by_data_filter renamed to find_with_data_filter and now does a
614
+ non-filtered find if no filters were given in the request.
615
+
616
+ Added count_with_data_filter
617
+
618
+ Fixes to checking create permission when the post parameters
619
+ contains related sub-objects.
620
+
621
+ Access to the new page is forbidden if the current user does not
622
+ have create permission.
623
+
624
+
625
+ Hobo::Model
626
+
627
+ New model queries <field>_starts and <field>_ends
628
+
629
+ The <field>_is query will now use an "IS NULL" query if you pass
630
+ nil.
631
+
632
+ Added support for counts with queries, e.g:
633
+
634
+ User.count { name_starts 't' }
635
+
636
+ Calling `new` on a has_many association (e.g. post.comments.new) has
637
+ enhanced behaviour for new records (those not in the db). Hobo will
638
+ try to set up the reciprocal belongs_to association on the created
639
+ object. This is needed by the permission system when testing
640
+ can_create?
641
+
642
+ #reverse_reflection will attempt to find the reciprocal belongs_to
643
+ association from a has_many association.
644
+
645
+
646
+ Ajax mechanism
647
+
648
+ Fix when using multiple instances of the same part on the same page
649
+ (i.e. when a part_id attribute appears in a loop).
650
+
651
+ Fix when the this_field for the part context is an array index.
652
+
653
+
654
+ Chronic fix to handle dates like "11th Jan" (it can handle "Jan 11th"
655
+ and "11 Jan" but not "11th Jan")
656
+
657
+
658
+ New feature - Integration testing DSL. Adds an easy to use DSL for
659
+ integration tests.
660
+
661
+ Fix: search page in IE
662
+
663
+
664
+
665
+ === Release 0.4.2 ===
666
+
667
+ Fix in permission system
668
+
669
+
670
+
671
+ === Release 0.4.1 ===
672
+
673
+ New feature: "web-methods" -- RPC style actions in model-controllers. Including
674
+ support for ajax responses.
675
+
676
+ New named route "home" to FrontController#index
677
+
678
+ Hobo Rapid:
679
+
680
+ Renamed <object_small> to <object_card>
681
+
682
+ Added support for ajax responses to web-methods
683
+
684
+ Removed <possessive> (too app specific)
685
+
686
+ <object_link> now passes extra options to the generated <a> tag
687
+ (e.g. class, id)
688
+
689
+ Extra options to <edit> are now passed on to the delegate.
690
+
691
+ Naming of edit controls reworked. <editor> is an ajax editor,
692
+ <form_field> is a non-ajax form field, <edit> chooses automatically
693
+ between the two. Other tags renamed too -
694
+ e.g. <in_place_edit_for_boolean> renamed to
695
+ <boolean_checkbox_editor>
696
+
697
+ Support for datetime and date selects in form fields (not editors)
698
+
699
+ Added autosubmit option to autocompleters - submits the form as soon
700
+ as an option is selected.
701
+
702
+ Added confirm option to ajax_updater (wraps call in a JS confirm
703
+ dialogue)
704
+
705
+ More data types supported by <editor> (formerly in_place_edit)
706
+
707
+ New tag <belongs_to_editor>. Currently just delegates to
708
+ <belongs_to_menu_editor> but is intended to switch to an
709
+ autocompleter if there are too many options for a menu.
710
+
711
+ New css classes create_button, update_button, delete_button added to
712
+ button tags.
713
+
714
+ Image attribute for delete_button for <input type="image">
715
+ buttons. Needs implementing on the other buttons (or maybe we should
716
+ be using css styling only!)
717
+
718
+ New tag: <remote_method_button>
719
+
720
+ <object_form> updated to only add hidden tags for fields that don't
721
+ appear in the form.
722
+
723
+ hobo_rapid.js
724
+
725
+ Fix: in-place-edit controls were displaying the JavaScript source of
726
+ an alert message after a validation error.
727
+
728
+ Support for ajax responses to RPC actions.
729
+
730
+ Fix in Hobo.ajaxRequest when no `method` option was given.
731
+
732
+ Hobo.applyEvents can now be given an element or a DOM ID.
733
+
734
+ Hobo.removeButton: changed duration of Fade effect
735
+
736
+ Fix in objectElementFor
737
+
738
+ Re-enabled applyEvents in Hobo.updateElement
739
+
740
+
741
+ Tabla theme
742
+
743
+ Various CSS refinements
744
+
745
+ Added account_nav attribute to <page>
746
+
747
+ Added class attribute to page - applied to body tag
748
+
749
+ Disable account nav if no `login_url` route exists
750
+
751
+
752
+ hobo_user_model generator
753
+
754
+ Migration
755
+
756
+ Changed `login` column to `username`.
757
+
758
+ Changed to use Hobo migration syntax
759
+
760
+ Model: Uses new `set_login_attr`
761
+
762
+
763
+ Plugin initialiser (init.rb)
764
+
765
+ Fixed problem with ordering of requires
766
+
767
+ Eliminated code to load all models at startup (now done on demand in Hobo module)
768
+ This reduces the footprint of Hobo, e.g. for apps that want only DRYML.
769
+
770
+
771
+ ActiveRecord extensions
772
+
773
+ Added HasManyAssociation#new_without_appending. Creates a model with
774
+ the correct belongs_to association but doesn't add it to the
775
+ array. Needed for the permission system.
776
+
777
+ Added #member_class to HasManyAssociation and
778
+ HasManyThroughAssociation - convenience method for
779
+ proxy_reflection.klass
780
+
781
+
782
+ General Ruby extensions
783
+
784
+ Renamed is_in? to in? to conform with ruby-extensions project.
785
+
786
+ Added Module#inheriting_attr_accessor. Creates an attribute accessor
787
+ that looks in the superclass if the attribute does not exist on
788
+ self. Should be used on classes (e.g. inside class << self)
789
+
790
+
791
+ User Authentication
792
+
793
+ The user model can now override the class-method
794
+ `password_validations` to customise those.
795
+
796
+ Virtual fields `password` and `password_confirmation` now declared
797
+ with field type :password. Hobo Rapid will now generate
798
+ password-edit fields for these.
799
+
800
+ Column used for the user-name is now declared by the user-model
801
+ class, e.g.
802
+
803
+ class User; set_login_attr :email; end
804
+
805
+ Extracted acts_as_authenticated controller extensions into
806
+ Hobo::AuthenticationSupport (was in Hobo::Controller)
807
+
808
+ Hobo will manage a last_login_at datetime if such a column exists on
809
+ the user model.
810
+
811
+
812
+ Site-wide search
813
+
814
+ Added message when no results found
815
+
816
+ Remove objects from results that are not viewable by the current_user
817
+
818
+
819
+ Hobo Controller
820
+
821
+ Fix: render_tags - hoboParts JavaScript was rendered multiple times
822
+
823
+ Ajax mechanism updated to support RPC actions.
824
+
825
+
826
+ Core tags & DRYML helpers
827
+
828
+ Fix: per-request cache of current_user was not working
829
+
830
+ Fix: can_update? was broken
831
+
832
+ Fix: can_view_this? handles non-ActiveRecord objects better
833
+
834
+ can_view_this? delegates to can_view if this_parent or this_field
835
+ is null (previously an error).
836
+
837
+ Fix: tag_for_object was broken
838
+
839
+ <show> supports more field types
840
+
841
+ <repeat> now sets the model_id attribute on the repeated element.
842
+
843
+ new conditions <unless_blank>, <unless_empty>, <if_can_edit>
844
+
845
+ add_classes split into two methods, one that modifies the hash
846
+ (add_classes!) and one that generates a new one (add_classes)
847
+
848
+ Made the new object optional on can_update
849
+
850
+ Added a style attribute to <human_type> can be any string method,
851
+ e.g. pluralize, downcase etc.
852
+
853
+
854
+ DRYML
855
+
856
+ Form fields that appear within a DRYML form context are now tracked,
857
+ so that hidden fields can be automatically added for just those
858
+ fields that do not appear in the form.
859
+
860
+ Renamed instance variable to current context to @_this. Was clashing
861
+ with @this page context.
862
+
863
+ Fix: this_type was failing to default to this.class when using the
864
+ obj="" attribute
865
+
866
+ Renamed method _part_context_js to part_context_js
867
+
868
+
869
+ Model Extensions (hobo_model)
870
+
871
+ Renamed set_fields_types to set_field_type
872
+
873
+ Added set_search_columns declaration as a shorthand alternative to
874
+ defining class method search_columns. e.g.
875
+
876
+ class Foo < ActiveRecord::Base
877
+ hobo_model
878
+ set_search_columns :content, :notes
879
+ end
880
+
881
+ An id_name with the :underscore option no longer returns the name
882
+ with underscores by default. By default you get the name as it is in
883
+ the DB, if you call id_name(true) you get it with underscores
884
+ instead of spaces (e.g. for use in URLs).
885
+
886
+ Added Hobo::Model.set_default_order e.g.
887
+
888
+ class User < ActiveRecord::Base
889
+ set_default_order "name"
890
+ end
891
+
892
+ To use: User.find(:all, :order => :default). Default order is used
893
+ by the hobo_model_controller
894
+
895
+ Model Controller
896
+
897
+ Fix: show-collection action (e.g. post/12/comments) now uniquifies
898
+ the collection if the :uniq option was given on the has_many
899
+ declaration.
900
+
901
+ hobo_render now allows the template to be looked for in other
902
+ classes (e.g. in app/views/other_class)
903
+
904
+ Added web_method declaration for RPC-style actions. e.g.
905
+
906
+ class Users < ApplicationController
907
+ web_method :reset_password
908
+ def reset_password
909
+ new_pw = @this.reset_password
910
+ hobo_ajax_response(@this, :password => new_pw)
911
+ end
912
+ end
913
+
914
+ show action now calls permission_denied unless the current user can
915
+ view the object.
916
+
917
+ Added customisation hooks create_response, update_response,
918
+ destroy_response. And for invalid records: invalid_create_response,
919
+ and invalid_update_response. The default response will only happen
920
+ if these methods don't do a render or a redirect.
921
+
922
+ Added before filter to prepare for a web_method
923
+
924
+ Template lookup path changed for
925
+ collections. e.g. /posts/12/comments will now fallback on
926
+ app/vews/comments/show_in_collection and /posts/12/comments/12 will
927
+ fallback on app/views/comments/new_in_collection
928
+
929
+ index action respects the model's default_order
930
+
931
+ Model Queries
932
+
933
+ Renamed predicate in_association to is_in
934
+
935
+ Added predicate not_in
936
+
937
+ Added support for model-defined predicates. Any predicate not found
938
+ will be looked up on the model class.
939
+
940
+ Hobo module
941
+
942
+ Removed guest_user attribute
943
+
944
+ Hobo.models now loads all model classes on demand the first time it
945
+ is called.
946
+
947
+ Removed parentheses from query in find_by_search (SQLite
948
+ compatibility)
949
+
950
+ add_routes now adds routes for web methods
951
+
952
+ can_create? uses new_without_appending when passed a has_many
953
+ association to check if the user is allowed to create an object in
954
+ that collection.
955
+
956
+ can_edit? returns false for polymorphic associations (for now!)
957
+
958
+ can_view? can now handle AR classes (can view instances of this
959
+ class?) and associations (can view items in this association?)
960
+
961
+ Added can_call? permission method for web-methods
962
+
963
+ Added Rakefile with rdoc task