Skip to content

Instantly share code, notes, and snippets.

@yoshuki
Created April 12, 2009 17:20
Show Gist options
  • Save yoshuki/94073 to your computer and use it in GitHub Desktop.
Save yoshuki/94073 to your computer and use it in GitHub Desktop.
puts_or_println.rb
require 'drb/drb'
require 'java' if defined?(JRUBY_VERSION)
class PutsOrPrintln
def puts_or_println(str)
if defined?(JRUBY_VERSION)
java.lang.System.out.println(str)
"JRuby"
else
puts(str)
"MRI"
end
end
end
if $0 == __FILE__
uri = ARGV.shift
DRb.start_service(uri, PutsOrPrintln.new)
puts DRb.uri
sleep
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment