Sha256: 5d83bca5b22df692d7bfc7bbc1d75324a407065972c6a623deea82bf288c64ec

Contents?: true

Size: 1015 Bytes

Versions: 29

Compression:

Stored size: 1015 Bytes

Contents

# frozen_string_literal: false
#
# cgi_runner.rb -- CGI launcher.
#
# Author: IPR -- Internet Programming with Ruby -- writers
# Copyright (c) 2000 TAKAHASHI Masayoshi, GOTOU YUUZOU
# Copyright (c) 2002 Internet Programming with Ruby writers. All rights
# reserved.
#
# $IPR: cgi_runner.rb,v 1.9 2002/09/25 11:33:15 gotoyuzo Exp $

def sysread(io, size)
  buf = ""
  while size > 0
    tmp = io.sysread(size)
    buf << tmp
    size -= tmp.bytesize
  end
  return buf
end

STDIN.binmode

len = sysread(STDIN, 8).to_i
out = sysread(STDIN, len)
STDOUT.reopen(File.open(out, "w"))

len = sysread(STDIN, 8).to_i
err = sysread(STDIN, len)
STDERR.reopen(File.open(err, "w"))

len  = sysread(STDIN, 8).to_i
dump = sysread(STDIN, len)
hash = Marshal.restore(dump)
ENV.keys.each{|name| ENV.delete(name) }
hash.each{|k, v| ENV[k] = v if v }

dir = File::dirname(ENV["SCRIPT_FILENAME"])
Dir::chdir dir

if ARGV[0]
  argv = ARGV.dup
  argv << ENV["SCRIPT_FILENAME"]
  exec(*argv)
  # NOTREACHED
end
exec ENV["SCRIPT_FILENAME"]

Version data entries

29 entries across 23 versions & 5 rubygems

Version Path
rubypitaya-3.12.5 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/webrick-1.7.0/lib/webrick/httpservlet/cgi_runner.rb
devcycle-ruby-server-sdk-2.0.0 vendor/bundle/ruby/3.0.0/gems/webrick-1.7.0/lib/webrick/httpservlet/cgi_runner.rb
rubypitaya-3.12.4 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/webrick-1.7.0/lib/webrick/httpservlet/cgi_runner.rb
rubypitaya-3.12.3 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/webrick-1.7.0/lib/webrick/httpservlet/cgi_runner.rb
rubypitaya-3.12.2 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/webrick-1.7.0/lib/webrick/httpservlet/cgi_runner.rb
tdiary-5.2.4 vendor/bundle/ruby/3.1.0/gems/webrick-1.7.0/lib/webrick/httpservlet/cgi_runner.rb
tdiary-5.2.3 vendor/bundle/ruby/3.1.0/gems/webrick-1.7.0/lib/webrick/httpservlet/cgi_runner.rb
tdiary-5.2.2 vendor/bundle/ruby/3.1.0/gems/webrick-1.7.0/lib/webrick/httpservlet/cgi_runner.rb
tdiary-5.2.1 vendor/bundle/ruby/3.1.0/gems/webrick-1.7.0/lib/webrick/httpservlet/cgi_runner.rb
vagrant-unbundled-2.2.19.0 vendor/bundle/ruby/3.0.0/gems/webrick-1.7.0/lib/webrick/httpservlet/cgi_runner.rb
tdiary-5.2.0 vendor/bundle/ruby/3.0.0/gems/webrick-1.7.0/lib/webrick/httpservlet/cgi_runner.rb
tdiary-5.2.0 vendor/bundle/ruby/2.7.0/gems/webrick-1.7.0/lib/webrick/httpservlet/cgi_runner.rb
vagrant-unbundled-2.2.18.0 vendor/bundle/ruby/3.0.0/gems/webrick-1.7.0/lib/webrick/httpservlet/cgi_runner.rb
tdiary-5.1.7 vendor/bundle/ruby/2.7.0/gems/webrick-1.7.0/lib/webrick/httpservlet/cgi_runner.rb
tdiary-5.1.7 vendor/bundle/ruby/3.0.0/gems/webrick-1.7.0/lib/webrick/httpservlet/cgi_runner.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/webrick-1.7.0/lib/webrick/httpservlet/cgi_runner.rb
tdiary-5.1.6 vendor/bundle/ruby/3.0.0/gems/webrick-1.7.0/lib/webrick/httpservlet/cgi_runner.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/webrick-1.7.0/lib/webrick/httpservlet/cgi_runner.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/2.7.0/gems/webrick-1.7.0/lib/webrick/httpservlet/cgi_runner.rb
tdiary-5.1.5 vendor/bundle/ruby/2.7.0/gems/webrick-1.7.0/lib/webrick/httpservlet/cgi_runner.rb