guard / guard-haml

Watch haml files with guard

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

I'm having trouble generating the html files using guard-haml

tsega opened this issue · comments

I need help configuring guard-haml properly. I'm working with a plain haml files and I want to generate the html file. I've added the following in my guard file

guard 'haml', :run_at_start => true, :notifications => true do
  #watch(/^.+(\.html\.haml)/)
  watch(/^.+\.html\.haml$/)
end

I've tried to run haml index.haml in the terminal and I see it generates the html but it doesn't save on disk. What could be the problem?

You should run $ guard command to use guard-haml.
It will watch to your haml file changes and compile it to html on every save.

I understand that you need to run $ guard once you have Guardfile setup but the file changes are not happening. I use guard-sass and it works fine but guard-haml is not working.

Does it works with default file regexp watch(/^.+(\.html\.haml)/)?
Does guard displays any error messages in console on haml file save?

I've tried the default regexp but it doesn't work. There are no errors.

haml index.haml index.html 

generates the html correctly.

That's really weird. I can't suppose anything else.
Can you push your project to public repo so I can take a closer look?

PS What ruby installed in your environment?

Hi Kugaevsky,

Here is my project page, https://github.com/tsega/oe

$ruby -v gives me:

ruby 1.9.3p194 (2012-04-20 revision 35410) [i686-linux]

$gem list --local

*** LOCAL GEMS ***

.
.
.
guard (1.3.2, 1.3.0)
guard-haml (0.4)
guard-rspec (0.5.5)
guard-sass (1.0.0)
guard-spork (0.3.2)
haml (3.1.7, 3.1.6)
haml-rails (0.3.4)
.
.
.
libnotify (0.7.4, 0.5.9)
.
.
.

Hope this helps.

Gosh! I've found a problem. Just rename your haml file to index.html.haml.
That's all.

It works! Thanks for the help Kugaevsky.