hassle
hassle copied to clipboard
Sass templates in app/stylesheets
This might not be an issue, but if you use Compass in a Rails application and store your Sass stylesheets in an app/stylesheets folder and compile them to public/stylesheets, how would you make this work with Hassle?
+1 I'm trying to work this out now too.
Put this in config.ru if you're using Rails 3, or environment.rb if you're using Rails 2:
Sass::Plugin.options[:template_location] = "./app/stylesheets"
Ran into this issue as well. It fucks up royally when using hashes for the template_location, which pretty much means anyone using compass is screwed. Spent the entire day trying to debug this issue, as its really hard to iterate on heroku (checkin, deploy, wait, comb through logs).
Oh actually I think the problem is that Hassle only goes 1 directory up from the template_location to decide where the tmp folder is, so it's trying to put the stylesheets at /app/tmp/whatever
lol, I just found that out about 10 sec ago. Haha, what a pain in the ass this is!!! fix is close though
I got my stylesheet to render at the root. /style.css Victory!
narrowed the screwed up method to css_location:
def css_location(path)
expanded = File.expand_path(path)
public_dir = File.join(File.expand_path(Dir.pwd), "public")
File.expand_path(compile_location(expanded.gsub(public_dir, ''), '..'))
end
Maybe it would be worth walking the tree upward and testing for tmp directory.
fixed! http://github.com/merbjedi/hassle/commit/e5374c3acd7ad6eb79b289954da058519b673690
Perhaps it would be an advantage to look for the tmp directory in RACK_ROOT?
yup, maybe. not sure though. where is RACK_ROOT set?
Sorry, I think I might have confused it with RAILS_ROOT and RACK_ENV. I'm not sure it even exists...