Skip to content

Instantly share code, notes, and snippets.

@jubishop
Created April 11, 2009 09:17
Show Gist options
  • Save jubishop/93509 to your computer and use it in GitHub Desktop.
Save jubishop/93509 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'rubygems'
require 'rbosa'
raise "Need file name" if (ARGV.empty?)
fileName = ARGV.first
IO.popen("scp '#{fileName}' [email protected]:~/WebServer/public/tmp") {|io| io.read }
IO.popen("rm '#{fileName}'") { |io| io.read }
safari = OSA.app('Safari')
safari.make OSA::Safari::Document
document = safari.documents.last
documents = safari.documents.to_a
if (File.extname(fileName) == ".swf")
document.url = "http://jubishop.com/Flash.html?swf=tmp/#{fileName}"
else
document.url = "http://jubishop.com/tmp/#{fileName}"
end
safari.activate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment