diff --git a/Commands/Convert Ruby hash to 1_9 syntax.tmCommand b/Commands/Convert Ruby hash to 1_9 syntax.tmCommand new file mode 100644 index 0000000..529231a --- /dev/null +++ b/Commands/Convert Ruby hash to 1_9 syntax.tmCommand @@ -0,0 +1,29 @@ + + + + + beforeRunningCommand + nop + command + #!/usr/bin/env ruby + +print case str = STDIN.read + when /=>/; str.gsub(/:(\w+)[\s]+=>[\s]+/, '\1: ') + when /(\w+):/; str.gsub(/(\w+):(\s*(?:"(?:\\"|[^"])*"|'(?:\\'|[^'])*'|\w+\([^)]*\)|[^,]+))/, ":\\1 =>\\2") + else; str +end + + fallbackInput + line + input + selection + keyEquivalent + ^= + name + Toggle Ruby Hash 1.8/1.9 syntax + output + replaceSelectedText + uuid + F4EEB2B6-07D8-402F-8FC3-79B7308D2576 + + diff --git a/info.plist b/info.plist index 272b90e..c85b2c3 100644 --- a/info.plist +++ b/info.plist @@ -433,6 +433,7 @@ ordering 35222962-C50D-4D58-A6AE-71E7AD980BE4 + F4EEB2B6-07D8-402F-8FC3-79B7308D2576 5289EE40-86B8-11D9-A8D4-000A95E13C98 63F3B3B7-CBE2-426B-B551-657733F3868B 1AD6A138-2E89-4D6A-AB3F-416BF9CE968D