hobo 2.0.0.pre1 → 2.0.0.pre2

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES-1.4.txt CHANGED
@@ -1,8 +1,8 @@
1
- Hobo 1.4 Changes
1
+ Hobo 2.0 Changes
2
2
  {: .document-title}
3
3
 
4
- Documents the changes made in Hobo 1.4 and the changes required to
5
- migrate applications to Hobo 1.4
4
+ Documents the changes made in Hobo 2.0 and the changes required to
5
+ migrate applications to Hobo 2.0
6
6
 
7
7
  Contents
8
8
  {: .contents-heading}
@@ -12,9 +12,13 @@ Contents
12
12
 
13
13
  # Installation
14
14
 
15
+ Meta tags: note for collaborators. A meta-tag looks like this {.done}. It's added after a paragraph with no blank spaces. The tags that we support are: {.ruby} {.javascript} {.dryml} and {.diff} for code highlighting. {.todo}, {.done}, {.check}, {.part} and {.nomove} indicate documentation progress moving into the Hobo manuals. {.check} means that it's probably done. {.part} means that it's partly done. {.nomove} means that this section only needs to exist in this CHANGES document. Finally, {.hidden} is used for paragraphs like this one that shouldn't show up on the website.
16
+ {.hidden}
17
+
15
18
  ## Creating a new application
19
+ {.part}
16
20
 
17
- Hobo 1.4 gems have not yet been released, so the standard instructions
21
+ Final hobo 2.0 gems have not yet been released, so the standard instructions
18
22
  of "gem install hobo; hobo new foo" do not yet work.
19
23
 
20
24
  If you're on Linux you'll have to install a javascript runtime.
@@ -54,9 +58,10 @@ version strings for the hobo_* gems with `:git => "git://github.com/tablatom/hob
54
58
  $HOBODEV/hobo/bin/hobo new foo
55
59
 
56
60
  ## Updating a Hobo 1.3 application
61
+ {.nomove}
57
62
 
58
63
  There are several changes that need to be made to your application to
59
- upgrade from Hobo 1.3 to Hobo 1.4. Most of these changes are
64
+ upgrade from Hobo 1.3 to Hobo 2.0. Most of these changes are
60
65
  required by the addition of the asset pipeline which was introduced in
61
66
  Rails 3.1.
62
67
 
@@ -64,7 +69,7 @@ Follow the asset pipeline upgrade steps outlined here:
64
69
  http://guides.rubyonrails.org/asset_pipeline.html#upgrading-from-old-versions-of-rails
65
70
 
66
71
  The easiest way to upgrade an existing Hobo 1.3 application is to
67
- generate a new Hobo 1.4 application and copy differences from the new
72
+ generate a new Hobo 2.0 application and copy differences from the new
68
73
  app into your existing app.
69
74
 
70
75
  ### Gemfile
@@ -77,31 +82,31 @@ Hobo has also gained several additional gems, so you will have to add
77
82
  dependencies for those. hobo_rapid is the Hobo tag library,
78
83
  hobo_jquery is the javascript for hobo_rapid, and hobo_clean is the
79
84
  default theme. Instead of or as well as hobo_clean you can use
80
- hobo_clean_admin or hobo_clean_sidemenu. Hopefully there will be
81
- additional themes available soon.
85
+ hobo_clean_admin or hobo_clean_sidemenu or hobo_bootstrap.
86
+
87
+ You will also have to ensure that you are using Hobo's fork of will_paginate:
88
+
89
+ gem "will_paginate", :git => "git://github.com/Hobo/will_paginate.git"
82
90
 
83
91
  ### config/
84
92
 
85
93
  All of the changes in config/ are due to the assets pipeline. See
86
94
  http://guides.rubyonrails.org/asset_pipeline.html#upgrading-from-old-versions-of-rails
87
95
 
88
- Additionally, the Hobo 1.4 generator installs the
89
- [rails-dev-tweaks](https://github.com/wavii/rails-dev-tweaks) gem. We
90
- adjust the configuration so that rails-dev-tweaks applies only to
91
- assets, not to XHR.
92
-
93
96
  ### application.dryml or front_site.dryml
94
97
 
95
98
  Replace
96
99
 
97
100
  <set-theme name="clean"/>
98
-
101
+ {.dryml}
102
+
99
103
  with
100
104
 
101
105
  <include gem='hobo_rapid'/>
102
106
  <include gem='hobo_jquery'/>
103
107
  <include gem='hobo_jquery_ui'/>
104
108
  <include gem='hobo_clean'/>
109
+ {.dryml}
105
110
 
106
111
  Note that the default Hobo generation now always creates both a
107
112
  front_site.dryml and an application.dryml, even if you don't create
@@ -111,10 +116,12 @@ Also be aware that application.dryml is no longer loaded automatically
111
116
  if you have a front_site.dryml. Add
112
117
 
113
118
  <include src="application" />
119
+ {.dryml}
114
120
 
115
121
  to your front_site.dryml, your admin_site.dryml, et cetera.
116
122
 
117
123
  ### move public/ to app/assets/
124
+ {.todo}
118
125
 
119
126
  In Rails 3.1, images, javascripts and stylesheets are loaded from
120
127
  app/assets/ rather than from public/ so you'll have to move them.
@@ -137,9 +144,10 @@ on the corresponding subsite.
137
144
  # Changes from Hobo 1.3 & hobo-jquery 1.3
138
145
 
139
146
  ## Javascript framework changed to jQuery
147
+ {.nomove}
140
148
 
141
149
  Hobo 1.3 and earlier versions used prototype.js for its Ajax support.
142
- In Hobo 1.4 all of our javascript code has been rewritten to use
150
+ In Hobo 2.0 all of our javascript code has been rewritten to use
143
151
  jQuery instead of prototype.js.
144
152
 
145
153
  In the process of rewriting the code many tags have been updated to
@@ -148,43 +156,52 @@ been updated to use standard Hobo form AJAX. The most visible of
148
156
  these changes have been to the editors.
149
157
 
150
158
  ## The Asset Pipeline
159
+ {.todo}
160
+
161
+ we should create a (small) chapter on the Hobo asset pipeline layout. see above (move public/ to app/assets/)
162
+ {.hidden}
151
163
 
152
- Hobo 1.4 uses the asset pipeline features introduced in Rails 3.1.
153
- Hobo 1.4 does not work out of the box with the asset pipeline turned
164
+ Hobo 2.0 uses the asset pipeline features introduced in Rails 3.1.
165
+ Hobo 2.0 does not work out of the box with the asset pipeline turned
154
166
  off. It'd certainly be possible to copy all Hobo assets into public/,
155
167
  but you would have to do so manually, there are no longer any rake
156
168
  tasks to do this for you.
157
169
 
158
170
  ## application.dryml is no longer loaded automatically
171
+ {.todo}
159
172
 
160
173
  Hobo 1.3 loaded application.dryml and then X_site.dryml, where X was
161
- front or admin or the name of the current subsite. Hobo 1.4 only
174
+ front or admin or the name of the current subsite. Hobo 2.0 only
162
175
  loads X_site.dryml. If that fails, it loads application.dryml
163
176
  instead.
164
177
 
165
- A new application generated by Hobo 1.4 will have `<include
178
+ A new application generated by Hobo 2.0 will have `<include
166
179
  src="application"/>` in X_site.dryml so that application.dryml is
167
180
  still loaded. When it is loaded is now controlled by the the author
168
181
  rather than always loading first.
169
182
 
170
183
  ## :inverse_of recommended
184
+ {.todo}
171
185
 
172
186
  For correct behaviour, please ensure that all accessible associations
173
187
  have their :inverse_of option set in both directions.
174
188
 
175
189
  ## set-theme deprecated
190
+ {.nomove}
176
191
 
177
192
  The old Hobo theme support has never worked well, and has been
178
193
  replaced. Themes are now Hobo plugins and work like every other Hobo
179
- 1.4 plugin.
194
+ 2.0 plugin.
180
195
 
181
196
  Replace:
182
197
 
183
198
  <set-theme name="clean"/>
199
+ {.dryml}
184
200
 
185
201
  with
186
202
 
187
203
  <include gem="hobo_clean"/>
204
+ {.dryml}
188
205
 
189
206
  and add
190
207
 
@@ -195,12 +212,14 @@ include javascript which would require them to be added to front.js as
195
212
  well.
196
213
 
197
214
  ## default doctype changed
215
+ {.nomove}
198
216
 
199
217
  The default doctype has been changed from `XHTML 1.0 TRANSITIONAL` to
200
218
  `html`, also known as "standards mode" in Internet Explorer 8 and 9
201
219
  and "html5" in other browsers.
202
220
 
203
221
  ## named routes' names changed to use standard Rails names
222
+ {.nomove}
204
223
 
205
224
  The names of named routes generated by Hobo have changed to more
206
225
  closely match the default names generated by the Rails REST route
@@ -250,6 +269,7 @@ receive the following benefits:
250
269
  - code reduction in Hobo
251
270
 
252
271
  ## `remote-method-button` and `update-button` broken
272
+ {.nomove}
253
273
 
254
274
  `remote-method-button`, `update-button` and similar buttons such as
255
275
  `delete-button` were written early in the history of Hobo, before
@@ -257,16 +277,18 @@ standard form/part ajax was supported. These tags are easy to replace
257
277
  with the much more flexible forms.
258
278
 
259
279
  For backwards compatibility, most of these buttons have been updated
260
- to 1.4. However, the little used `remote-method-button` and
261
- `update-button` have not been converted to the 1.4 form.
280
+ to 2.0. However, the little used `remote-method-button` and
281
+ `update-button` have not been converted to the 2.0 form.
262
282
 
263
283
  ## default field-list changed
284
+ {.nomove}
264
285
 
265
286
  The default for `<field-list>` has changed to `<feckless-fieldset>`.
266
287
  The old behaviour is still available in `<field-list-v1>`. Please
267
288
  provide feedback: we are open to reversion before final release.
268
289
 
269
290
  ## Helper rearrangement
291
+ {.todo}
270
292
 
271
293
  In previous versions of Hobo, all Hobo helpers were available in both
272
294
  the controllers and the views. In this version, some helpers are
@@ -286,16 +308,18 @@ config.hobo.include_deprecated_helper.
286
308
 
287
309
  ## Rails 3.2 required
288
310
 
289
- Hobo 1.4 currently requires Rails 3.2 for operation.
311
+ Hobo 2.0 currently requires Rails 3.2 for operation.
290
312
 
291
313
  ## Enhancements
292
314
 
293
315
  ### Nested caching
316
+ {.todo}
294
317
 
295
318
  See the docs for `<nested-cache>` and the blog post I'm going to
296
319
  eventually write...
297
320
 
298
321
  ### push-state
322
+ {.todo}
299
323
 
300
324
  AJAX now supports a new AJAX option 'push-state' if you have
301
325
  History.js installed. It was inspired by [this
@@ -355,6 +379,7 @@ such as IE8, IE9 or Firefox 3, but results in strange looking URL's. See
355
379
  the README for History.js for more details on that behaviour.
356
380
 
357
381
  ### plugin generators
382
+ {.part}
358
383
 
359
384
  Hobo has gained two new generators.
360
385
 
@@ -368,6 +393,7 @@ skeleton for a new plugin. See [the plugin manual page](FIXME) for
368
393
  more details.
369
394
 
370
395
  ### multiple parts
396
+ {.todo}
371
397
 
372
398
  I've updated DRYML so that it emits a different DOM ID if you
373
399
  re-instantiate a part. (The first use of a part retains the DOM
@@ -394,7 +420,57 @@ Example:
394
420
  </div>
395
421
  </collection>
396
422
 
423
+ ### Bottom-loading Javascript
424
+ {.todo}
425
+
426
+ The `<page>` tag has a new attribute: `bottom-load-javascript`. If
427
+ set, Javascript is loaded via a deferred load at the bottom of the
428
+ body rather than being loaded conventionally in the head.
429
+
430
+ You probably want to enable this globally in your application by
431
+ adding this to your application.dryml:
432
+
433
+ <extend tag="page">
434
+ <old-page bottom-load-javascript merge/>
435
+ </extend>
436
+
437
+ Note that if this option is set, the custom-scripts parameter is no
438
+ longer available. There is a new parameter called custom-javascript
439
+ that can be used instead, though.
440
+
441
+ Replace:
442
+
443
+ <custom-scripts:>
444
+ <script type="text/javascript">
445
+ $(document).ready(function() {
446
+ alert('hi');
447
+ });
448
+ </script>
449
+ </custom-scripts:>
450
+
451
+ with:
452
+
453
+ <custom-javascript:>
454
+ alert('hi');
455
+ </custom-javascript:>
456
+
457
+ If you wish to be compatible with both top & bottom loading use:
458
+
459
+ <custom-javascript:>
460
+ $(document).read(function() {
461
+ alert('hi');
462
+ })
463
+ </custom-javascript:>
464
+
465
+ If you were previously loading files via custom-scripts, use the asset
466
+ pipeline instead.
467
+
468
+ Turning on bottom-load will prevent Rails from splitting front.js into
469
+ multiple files even if you enable config.assets.debug in your
470
+ environment.
471
+
397
472
  ### allowing errors in parts
473
+ {.todo}
398
474
 
399
475
  Older versions of Hobo did not render a part update if the update did
400
476
  not pass validation.
@@ -408,6 +484,7 @@ supplied a block to hobo_update you will be responsible for
408
484
  implementing this functionality yourself.
409
485
 
410
486
  ### AJAX file uploads
487
+ {.todo}
411
488
 
412
489
  If you have malsup's form plugin installed, Ajax file uploads should
413
490
  "just work", as long as you don't have debug_rjs turned on in your
@@ -418,6 +495,7 @@ Make sure you're form uses multipart encoding:
418
495
  <form multipart ajax/>
419
496
 
420
497
  ### AJAX events
498
+ {.todo}
421
499
 
422
500
  The standard 'before', 'success', 'done' and 'error' callbacks may
423
501
  still be used. Additionally, the AJAX code now triggers
@@ -439,6 +517,7 @@ itself, and passes the element as an argument.
439
517
  });
440
518
 
441
519
  ### before callback
520
+ {.todo}
442
521
 
443
522
  A new callback has been added to the list of Ajax Callbacks: before.
444
523
  This callback fires before any Ajax is done. If you return false
@@ -447,6 +526,7 @@ explicitly return true if you use it and don't want your ajax
447
526
  cancelled.
448
527
 
449
528
  ### callbacks
529
+ {.todo}
450
530
 
451
531
  Normally in HTML you can attach either a snippet of javascript or a
452
532
  function to a callback.
@@ -465,6 +545,7 @@ Now you can just return the function name:
465
545
  <form ajax success="fbar"/>
466
546
 
467
547
  ### `hide` and `show` ajax options
548
+ {.todo}
468
549
 
469
550
  There are two new ajax options: `hide` and `show`. These are passed
470
551
  directly to the jQuery-UI `hide` and `show` functions. See
@@ -490,6 +571,7 @@ These two options have global defaults which are TBD. They may be overridden by
490
571
  To disable effects entirely: FIXME.
491
572
 
492
573
  ### spinner options
574
+ {.todo}
493
575
 
494
576
  By default, the spinner is now displayed next to the element being
495
577
  updated. Besides the old `spinner-next-to` option, there are a number
@@ -512,15 +594,18 @@ These options may be overridden globally by adding them as attributes to the `pa
512
594
  </extend>
513
595
 
514
596
  ### hjq-datepicker
597
+ {.done}
515
598
 
516
599
  hjq-datepicker now automatically sets dateFormat to the value
517
600
  specified in your translations: (I18n.t :"date.formats.default").
518
601
 
519
602
  ### sortable-collection
603
+ {.done}
520
604
 
521
605
  sortable-collection now supports the standard Ajax callbacks
522
606
 
523
607
  ### delete-button
608
+ {.done}
524
609
 
525
610
  The new `delete-button` behaviour is not as much different from the
526
611
  old `delete-button` as a comparison of the documentation would have
@@ -530,6 +615,7 @@ The `fade` attribute is no longer supported. Instead use the new
530
615
  standard ajax attribute `hide`.
531
616
 
532
617
  ### autocomplete
618
+ {.done}
533
619
 
534
620
  `hjq-autocomplete` has been renamed to `autocomplete`. It has gained
535
621
  the attribute `nil-value` and the ability to work with the standard
@@ -539,6 +625,7 @@ Hobo autocomplete and hobo_completions controller actions.
539
625
  `autocomplete`.
540
626
 
541
627
  ### input-many
628
+ {.done}
542
629
 
543
630
  `hjq-input-many` and `input-many` have been merged into `input-many`.
544
631
  The new standard ajax attributes `hide` and `show` are also now
@@ -556,15 +643,18 @@ Differences from `hjq-input-many`:
556
643
  - new attributes: hide, show
557
644
 
558
645
  ### filter-menu
646
+ {.done}
559
647
 
560
648
  filter-menu now accepts AJAX attributes.
561
649
 
562
650
  ### a
651
+ {.done}
563
652
 
564
653
  the a tag now accepts AJAX attributes. This is especially useful with
565
654
  the new 'push-state' option.
566
655
 
567
656
  ### dialog-box
657
+ {.done}
568
658
 
569
659
  `hjq-dialog` has been renamed to `dialog-box`. (`dialog` has already
570
660
  been taken in HTML5).
@@ -577,11 +667,13 @@ Dialog positioning has been updated and should work better now. See
577
667
  the documentation for more details.
578
668
 
579
669
  ### search-filter
670
+ {.done}
580
671
 
581
672
  The table-plus search filter has been extracted into its own tag for
582
673
  use outside of table-plus. It has also gained a "clear" button.
583
674
 
584
675
  ### live-search
676
+ {.part}
585
677
 
586
678
  `live-search` works in a substantially different fashion now, it has
587
679
  almost completely lost its magic, instead using standard ajax forms
@@ -595,10 +687,12 @@ in hjq-live-search.js -- the hard part will probably be in doing it in
595
687
  a way that works in all possible browsers.
596
688
 
597
689
  ### hot-input
690
+ {.done}
598
691
 
599
692
  see tag documentation
600
693
 
601
694
  ### page-nav
695
+ {.done}
602
696
 
603
697
  The params attribute now defaults to
604
698
  recognize_page_path.slice(:controller,:action,:id).
@@ -607,6 +701,7 @@ Standard form ajax attributes are now also supported, and behave
607
701
  similar to `<a>`.
608
702
 
609
703
  ### query_params
704
+ {.todo}
610
705
 
611
706
  The old query_params helper has been removed. You can use
612
707
  Rails (request.query_parameters | request.request_parameters) instead
@@ -629,6 +724,7 @@ field is named "project.title", parse_sort_param will sort on the
629
724
  column "projects.title".
630
725
 
631
726
  ### controller actions
727
+ {.todo}
632
728
 
633
729
  Hobo no longer attempts to perform its part-based AJAX actions when
634
730
  sent an xhr request. Instead, Hobo performs part-based AJAX when
@@ -659,11 +755,13 @@ model-level permission checking rather than fine grained attribute
659
755
  level permission checking.
660
756
 
661
757
  ### before-unload
758
+ {.check}
662
759
 
663
760
  `<form>` has gained a new option, before-unload, which adds an
664
761
  onbeforeunload helper to the page.
665
762
 
666
763
  ## Editors
764
+ {.todo}
667
765
 
668
766
  Editors are no longer special-cased, they now use the standard DRYML
669
767
  part mechanism.
@@ -692,11 +790,13 @@ using a form would allow reasonable javascript-disabled behaviour.
692
790
  ## Changes behind the scenes
693
791
 
694
792
  ### reloading of part context
793
+ {.todo}
695
794
 
696
795
  [This change](https://github.com/tablatom/hobo/commit/6048925) ensures that
697
796
  DRYML does not reload the part context if it is already in `this`.
698
797
 
699
798
  ### i18n
799
+ {.todo}
700
800
 
701
801
  These commits will require translation updates for languages other
702
802
  than English. (Presumably this list will get larger because right now
@@ -705,6 +805,7 @@ the change is one I could do myself...)
705
805
  - https://github.com/tablatom/hobo/commit/e9460d336ef85388af859e5082763bfae0ad01f5
706
806
 
707
807
  ### controller changes
808
+ {.todo}
708
809
 
709
810
  Due to limitations on Ajax file uploads, multipart forms are not sent with the proper Ajax headers. If your controller action may receive multipart forms, rather than using:
710
811
 
@@ -724,17 +825,19 @@ use
724
825
  for more information see http://jquery.malsup.com/form/#file-upload
725
826
 
726
827
  ### hobo_ajax_response
828
+ {.todo}
727
829
 
728
830
  the `hobo_ajax_response` function now has a different signature.
729
831
  Standard usage doesn't supply any arguments to hobo_ajax_response.
730
832
  This use case has not changed.
731
833
 
732
834
  However, if you have code that supplied arguments to
733
- hobo_ajax_response, that code likely will need to be updated for 1.4.
835
+ hobo_ajax_response, that code likely will need to be updated for 2.0.
734
836
 
735
837
  FIXME: pointer to AJAX background documentation.
736
838
 
737
839
  ### Dryml.render
840
+ {.todo}
738
841
 
739
842
  Dryml.render now has an additional argument: imports. The template
740
843
  environment no longer automatically imports ActionView::Helpers.
@@ -745,6 +848,7 @@ All application helpers are now available in the template
745
848
  environment.
746
849
 
747
850
  ## Attribute Whitelist
851
+ {.todo}
748
852
 
749
853
  Rails 3.2.3 and later changed the default for config.whitelist_attributes to true, so any newly generated Hobo apps will have this feature turned on. Hobo heavily depends on mass attribute assignation, so this may cause inconveniences.
750
854
 
@@ -757,10 +861,12 @@ If you choose not to turn off config.whitelist_attributes, any fields that are n
757
861
  FIXME: pull into separate document, along with interface specs
758
862
 
759
863
  ## Framework Agnosticism
864
+ {.dontmove}
760
865
 
761
866
  jQuery support is being written in a manner that should make it easier to support other frameworks if we ever decide to do so. Basically all this means is that we're annotating our HTML and the javascript is picking up the information from the annotations rather than calling functions or setting variables.
762
867
 
763
868
  ## Unobtrusiveness
869
+ {.todo}
764
870
 
765
871
  The agnosticism is a side benefit -- really the main reason its written this way is so that we're coding using "unobtrusive javascript" techniques.
766
872
 
@@ -800,6 +906,7 @@ contains a typed_id of the current context. This is used to assist
800
906
  tags like `delete-button` with DOM manipulation.
801
907
 
802
908
  ## Compatibility
909
+ {.dontmove}
803
910
 
804
911
  Obviously compatibility with hobo-rapid.js is not going to be
805
912
  maintained, since that's written in prototype.
@@ -809,24 +916,4 @@ switched to using a more standard jQuery plugin style.
809
916
 
810
917
  # Running the integration tests:
811
918
 
812
- hobo-jquery is being tested using capybara & qunit.js.
813
-
814
- Unfortunately, 2 of the integration tests fails on firefox, which
815
- works out of the box, so we also have to install capybara-webkit and
816
- selenium-chrome.
817
-
818
- $ git clone -b hobo-1.4 git://github.com/Hobo/agility-gitorial.git
819
- $ cd agility-gitorial
820
-
821
- Make sure you have the prerequisites for capybara-webkit:
822
- https://github.com/thoughtbot/capybara-webkit/wiki/Installing-QT
823
-
824
- $ bundle install
825
- $ rake db:migrate
826
-
827
- Download the selenium-chrome server and place in your path:
828
- http://code.google.com/p/chromedriver/downloads/list
829
-
830
- $ rake test:integration
831
-
832
- Email the list and/or bryan@larsen.st if you get any failures.
919
+ see https://github.com/tablatom/hobo/integration_tests/agility/README
data/Gemfile ADDED
@@ -0,0 +1,9 @@
1
+ source "http://rubygems.org"
2
+
3
+ gem 'rubydoctest', :git => 'git://github.com/bryanlarsen/rubydoctest.git'
4
+ gem 'rails', '3.2.8'
5
+ gemspec :path => "../dryml"
6
+ gemspec :path => "../hobo_support"
7
+ gemspec :path => "../hobo_fields"
8
+ gemspec
9
+ gem 'will_paginate', :git => 'git://github.com/Hobo/will_paginate.git'
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.0.pre1
1
+ 2.0.0.pre2
data/hobo.gemspec CHANGED
@@ -18,7 +18,10 @@ Gem::Specification.new do |s|
18
18
 
19
19
  s.add_development_dependency('rubydoctest', [">= 1.1.3"])
20
20
  s.add_development_dependency('shoulda', [">= 0"])
21
- s.add_development_dependency('irt', [">= 1.2.10"])
21
+ s.add_development_dependency('irt', ["= 1.2.11"])
22
+ s.add_development_dependency('mocha')
23
+ s.add_development_dependency('sqlite3')
24
+ s.add_development_dependency('yard')
22
25
 
23
26
  s.executables = ["hobo"]
24
27
  s.files = `git ls-files -x #{name}/* -z`.split("\0")
@@ -25,7 +25,9 @@ module Hobo
25
25
  copy_file 'front.js', 'app/assets/javascripts/front.js'
26
26
  copy_file 'gitkeep', 'app/assets/javascripts/front/.gitkeep'
27
27
 
28
+ application "#"
28
29
  application "config.assets.precompile += %w(front.css front.js)"
30
+ application "# Hobo: the front subsite loads front.css & front.js"
29
31
  end
30
32
 
31
33
  end
@@ -14,11 +14,11 @@ module Hobo
14
14
  opts[:version] = Hobo::VERSION
15
15
  say "Installing default plugins for #{opts[:subsite]}..."
16
16
  say "Installing hobo_rapid plugin..."
17
- install_plugin_helper('hobo_rapid', nil, opts.merge(:skip_dryml => true))
17
+ install_plugin_helper('hobo_rapid', nil, opts.merge(:skip_dryml => true, :skip_gem => true))
18
18
  say "Installing hobo_jquery plugin..."
19
- install_plugin_helper('hobo_jquery', nil, opts)
19
+ install_plugin_helper('hobo_jquery', nil, opts.merge(:skip_gem => true))
20
20
  say "Installing hobo_jquery_ui plugin..."
21
- install_plugin_helper('hobo_jquery_ui', nil, opts)
21
+ install_plugin_helper('hobo_jquery_ui', nil, opts.merge(:skip_gem => true))
22
22
 
23
23
  say "Installing #{opts[:theme]} theme..."
24
24
  inject_css_require("jquery-ui/#{opts[:ui_theme]}", opts[:subsite], nil)
@@ -150,10 +150,22 @@ EOI
150
150
  if dryml_only_templates
151
151
  remove_file 'app/views/layouts/application.html.erb'
152
152
  remove_file 'app/helpers/application_helper.rb'
