Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6567621
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:21:34+00:00 2026-05-25T14:21:34+00:00

Currently, Compass is watching the .scss files inside the src folder and automatically updating

  • 0

Currently, Compass is watching the .scss files inside the src folder and automatically updating the cs files. (by typing compass watch myproject).

Is there any way of including haml files in the “watching process”?

(I couldn’t install StaticMatic because I don’t want to install Ruby1.8).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T14:21:35+00:00Added an answer on May 25, 2026 at 2:21 pm

    Firstly, you should be using RVM. Installing any version of Ruby becomes painless.

    Secondly, I just wrote this for myself, using the same ‘fssm’ gem that Compass uses to watch files. Add this to your / create a Rakefile:

    require 'rubygems'
    require 'fssm'
    require 'haml'
    
    class HamlWatcher
      class << self
        def watch
          refresh
          puts ">>> HamlWatcher is watching for changes. Press Ctrl-C to Stop."
          FSSM.monitor('haml', '**/*.haml') do
            update do |base, relative|
              puts ">>> Change detected to: #{relative}"
              HamlWatcher.compile(relative)
            end
            create do |base, relative|
              puts ">>> File created: #{relative}"
              HamlWatcher.compile(relative)
            end
            delete do |base, relative|
              puts ">>> File deleted: #{relative}"
              HamlWatcher.remove(relative)
            end
          end
        end
    
        def output_file(filename)
          # './haml' retains the base directory structure
          filename.gsub(/\.html\.haml$/,'.html')
        end
    
        def remove(file)
          output = output_file(file)
          File.delete output
          puts "\033[0;31m   remove\033[0m #{output}"
        end
    
        def compile(file)
          output_file_name = output_file(file)
          origin = File.open(File.join('haml', file)).read
          result = Haml::Engine.new(origin).render
          raise "Nothing rendered!" if result.empty?
          # Write rendered HTML to file
          color, action = File.exist?(output_file_name) ? [33, 'overwrite'] : [32, '   create']
          puts "\033[0;#{color}m#{action}\033[0m #{output_file_name}"
          File.open(output_file_name,'w') {|f| f.write(result)}
        end
    
        # Check that all haml templates have been rendered.
        def refresh
          Dir.glob('haml/**/*.haml').each do |file|
            file.gsub!(/^haml\//, '')
            compile(file) unless File.exist?(output_file(file))
          end
        end
      end
    end
    
    
    namespace :haml do
      desc "Watch the site's HAML templates and recompile them when they change"
      task :watch do
        require File.join(File.dirname(__FILE__), 'lib', 'haml_watcher')
        HamlWatcher.watch
      end
    end
    

    Run it with:

    rake haml:watch
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can't find much information out there on Android's hardware compass. I keep trying
My jruby rack sinatra compass haml app correctly reloads changes to *.rb files, but
Currently am developing a program that solves (if possible) any given labyrinth of dimensions
Currently in my comp., there are some changes going on regarding project documentation. There
Currently, I have: <html> <div class=yes1><span><img src=img></span></div> </html> <script> var x = ='yes1' var
I am creating a new theme for my cms using scss. I am currently
I have developed a compass based on this example: http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/Compass.html Since my app only
Currently, I don't really have a good method of debugging JavaScript in Internet Explorer and
Currently my workflow with Emacs when I am coding in C or C++ involves
Currently we have a hybrid ASP/PHP setup connecting to a SQL Server 2005 database.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.