Created
August 25, 2010 02:36
-
-
Save arzumy/548735 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Textmate bundle command to change HTML attr to symbol | |
# I normally use this when working with html files from designer | |
# so line like this id="logo" class="left" converted to , :id => "logo", :class => "left" | |
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