153
- environment "\n config.hobo.dryml_only_templates = true\n"
153
+ environment "#"
154
+ environment "config.hobo.dryml_only_templates = true"
155
+ environment "# Hobo: remove support for ERB templates"
154
156
  end
155
157
  end
156
158
 
159
+ def quiet_assets
160
+ say "Adding quiet_assets gem"
161
+ gem_with_comments('quiet_assets', :group => :development, :comments => "\n# Hobo has a lot of assets. Stop cluttering the log in development mode.")
162
+ end
163
+
164
+ def will_paginate
165
+ say "Adding will_paginate gem"
166
+ gem_with_comments('will_paginate', :git => "git://github.com/Hobo/will_paginate.git", :comments => "\n# Hobo's version of will_paginate is required.")
167
+ end
168
+
157
169
  def front_controller
158
170
  if wizard?
159
171
  say_title 'Front Controller'
@@ -218,8 +230,10 @@ EOI
218
230
  end
219
231
  end
220
232
 
221
- def add_dev_tweaks
222
- invoke 'hobo:dev_tweaks'
233
+ def active_reload_dryml
234
+ environment "#", :env => :development
235
+ environment "config.watchable_dirs[File.join(config.root, 'app/view')] = ['dryml']", :env => :development
236
+ environment "# Hobo: tell ActiveReload about dryml", :env => :development
223
237
  end
224
238
 
225
239
  def generate_migration
@@ -262,7 +276,9 @@ EOI
262
276
  end
263
277
  unless default_locale.blank?
264
278
  default_locale.gsub!(/\:/, '')
279
+ environment "#"
265
280
  environment "config.i18n.default_locale = #{default_locale.to_sym.inspect}"
281
+ environment "#"
266
282
  end
267
283
  ls = (locales - %w[en]).map {|l| ":#{l}" }
268
284
  lstr = ls.to_sentence
@@ -26,7 +26,9 @@ module Generators
26
26
 
27
27
  template "controller.rb.erb", File.join('app/controllers', file_name, "#{file_name}_site_controller.rb")
28
28
 
29
+ application "#"
29
30
  application "config.assets.precompile += %w(#{file_name}.css #{file_name}.js)"
31
+ application "# Hobo: the #{file_name} subsite loads #{file_name}.css & #{file_name}.js"
30
32
  end
31
33
 
32
34
  hook_for :test_framework, :as => :controller do | instance, controller_test |
data/lib/hobo.rb CHANGED
@@ -4,7 +4,6 @@ require 'dryml'
4
4
  gem 'will_paginate', ">= 3.0"
5
5
  require 'will_paginate'
6
6
  require 'hobo/extensions/enumerable'
7
- require 'hobo/extensions/array'
8
7
 
9
8
  ActiveSupport::Dependencies.autoload_paths |= [File.dirname(__FILE__)]
10
9
  ActiveSupport::Dependencies.autoload_once_paths |= [File.dirname(__FILE__)]
@@ -42,7 +41,7 @@ module Hobo
42
41
  search_targets.build_hash do |search_target|
43
42
  conditions = []
44
43
  parameters = []
45
- like_operator = ActiveRecord::Base.connection.adapter_name =~ /postgres/i ? 'ILIKE' : 'LIKE'
44
+ like_operator = ActiveRecord::Base.connection.adapter_name =~ /postg/i ? 'ILIKE' : 'LIKE'
46
45
  query_words.each do |word|
47
46
  column_queries = search_target.search_columns.map { |column| column == "id" ? "CAST(#{column} AS varchar) #{like_operator} ?" : "#{column} #{like_operator} ?" }
48
47
  conditions << "(" + column_queries.join(" or ") + ")"
@@ -62,7 +62,7 @@ module Hobo
62
62
  def hobo_ajax_response(options={})
63
63
  r = params[:render]
64
64
  if r
65
- ajax_update_response(r.values, options[:results] || {}, options || params[:render_options])
65
+ ajax_update_response(r.is_a?(String) ? [] : r.values, options[:results] || {}, options || params[:render_options])
66
66
  true
67
67
  else
68
68
  false
data/lib/hobo/model.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  module Hobo
2
2
  module Model
3
3
  require 'will_paginate/active_record'
4
+ require 'will_paginate/array'
4
5
 
5
6
  class NoNameError < RuntimeError; end
6
7
 
@@ -14,8 +15,6 @@ module Hobo
14
15
 
15
16
  register_model(base)
16
17
 
17
- patch_will_paginate
18
-
19
18
  base.class_eval do
20
19
  inheriting_cattr_reader :default_order
21
20
  alias_method_chain :attributes=, :hobo_type_conversion
@@ -43,27 +42,6 @@ module Hobo
43
42
  included_in_class_callbacks(base)
44
43
  end
45
44
 
46
- def self.patch_will_paginate
47
- if defined?(WillPaginate::Collection) && !WillPaginate::Collection.respond_to?(:member_class)
48
-
49
- WillPaginate::Collection.class_eval do
50
- attr_accessor :member_class, :origin, :origin_attribute
51
-
52
- # make paginate_by_sql, etc. carry metadata
53
- def replace_with_hobo_metadata(array)
54
- result = replace_without_hobo_metadata(array)
55
- self.member_class = array.try.member_class
56
- self.origin = array.try.origin
57
- self.origin_attribute = array.try.origin_attribute
58
- result
59
- end
60
- alias_method_chain :replace, :hobo_metadata
61
- end
62
-
63
- end
64
- end
65
-
66
-
67
45
  def self.register_model(model)
