Gemfile adjustsments for new Hobo apps

34 views
Skip to first unread message

Bryan Larsen

unread,
Sep 15, 2012, 9:28:58 AM9/15/12
to hob...@googlegroups.com
With help from Tim & Ignacio, I've been playing around with the
default Gemfile setup for Hobo applications.

I'd like to make the following changes to the Gemfile and configuration:

* remove rails-dev-tweaks. This was appropriate for 3.1, but there
are better mechanisms for 3.2. (AKA ActiveReload)
* Add this line to development.rb for Active Reload to work well:
config.watchable_dirs[File.join(config.root, 'app/views')] = ['dryml']
* Disable asset debugging: most of the time you don't need to know the
file the CSS came from, as you are not going to edit all the rapid
JS/CSS files probably:
config.assets.debug = false
* add the quiet_assets gem to the development group

Add the following lines, but commented out as hints that they should be enabled:

config/development.rb: Change the development asset host so no
cookies go and come back
while on development:
config.action_controller.asset_host = "0.0.0.0:3000"

Gemfile: add thin gem to get rid of the annoying warining Could not
determine content-length of response body. Set content-length of the
response or set Response#chunked = true

Another change I'm thinking of making is creating a hobo-all meta-gem.
It won't actually do anything, but depend on all of the hobo gems
except for the themes so that the default Gemfile is not so cluttered.

thoughts? Anybody else have any other tweaks they generally make to
their configuration?

Bryan

P.S. Yes we're still in code freeze, but this doesn't impact core
Hobo, so I feel justified...

Ignacio Huerta

unread,
Sep 15, 2012, 3:23:29 PM9/15/12
to hob...@googlegroups.com
+1 to the changes.

Regards,
Ignacio

Arnaud Doyen

unread,
Sep 18, 2012, 4:13:24 AM9/18/12
to hob...@googlegroups.com
Hi Bryan,

I agree with you but one think shouldn't be removed :
- rails-dev-tweaks.

Indeed, ActiveReload works well but the assets management is terribly slow with a hobo application if we remove rails-dev-tweaks.

I'm currently creating a new application under hobo 2.0.0.pre1 and tested the suggestion.
With rails-dev-tweaks, I have an answer time of around 1-2 seconds per request.
Without it, the request time dramatically increases to around 15 seconds !

And, for the moment, my application has less than 10 models and around 10 controllers... It's not a huge application.


In addition, maybe you could add:
-will_paginate (your version) since used by page-nav

Also, I'm using ckeditor gem for html type fields and paperclip to enable file upload in ckeditor and other models.

Regards,
Arnaud.

2012/9/15 Ignacio Huerta <ign...@ihuerta.net>
--
You received this message because you are subscribed to the Google Groups "Hobo Dev" group.
To view this discussion on the web visit https://groups.google.com/d/msg/hobodev/-/NSWWuZmrvkcJ.

To post to this group, send email to hob...@googlegroups.com.
To unsubscribe from this group, send email to hobodev+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/hobodev?hl=en.

Bryan Larsen

unread,
Sep 20, 2012, 9:08:28 AM9/20/12
to hob...@googlegroups.com
Did you try the other tweaks like config.assets.debug = false? We
don't have rails-dev-tweaks enabled on any of our Rails 3.2 apps, and
we're not seeing anything like that.

Bryan

Arnaud Doyen

unread,
Sep 20, 2012, 3:53:03 PM9/20/12
to hob...@googlegroups.com
Yes, config.assets.debug=false on development mode.
Maybe it's linked to the fact I'm under windows. It has been always slower with this OS ...

2012/9/20 Bryan Larsen <br...@larsen.st>

Ignacio Huerta

unread,
Sep 20, 2012, 5:16:13 PM9/20/12
to hob...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Oh, the OS info is really interesting.

Is there any chance you might
send us a copy of your app to benchmark it in a couple of systems? Or
maybe at least prepare a super simple app that reproduces the problem?

It might be really helpful to make Hobo faster :)

Regards,
Ignacio

