Skip to content

Instantly share code, notes, and snippets.

@arzumy
Created October 27, 2010 02:24
Show Gist options
  • Save arzumy/648281 to your computer and use it in GitHub Desktop.
Save arzumy/648281 to your computer and use it in GitHub Desktop.
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment