View Full Version : Better alternatives to "compass watch"
Steffen Hiller
4 Feb 2011, 10:39 AM
Just wondering if anybody is already using something better than the "compass watch" option?
It gets really annoying. Sometimes I refresh before the compilation has finished, and of course wonder why my style didn't take effect.
I think David Kaneda mentioned the option through compiling right on saving through TextMate.
I couldn't find details on this.
I have another idea, but wanted to hear other ideas / suggestions first.
Thanks.
rdougan
4 Feb 2011, 10:52 AM
You can just do `compass compile` which compiles it.
You could then add this as a command in TextMate with the shortcut being CMD + S (so it is called everytime you save).
Steffen Hiller
4 Feb 2011, 10:57 AM
You can just do `compass compile` which compiles it.
You could then add this as a command in TextMate with the shortcut being CMD + S (so it is called everytime you save).
Mind sharing a quick screenshot of your command settings window?
rdougan
4 Feb 2011, 11:00 AM
http://cl.ly/4OM8/Screen_shot_2011-02-04_at_18.59.27.png
You can also use the current directory using {TEXTMATE_CURRENT_DIR} or something similar. You'll need to check on that..
rdougan
4 Feb 2011, 11:03 AM
It's `$TM_PROJECT_DIRECTORY`.
Steffen Hiller
4 Feb 2011, 11:09 AM
Awesome thanks!
I just did "compass compile ../" but yours works, too.
Though, this is still not perfect, since it still has a slight delay and still could cause refreshing before it has finished compiling.
My idea is to run your ST site through a small Rack server and call compass compile with every request.
Since you make a request to your ST usually only when refreshing, this should be a pretty perfect solution. :)
Will try that out this weekend.
rdougan
4 Feb 2011, 11:10 AM
Which version of compass are you running? The latest beta has a problem where it is quite slow at compiling. With the normal version I have never had any issues with it being too slow, even with a huge SCSS library.
Steffen Hiller
4 Feb 2011, 11:12 AM
Which version of compass are you running? The latest beta has a problem where it is quite slow at compiling. With the normal version I have never had any issues with it being too slow, even with a huge SCSS library.
0.10.6
And you?
rdougan
4 Feb 2011, 11:12 AM
Ah, you should have the normal fast version then.
I'm running --pre as I need the new features in the beta for what I am working on.
Steffen Hiller
4 Feb 2011, 11:14 AM
Ah, you should have the normal fast version then.
I'm running --pre as I need the new features in the beta for what I am working on.
Hm yeah, it's the latest.
Really strange, do you really not feel any delay? I don't have the newest MBP, but a 2nd gen SSD, and generally my computer is that slow.
rdougan
4 Feb 2011, 11:17 AM
To be honest, I haven't messed around with Touch in months so I don't really know. But the Sass in Ext4 is much bigger and I've never noticed it. Maybe I'm just used to it though..
Steffen Hiller
4 Feb 2011, 11:17 AM
Anyway, that would by my solution:
use Rack::Static, :urls => ['/app', '/css', '/images', '/vendor']
run lambda { |env|
`compass compile`
[200, { 'Content-Type' => 'text/html', 'Cache-Control' => 'public, max-age=86400' }, File.open('index.html', File::RDONLY)]
}
Works perfectly.
Steffen Hiller
4 Feb 2011, 11:35 AM
Well, maybe not perfect since you feel a delay while refreshing, but still, at least I don't refresh before compiling anymore.
Maybe it's my not so new MBP after all.
But it has to bear with me until there are new MBPs out.
P.S. I also read somewhere that others felt the same delay, so I figured this might be a common problem.
Powered by vBulletin® Version 4.1.5 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.