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