Search code examples
sasscompass-sass

Develop SASS locally, upload on change


I'm a front-end developer transitioning from CSS to SASS. I've got Ruby and Compass installed on my local machine, and Compass "watch" is working beautifully.

However, I still end up with local CSS files which I have to manually FTP over to the server after every tiny change, to see what the change made. I would like to automate this.

I did find this thread which suggested using rsync, but I use Windows and I feel setting up rsync would be really difficult.

Is there some way to automate this using Ruby? The workflow I'm trying to get:

  1. I save the SCSS file in VIM.
  2. Compass Watch detects the change and compiles a new CSS file
  3. Some magical tool detects the change to the CSS file, uploads to my server
  4. I switch over to Chrome, hit F5, and see the change

I can do everything, except for step 3. Any ideas? (That don't involve Linux or Mac-only software?)


Solution

  • Since the question was asked in 2011 Compass has evolved and now provides callback functions to do exactly what was asked in the question:

    For Step 3 you can use on_stylesheet_saved and on_sourcemap_saved callback functions to upload your *.css and *.css.map files to the production server.

    Sample code how to do this can be found in this StackOverflow answer