Sha256: 6b991106d7b46526e5e064533e351d418dc0f25928b4d2bd1479c2baeee84440

Contents?: true

Size: 679 Bytes

Versions: 13

Compression:

Stored size: 679 Bytes

Contents

#!/usr/bin/env ruby

require "drb"
require "optparse"

eval = false
wait = true
uri = "drbunix:" + File.expand_path("server.sock", "~/.textbringer")

opt = OptionParser.new
opt.banner = "Usage: tbclient [OPTIONS] FILE"
opt.on("--uri URI", "Specify the URI of the server") do |val|
  uri = val
end
opt.on("-e", "--eval", "Evaluate FILE as a Ruby expression") do
  eval = true
end
opt.on("-n", "--no-wait", "Don't wait for the server") do
  wait = false
end
args = ARGV.dup
opt.parse!(args)
if args.empty?
  STDERR.puts(opt.help)
  exit 1
end
arg = args.first
tb = DRbObject.new_with_uri(uri)
if eval
  puts tb.eval(arg)
else
  tb.visit_file(File.expand_path(arg), wait: wait)
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
textbringer-1.4.1 exe/tbclient
textbringer-1.3.0 exe/tbclient
textbringer-1.2.0 exe/tbclient
textbringer-1.1.2 exe/tbclient
textbringer-1.1.1 exe/tbclient
textbringer-1.1.0 exe/tbclient
textbringer-1.0.9 exe/tbclient
textbringer-1.0.4 exe/tbclient
textbringer-1.0.3 exe/tbclient
textbringer-1.0.2 exe/tbclient
textbringer-1.0.1 exe/tbclient
textbringer-1.0.0 exe/tbclient
textbringer-0.3.2 exe/tbclient