Skip to content
Browse files

Add command to convert a YAML document/selection to a new pretty-prin…

…ted ruby document. Sent in by Rasmus Andersson.

git-svn-id: http://svn.textmate.org/trunk/Bundles/YAML.tmbundle@9598 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
  • Loading branch information...
1 parent 4e89311 commit 827d47a79d7057cd89e2e163684cf4ed7232c725 @infininight infininight committed May 17, 2008
Showing with 31 additions and 0 deletions.
  1. +29 −0 Commands/Convert to Ruby.tmCommand
  2. +2 −0 info.plist
View
29 Commands/Convert to Ruby.tmCommand
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>beforeRunningCommand</key>
+ <string>nop</string>
+ <key>command</key>
+ <string>#!/usr/bin/env ruby
+
+require "yaml"
+require "pp"
+
+puts "#!/usr/bin/env ruby\n\n"
+print "documents = "
+pp(YAML.load_stream(STDIN).documents)</string>
+ <key>input</key>
+ <string>selection</string>
+ <key>keyEquivalent</key>
+ <string>^H</string>
+ <key>name</key>
+ <string>Convert Document / Selection to Ruby</string>
+ <key>output</key>
+ <string>openAsNewDocument</string>
+ <key>scope</key>
+ <string>source.yaml</string>
+ <key>uuid</key>
+ <string>D73CBC77-1692-4981-8C3E-6DCE63F6E2E2</string>
+</dict>
+</plist>
View
2 info.plist
@@ -16,6 +16,7 @@
<string>037242FC-9D77-46A6-94B8-865052595B5A</string>
<string>------------------------------------</string>
<string>331791FA-7335-45B9-865E-760D52294D01</string>
+ <string>D73CBC77-1692-4981-8C3E-6DCE63F6E2E2</string>
<string>------------------------------------</string>
<string>52CDBDBC-91B6-40DD-852A-C92D7D15D6F5</string>
</array>
@@ -32,6 +33,7 @@
<string>78CB70FF-5071-11DA-B402-000A95AF0064</string>
<string>037242FC-9D77-46A6-94B8-865052595B5A</string>
<string>331791FA-7335-45B9-865E-760D52294D01</string>
+ <string>D73CBC77-1692-4981-8C3E-6DCE63F6E2E2</string>
<string>52CDBDBC-91B6-40DD-852A-C92D7D15D6F5</string>
</array>
<key>uuid</key>

0 comments on commit 827d47a

Please sign in to comment.
Something went wrong with that request. Please try again.