Sha256: 638f6c6e29882305e971f31f0bf304bcc7255420ec082b67e6c8d53cae72e97d

Contents?: true

Size: 1015 Bytes

Versions: 91

Compression:

Stored size: 1015 Bytes

Contents

# frozen_string_literal: true
#
# 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

91 entries across 91 versions & 9 rubygems

Version Path
minato_ruby_api_client-0.2.2 vendor/bundle/ruby/3.2.0/gems/webrick-1.8.1/lib/webrick/httpservlet/cgi_runner.rb
webrick-1.9.1 lib/webrick/httpservlet/cgi_runner.rb
webrick-1.9.0 lib/webrick/httpservlet/cgi_runner.rb
webrick-1.8.2 lib/webrick/httpservlet/cgi_runner.rb
fluent-plugin-nuopenlineage-light-0.1.0 vendor/bundle/ruby/3.3.0/gems/webrick-1.8.1/lib/webrick/httpservlet/cgi_runner.rb
fluent-plugin-openlineage-light-0.1.4 vendor/bundle/ruby/3.3.0/gems/webrick-1.8.1/lib/webrick/httpservlet/cgi_runner.rb
fluent-plugin-openlineage-light-0.1.3 vendor/bundle/ruby/3.3.0/gems/webrick-1.8.1/lib/webrick/httpservlet/cgi_runner.rb
fluent-plugin-openlineage-0.1.0 vendor/bundle/ruby/3.3.0/gems/webrick-1.8.1/lib/webrick/httpservlet/cgi_runner.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/webrick-1.8.1/lib/webrick/httpservlet/cgi_runner.rb
tinymce-rails-7.1.2 vendor/bundle/ruby/3.3.0/gems/webrick-1.8.1/lib/webrick/httpservlet/cgi_runner.rb
shopify-cli-2.36.0 vendor/deps/webrick/lib/webrick/httpservlet/cgi_runner.rb
fluent-plugin-google-cloud-logging-on-prem-0.1.0 vendor/ruby/3.1.0/gems/webrick-1.8.1/lib/webrick/httpservlet/cgi_runner.rb
shopify-cli-2.35.0 vendor/deps/webrick/lib/webrick/httpservlet/cgi_runner.rb
webrick-1.8.1 lib/webrick/httpservlet/cgi_runner.rb
webrick-1.8.0 lib/webrick/httpservlet/cgi_runner.rb
shopify-cli-2.34.0 vendor/deps/webrick/lib/webrick/httpservlet/cgi_runner.rb
shopify-cli-2.33.1 vendor/deps/webrick/lib/webrick/httpservlet/cgi_runner.rb
shopify-cli-2.33.0 vendor/deps/webrick/lib/webrick/httpservlet/cgi_runner.rb
shopify-cli-2.32.1 vendor/deps/webrick/lib/webrick/httpservlet/cgi_runner.rb
shopify-cli-2.32.0 vendor/deps/webrick/lib/webrick/httpservlet/cgi_runner.rb