El 20/09/12 21:53, Arnaud Doyen escribi�:
> Yes, config.assets.debug=false on development mode. Maybe it's
> linked to the fact I'm under windows. It has been always slower
> with this OS ...
>
> 2012/9/20 Bryan Larsen <br...@larsen.st <mailto:br...@larsen.st>>
> <mailto:ign...@ihuerta.net>>
> <http://0.0.0.0:3000>"
>>>>
>>>> Gemfile: add thin gem to get rid of the annoying warining
>>>> Could not determine content-length of response body. Set
>>>> content-length of the response or set Response#chunked =
>>>> true
>>>>
>>>> Another change I'm thinking of making is creating a hobo-all
> meta-gem.
>>>> It won't actually do anything, but depend on all of the hobo
>>>> gems except for the themes so that the default Gemfile is
>>>> not so
> cluttered.
>>>>
>>>> thoughts? Anybody else have any other tweaks they
>>>> generally
> make to
>>>> their configuration?
>>>>
>>>> Bryan
>>>>
>>>> P.S. Yes we're still in code freeze, but this doesn't
>>>> impact core Hobo, so I feel justified...
>>>
>>> -- You received this message because you are subscribed to the
> Google Groups
>>> "Hobo Dev" group. To view this discussion on the web visit
>>> https://groups.google.com/d/msg/hobodev/-/NSWWuZmrvkcJ.
>>>
>>> To post to this group, send email to hob...@googlegroups.com
> <mailto:hob...@googlegroups.com>.
>>> To unsubscribe from this group, send email to
>>> hobodev+u...@googlegroups.com
> <mailto:hobodev%2Bunsu...@googlegroups.com>.
>>> For more options, visit this group at
>>> http://groups.google.com/group/hobodev?hl=en.
>>
>>
>> -- You received this message because you are subscribed to the
>> Google
> Groups
>> "Hobo Dev" group. To post to this group, send email to
>> hob...@googlegroups.com
> <mailto:hob...@googlegroups.com>.
>> To unsubscribe from this group, send email to
>> hobodev+u...@googlegroups.com
> <mailto:hobodev%2Bunsu...@googlegroups.com>.
>> For more options, visit this group at
>> http://groups.google.com/group/hobodev?hl=en.
>
> -- You received this message because you are subscribed to the
> Google Groups "Hobo Dev" group. To post to this group, send email
> to hob...@googlegroups.com <mailto:hob...@googlegroups.com>. To
> unsubscribe from this group, send email to
> hobodev+u...@googlegroups.com
> <mailto:hobodev%2Bunsu...@googlegroups.com>. For more options,
> visit this group at http://groups.google.com/group/hobodev?hl=en.
>
>
> -- You received this message because you are subscribed to the
> Google Groups "Hobo Dev" group. To post to this group, send email
> to hob...@googlegroups.com. To unsubscribe from this group, send
> email to hobodev+u...@googlegroups.com. For more options,
> visit this group at http://groups.google.com/group/hobodev?hl=en.

- --
Ignacio Huerta Arteche
http://www.ihuerta.net
Tel�fono: 0034 645 70 77 35
Email realizado con software libre
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlBbh50ACgkQBPlUJ6RHaOSDXACfbLXzqK58gMPi+yIVGFFbwOAY
fccAoK3rlGvR0uLkytRCjL4JrH/9/0ah
=70/U
-----END PGP SIGNATURE-----

Bryan Larsen

unread,
Sep 24, 2012, 3:38:15 PM9/24/12
to hob...@googlegroups.com
Removing ActiveReload halved the time it took to run the integration
tests on my Ubuntu box, so I'm definitely going to remove it from the
default configuration. Perhaps there should be a note somewhere that
Windows users may wish to add it in manually?

Bryan

Ignacio Huerta

unread,
Sep 25, 2012, 5:02:42 AM9/25/12
to hob...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Bryan,

I'm sorry, I think I didn't explain myself right when talking about
ActiveReload. With Rails 3.2, you *don't* have to add ActiveReload to
the Gemfile, because it has been mostly integrated into core Rails:
http://guides.rubyonrails.org/3_2_release_notes.html

To disable it, you have to add config.reload_classes_only_on_change =
false to your config file.

If you try with that setting on and off you'll see that it's much
faster when enabled. Sorry for the confusion!

Regards,
Ignacio

El 24/09/12 21:38, Bryan Larsen escribi�:
- --
Ignacio Huerta Arteche
http://www.ihuerta.net
Tel�fono: 0034 645 70 77 35
Email realizado con software libre
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlBhczIACgkQBPlUJ6RHaORPvwCbBFqXDalxuYYdpXWLxNYmWOv0
38kAoIgIpdms1Sd4zyNI8sdiebd+AWpK
=75oa
-----END PGP SIGNATURE-----

Bryan Larsen

unread,
Sep 25, 2012, 8:01:16 AM9/25/12
to hob...@googlegroups.com
All I'm doing is adding config.watchable_dirs[File.join(config.root,
'app/view')] = ['dryml'] to config/environments/development.rb

Ignacio, please double check the series of commits I pushed last
night. Most of them either impact you or are your suggestions.
Once you've signed up for them, I'll push a 2.0.0.pre2.

thanks,
Bryan


On Tue, Sep 25, 2012 at 5:02 AM, Ignacio Huerta <ign...@ihuerta.net> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi Bryan,
>
> I'm sorry, I think I didn't explain myself right when talking about
> ActiveReload. With Rails 3.2, you *don't* have to add ActiveReload to
> the Gemfile, because it has been mostly integrated into core Rails:
> http://guides.rubyonrails.org/3_2_release_notes.html
>
> To disable it, you have to add config.reload_classes_only_on_change =
> false to your config file.
>
> If you try with that setting on and off you'll see that it's much
> faster when enabled. Sorry for the confusion!
>
> Regards,
> Ignacio
>
> El 24/09/12 21:38, Bryan Larsen escribió:
> Teléfono: 0034 645 70 77 35
> Email realizado con software libre
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.11 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://www.enigmail.net/
>
> iEYEARECAAYFAlBhczIACgkQBPlUJ6RHaORPvwCbBFqXDalxuYYdpXWLxNYmWOv0
> 38kAoIgIpdms1Sd4zyNI8sdiebd+AWpK
> =75oa
> -----END PGP SIGNATURE-----
>
> --
> You received this message because you are subscribed to the Google Groups "Hobo Dev" group.

Ignacio Huerta

unread,
Sep 25, 2012, 1:59:27 PM9/25/12
to hob...@googlegroups.com, Bryan Larsen
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Bryan,

I just checked your commits and they look fine. I tested them with the
app I'm working on right now and after changing will_paginate to use
the "Hobo" repository instead of "bryanlarsen" it worked great.

I also created a new app and it worked nicely. And most importantly,
it's quite fast in dev mode :).

One silly detail, do you think we could add "hero-unit" to the
front/index.dryml page when using the bootstrap theme somehow?. I'm
attaching a screenshot of the result.

Regards,
Ignacio

El 25/09/12 14:01, Bryan Larsen escribi�:
> All I'm doing is adding
> config.watchable_dirs[File.join(config.root, 'app/view')] =
> ['dryml'] to config/environments/development.rb
>
> Ignacio, please double check the series of commits I pushed last
> night. Most of them either impact you or are your suggestions.
> Once you've signed up for them, I'll push a 2.0.0.pre2.
>
> thanks, Bryan
>
>
> On Tue, Sep 25, 2012 at 5:02 AM, Ignacio Huerta
> <ign...@ihuerta.net> wrote: Hi Bryan,
>
> I'm sorry, I think I didn't explain myself right when talking
> about ActiveReload. With Rails 3.2, you *don't* have to add
> ActiveReload to the Gemfile, because it has been mostly integrated
> into core Rails:
> http://guides.rubyonrails.org/3_2_release_notes.html
>
> To disable it, you have to add config.reload_classes_only_on_change
> = false to your config file.
>
> If you try with that setting on and off you'll see that it's much
> faster when enabled. Sorry for the confusion!
>
> Regards, Ignacio
>
> El 24/09/12 21:38, Bryan Larsen escribi�:
>> -- You received this message because you are subscribed to the
>> Google Groups "Hobo Dev" group. To post to this group, send email
>> to hob...@googlegroups.com. To unsubscribe from this group, send
>> email to hobodev+u...@googlegroups.com. For more options,
>> visit this group at
>> http://groups.google.com/group/hobodev?hl=en.
>>
>

- --
Ignacio Huerta Arteche
http://www.ihuerta.net
Tel�fono: 0034 645 70 77 35
Email realizado con software libre
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlBh8P8ACgkQBPlUJ6RHaOSwQgCdFbO8hUqdMCrNCpYiRzeda/Ha
PekAn1YMwmJR6kF+2d+lw7CWOMgORG6w
=ZQVj
-----END PGP SIGNATURE-----
Captura de pantalla de 2012-09-25 19:57:43.png

Bryan Larsen

unread,
Sep 25, 2012, 2:27:10 PM9/25/12
to Ignacio Huerta, hob...@googlegroups.com
>
> One silly detail, do you think we could add "hero-unit" to the
> front/index.dryml page when using the bootstrap theme somehow?. I'm
> attaching a screenshot of the result.

Oooh pretty. that file lives in
hobo/lib/generators/hobo/front_controller/templates/front_index.dryml.
If all you can make that file work with both clean & bootstrap
without being too ugly, we can just modify it there.

The "right" way to do that would be to add a front_controller
generator to the hobo_bootstrap gem and then modify Hobo so that it
preferentially uses the generators from a theme if they exist. But
that's a good amount of work. Probably worth it if there are other
similar changes, but otherwise probably not.

Bryan

Ignacio Huerta

unread,
Sep 26, 2012, 1:04:05 PM9/26/12
to Bryan Larsen, hob...@googlegroups.com
I just made a pull request adding the necessary class. I understand
what the right way is, but right now I agree a small hack is not that
bad :)

Regards,
Ignacio

El 25/09/12 20:27, Bryan Larsen escribi�:
> The "right" way to do that would be to add a front_controller
> generator to the hobo_bootstrap gem and then modify Hobo so that
> it preferentially uses the generators from a theme if they exist.
> But that's a good amount of work. Probably worth it if there are
> other similar changes, but otherwise probably not.

Reply all
Reply to author
Forward
0 new messages