If I were you I'd code review all the HAML manually after that kind of thing. html2haml has in the past gotten things a little wrong occasionally in erb files with if statements and nesting - I can't remember specifics.
The way I do this kind of thing is one file at a time and read over it to check. In Vim, I use something like :'<'>!html2haml (i.e. in visual mode, type :!html2haml<CR>) then :Gmove %<tab><C-W>haml<CR> to rename it. On 24 February 2012 01:11, Craig Read <[email protected]> wrote: > Hi, > > Pretty sure somebody has already created a more elegant way to do this (that > I don't know of). > I'm renowned for coming up with patents for disc-like objects with round > holes in the centre of them. ;) > > I wanted to convert all of my erb views to haml, but being lazy, I couldn't > be stuffed doing it file by file. > > I did find this snippet: http://snippets.dzone.com/posts/show/5449 > But it somehow felt dirty shoving a random script in the root of my rails > folder. > > So I rewrote it as a rake task. There is the original version, which > converts each erb file to a separate haml file. > I also wanted it to do a 'git mv' on each file, so butchered it a little to > do that. > > Hope it comes in handy for somebody. :) > > https://gist.github.com/1898581 > > Cheers, > -- > Craig Read > > @Catharz > https://github.com/Catharz > http://stackoverflow.com/users/158893/catharz > > -- > You received this message because you are subscribed to the Google Groups > "Ruby or Rails Oceania" 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/rails-oceania?hl=en. -- You received this message because you are subscribed to the Google Groups "Ruby or Rails Oceania" 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/rails-oceania?hl=en.
