less / more

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

using with package systems like jammit #26

Closed skippy closed 14 years ago

skippy commented 14 years ago

hi, Jammit looks for files in a particular folder (like public/stylesheets/...) and if that file exists it does a bunch of stuff to it (combines, compresses, embed images or fonts, etc). In development, More uses a controller, so the file doesn't exist on disk and it ends up that jammit won't serve up the file.

the simple solution is to do something like: before_filter { Less::More.parse } unless Less::More.page_cache?

I'm not sure if there is a more elegant, automated way of working with packaging systems like Jammit, but I suspect as long as More goes through the controller in dev instead of creating a file in public/stylesheets (like SASS does) then this is the only solution.

One approach would be to make an option that behaves more like sass and creates the physical file on each request. IF you would like to make that an option in More, let me know and I'll submit a patch.

grosser commented 14 years ago

Give the newest version a try (yesterday or so), this should no longer be an issue...

augustl commented 14 years ago

Skippy, please confirm if the latest version resolves this issue.

skippy commented 14 years ago

that did the trick! I removed my before_filter and it did the trick wonderfully. Out of curiosity, why not make it a before_filter instead? That is a public api and does the trick.

regardless though, thanks for the patch!

augustl commented 14 years ago

grosser has and is doing a great job with the more plugin, three times hooray!

skippy commented 14 years ago

here-here! I raise a cup of coffee to you in salute ;)

grosser commented 14 years ago

refactored using before filter as suggested, much cleaner...