Find file
Fetching contributors…
Cannot retrieve contributors at this time
48 lines (44 sloc) 1.33 KB
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "">
<plist version="1.0">
<string>#!/usr/bin/env ruby
# be smart, dont print something if we already have..
$write_count = 0
def STDOUT.write(what)
$write_count += 1
# execure the code
# insert a space if input was a selection, if it was a line insert \n
print(ENV['TM_SELECTED_TEXT'] ? " " : "\n")
r = eval(
rescue Object
r = $!.class.to_s
# try to_s, if it doesnt work use inspect
# Array and Hash are shown via inspect because they look better with formating
# do this just if the script did not print anything itself
if $write_count == 1
print( (r.class != Hash and r.class != Array and not r.nil? and r.respond_to? :to_s) ? r.to_s : r.inspect )
print( "\n" ) unless ENV.has_key?('TM_SELECTED_TEXT')
<string>Execute Line / Selection as Ruby</string>