I have a rake task that I use for this. It does the entire app/view
tree.
namespace :haml do
rule "" do |t|
if /haml:from:(.*)$/.match(t.name)
format = t.name.split(":").last
Dir["app/views/**/*.#{format}"].each do |file|
system "html2haml -rx #{file} #{file.gsub(/\.#{format}$/,
'.haml')}"
end
end
end
end
rake haml:from:erb
or
rake haml:from:rhtml
Michael
On Jul 28, 2009, at 2:57 PM, mickro wrote:
>
> Hi!
>
> I've tried to convert erb to haml and I found only that :
> http://snippets.dzone.com/posts/show/5449
>
> this way is working. So I'm demanding if is not a better method.
>
> thank you,
>
> micka
>
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Haml" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/haml?hl=en
-~----------~----~----~----~------~----~------~--~---