68
46
  @model_names ||= Set.new
69
47
  @model_names << model.name
@@ -92,7 +92,7 @@ module Hobo
92
92
  def finder_for_belongs_to(record, name)
93
93
  refl = record.class.reflections[name]
94
94
  conditions = ActiveRecord::Associations::BelongsToAssociation.new(record, refl).reflection.send(:conditions)
95
- finder = refl.klass.scoped(:conditions => conditions)
95
+ conditions == [[]] || conditions == [[],[]] ? refl.klass : refl.klass.scoped(:conditions => conditions)
96
96
  end
97
97
 
98
98
  end
@@ -319,7 +319,7 @@ module Hobo
319
319
  return true if check_only
320
320
 
321
321
  def_scope do |query, *fields|
322
- match_keyword = ::ActiveRecord::Base.connection.adapter_name == "PostgreSQL" ? "ILIKE" : "LIKE"
322
+ match_keyword = %w(PostgreSQL PostGIS).include?(::ActiveRecord::Base.connection.adapter_name) ? "ILIKE" : "LIKE"
323
323
 
324
324
  words = query.split
325
325
  args = []
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hobo
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.pre1
4
+ version: 2.0.0.pre2
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-12 00:00:00.000000000 Z
12
+ date: 2012-09-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: hobo_support
@@ -18,7 +18,7 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 2.0.0.pre1
21
+ version: 2.0.0.pre2
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - '='
28
28
  - !ruby/object:Gem::Version
29
- version: 2.0.0.pre1
29
+ version: 2.0.0.pre2
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: hobo_fields
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -34,7 +34,7 @@ dependencies:
34
34
  requirements:
35
35
  - - '='
36
36
  - !ruby/object:Gem::Version
37
- version: 2.0.0.pre1
37
+ version: 2.0.0.pre2
38
38
  type: :runtime
39
39
  prerelease: false
40
40
  version_requirements: !ruby/object:Gem::Requirement
@@ -42,7 +42,7 @@ dependencies:
42
42
  requirements:
43
43
  - - '='
44
44
  - !ruby/object:Gem::Version
45
- version: 2.0.0.pre1
45
+ version: 2.0.0.pre2
46
46
  - !ruby/object:Gem::Dependency
47
47
  name: dryml
48
48
  requirement: !ruby/object:Gem::Requirement
@@ -50,7 +50,7 @@ dependencies:
50
50
  requirements:
51
51
  - - '='
52
52
  - !ruby/object:Gem::Version
53
- version: 2.0.0.pre1
53
+ version: 2.0.0.pre2
54
54
  type: :runtime
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
@@ -58,7 +58,7 @@ dependencies:
58
58
  requirements:
59
59
  - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: 2.0.0.pre1
61
+ version: 2.0.0.pre2
62
62
  - !ruby/object:Gem::Dependency
63
63
  name: will_paginate
64
64
  requirement: !ruby/object:Gem::Requirement
@@ -109,12 +109,28 @@ dependencies:
109
109
  version: '0'
110
110
  - !ruby/object:Gem::Dependency
111
111
  name: irt
112
+ requirement: !ruby/object:Gem::Requirement
113
+ none: false
114
+ requirements:
115
+ - - '='
116
+ - !ruby/object:Gem::Version
117
+ version: 1.2.11
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - '='
124
+ - !ruby/object:Gem::Version
125
+ version: 1.2.11
126
+ - !ruby/object:Gem::Dependency
127
+ name: mocha
112
128
  requirement: !ruby/object:Gem::Requirement
113
129
  none: false
114
130
  requirements:
115
131
  - - ! '>='
116
132
  - !ruby/object:Gem::Version
117
- version: 1.2.10
133
+ version: '0'
118
134
  type: :development
119
135
  prerelease: false
120
136
  version_requirements: !ruby/object:Gem::Requirement
@@ -122,7 +138,39 @@ dependencies:
122
138
  requirements:
123
139
  - - ! '>='
124
140
  - !ruby/object:Gem::Version
125
- version: 1.2.10
141
+ version: '0'
142
+ - !ruby/object:Gem::Dependency
143
+ name: sqlite3
144
+ requirement: !ruby/object:Gem::Requirement
145
+ none: false
146
+ requirements:
147
+ - - ! '>='
148
+ - !ruby/object:Gem::Version
149
+ version: '0'
150
+ type: :development
151
+ prerelease: false
152
+ version_requirements: !ruby/object:Gem::Requirement
153
+ none: false
154
+ requirements:
155
+ - - ! '>='
156
+ - !ruby/object:Gem::Version
157
+ version: '0'
158
+ - !ruby/object:Gem::Dependency
159
+ name: yard
160
+ requirement: !ruby/object:Gem::Requirement
161
+ none: false
162
+ requirements:
163
+ - - ! '>='
164
+ - !ruby/object:Gem::Version
165
+ version: '0'
166
+ type: :development
167
+ prerelease: false
168
+ version_requirements: !ruby/object:Gem::Requirement
169
+ none: false
170
+ requirements:
171
+ - - ! '>='
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
126
174
  description: The web app builder for Rails
127
175
  email: tom@tomlocke.com
128
176
  executables:
@@ -133,10 +181,10 @@ files:
133
181
  - CHANGES-1.1.txt
134
182
  - CHANGES-1.3.txt
135
183
  - CHANGES-1.4.txt
184
+ - Gemfile
136
185
  - LICENSE.txt
137
186
  - README
138
187
  - Rakefile
139
- - TODO-1.4.txt
140
188
  - VERSION
