less / more

less on rails — the official LESS plugin for Ruby on Rails
http://lesscss.org
MIT License
226 stars 41 forks source link

not creating files in non-development mode #27

Open skippy opened 14 years ago

skippy commented 14 years ago

hello, their is a comment in lib/less/more.rb that states:

By default, Less::More.parse will be called for each request in development environment and on application initialization in production environment.

However, this doesn't seem to be the case, and I didn't find any information that highlighted as such. Two suggestions for rails/init.rb

what do you think?

grosser commented 14 years ago

the comment is outdated. You should put the generated css into version control, the idea is that you do not need to install less on all your production servers.

augustl commented 14 years ago

I would never have checked in my .css files or any generated file in a git repo. I'm pretty hardcore on this, though, I don't check in, say, jquery either, I add the jquery repo as a submodule and build it from source.

So, is the current version of the plugin not creating the CSS files when the app boots in prod mode?

augustl commented 14 years ago

Better question: does the plugin now require that you check the generated CSS into the repo?

skippy commented 14 years ago

Grosser: ok. I generally don't like to checkin automated files (so easy for them to become outdated!), and:

BUT, for those of us that like to not check in compiled css, the answer is to include

Less::More.generate_all

in an initializer and call it good

grosser commented 14 years ago

i think a better solution (in case you do not want to checkin the css) is to rake more:generate when deploying, so the modified timestamps stay the same(users do not need to load duplicated css from servers with different mtime), and you do not add more time (in our case ~8 seconds) to the per-process reboot time

augustl commented 14 years ago

Very good point, grosser. Generating CSS belongs in "deployment", not "starting process".

So in order to close this issue, the README needs to be updated :)