arzumy
10/27/2010 - 2:24 AM

Textmate Command to Change HTML Attributes to Ruby Options

Textmate Command to Change HTML Attributes to Ruby Options

#!/usr/bin/env ruby

def to_options(str)
  str.gsub(/((\s|^)(\w+))(=)/i)  {|v| ", :#{$3} #{$4}> "}
end

print to_options(STDIN.read)