141
189
  - app/controllers/dryml_support_controller.rb
142
190
  - app/helpers/hobo_debug_helper.rb
@@ -179,7 +227,6 @@ files:
179
227
  - lib/generators/hobo/controller/USAGE
180
228
  - lib/generators/hobo/controller/controller_generator.rb
181
229
  - lib/generators/hobo/controller/templates/controller.rb.erb
182
- - lib/generators/hobo/dev_tweaks/dev_tweaks_generator.rb
183
230
  - lib/generators/hobo/front_controller/USAGE
184
231
  - lib/generators/hobo/front_controller/front_controller_generator.rb
185
232
  - lib/generators/hobo/front_controller/templates/controller.rb.erb
@@ -271,7 +318,6 @@ files:
271
318
  - lib/hobo/extensions/active_record/permissions.rb
272
319
  - lib/hobo/extensions/active_record/relation_with_origin.rb
273
320
  - lib/hobo/extensions/active_support/cache/file_store.rb
274
- - lib/hobo/extensions/array.rb
275
321
  - lib/hobo/extensions/enumerable.rb
276
322
  - lib/hobo/extensions/i18n.rb
277
323
  - lib/hobo/model.rb
data/TODO-1.4.txt DELETED
@@ -1,59 +0,0 @@
1
- # TODO
2
-
3
- ## regressions
4
-
5
- * remote-method-button, update-button: normal usages of these tags work, but they do
6
- not work if you ask them to do AJAX
7
- * live-search works, but it's not 'live'. You have to press return
8
- to start the search
9
- * the rapid_summary tags have been moved out
10
- of core Hobo into their own plugin,
11
- https://github.com/Hobo/hobo_summary, which is not yet in a working state
12
-
13
- ## documentation
14
-
15
- * touchpunch for mobile sortables
16
- * document themes/plugins
17
- * FAQ
18
- * agility
19
- * admin subsite
20
- * books
21
- * ajax manual section
22
- * miscellaneous controller extensions
23
- * there's some nice stuff in HoboFields::Model that should be documented & tested
24
-
25
- ## Cookbook
26
-
27
- * search
28
- * actually use Hobo 1.4's new caching abilities
29
- * auto-link tags in manual
30
- * create fakedef manual entries for DRYML tags not in taglibs entry
31
-
32
- ## new features that aren't "done"
33
-
34
- * clean_sidemenu -> plugin
35
- * cache: csrf warning
36
- * monkey patch will_paginate if my patches are not upstreamed
37
-
38
- It's quite likely that some of the new tag definitions are missing
39
- useful id, class, merge or param attributes. This doesn't impact core
40
- functionality, but it does limit your ability to extend the tags. If
41
- you notice any such omissions, please let us know, it is easy to fix..
42
-
43
- ## stuff that we really want to do
44
-
45
- * multiple file support for AJAX uploads
46
- * cache: redis support
47
- * fixup deprecation warnings
48
- * trawl the lighthouse && pull requests
49
- * steal the tags from Portal
50
- * fixup hobo-contrib
51
- * convert paperclip_with_hobo to gem
52
-
53
- ## would be nice:
54
-
55
- * parametrize the clean theme
56
- * create a bootstrap theme
57
- * add theme chooser to setup wizard
58
- * add support for has-one
59
- * convert old Hobo plugins: imaginary-dryml, hoboyui, nice theme
@@ -1,31 +0,0 @@
1
- require 'bundler/cli'
2
- module Hobo
3
- class DevTweaksGenerator < Rails::Generators::Base
4
-
5
- include Generators::Hobo::Plugin
6
-
7
- desc "install the rails-dev-tweaks plugin & configure it"
8
- def add_dev_tweaks
9
- say "Adding rails-dev-tweaks gem"
10
- gem_with_comments('rails-dev-tweaks', :version => "~> 0.6.1", :comments => "\n# The asset pipeline in Rails is really slow in development mode.\n# Hobo has a lot of assets, so speed it up with rails-dev-tweaks", :group => :development)
11
- Bundler.with_clean_env do
12
- run "bundle install"
13
- end
14
-
15
- # environment :env => :development action is broken
16
- inject_into_file "config/environments/development.rb", :before => /end(?!.*end)/m do
17
- """
18
- # By default, rails-dev-tweaks also applies to XHR, but that's not a great default for Hobo
19
- config.dev_tweaks.autoload_rules do
20
- keep :all
21
-
22
- skip '/favicon.ico'
23
- skip :assets
24
- keep :xhr
25
- keep :forced
26
- end
27
- """
28
- end
29
- end
30
- end
31
- end
@@ -1,27 +0,0 @@
1
- # Add support for type metadata to arrays
2
-
3
- require 'will_paginate/array'
4
-
5
- class Array
6
-
7
- attr_accessor :member_class, :origin, :origin_attribute
8
-
9
- def to_url_path
10
- base_path = origin.try.to_url_path
11
- "#{base_path}/#{origin_attribute}" unless base_path.blank?
12
- end
13
-
14
- def typed_id
15
- origin and origin_id = origin.try.typed_id and "#{origin_id}:#{origin_attribute}"
16
- end
17
-
18
- def paginate_with_hobo_metadata(*args, &block)
19
- collection = paginate_without_hobo_metadata(*args, &block)
20
- collection.member_class = member_class
21
- collection.origin = try.proxy_owner
22
- collection.origin_attribute = try.proxy_association._?.reflection._?.name
23
- collection
24
- end
25
- alias_method_chain :paginate, :hobo_metadata
26
-
27
- end