|
Versions Of This Snippet::
Download a raw-text version of this code by clicking on "Download Version"
Latest Snippet Version: :1.0
require 'yaml'
def aorta( obj )
tempfile = File.join('/tmp',"yobj_#{ Time.now.to_i }")
File.open( tempfile, 'w' ) { |f| f << obj.to_yaml }
system( "#{ ENV['EDITOR'] || 'vi' } #{ tempfile }" )
return obj unless File.exists?( tempfile )
content = YAML::load( File.open( tempfile ) )
File.delete( tempfile )
content
end
Submit a new versionYou can submit a new version of this snippet if you have modified it and you feel it is appropriate to share with others..
|
||||||||||||||||||||||||||
