Hi Everyone,

Because I develop for a php CMS I have converted all my html stuff to
HAML ( of course ;))
Now Only I have a problem ,
Currently I copy and paste the html generated from my app in the
correct php templates, I try to automate this so I can
generate correct workign files for my CMS from my haml directory path.

So Im trying to create a shell script that:

# goes to a complete directory path and all subdirectory's
# reads every haml file and outputs this file as a html file
(with .php extension ) inside /some/path/output/
# preserves the subdirectory where the HAML file was in

For example

/content/
  frontpage.html.haml
  /blocks
     sidebar.html.haml
     navigation.html.haml


Should output towards:

/usr/local/apache/zend/website/content
                     frontpage.html
                    /blocks
                      sidebar.html
                     navigation.html




This is the best So far I came up with,


#!/usr/bin/env ruby
class ToHaml
  def initialize(path)
    @path = path
  end

  def convert!

    Dir["#...@path}/**/*.haml"].each do |file|
      'haml  #{file} #{file.gsub(/\.haml$/, '.php')}'


    end
  end
end


-- 
You received this message because you are subscribed to the Google Groups 
"Haml" group.
To post to this group, send email to h...@googlegroups.com.
To unsubscribe from this group, send email to haml+unsubscr...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/haml?hl=en.

Reply via email to