Sha256: 312e5c564b3791659f3ad7eb17ebec6a6e413606bade74e5e70aabd8369f84ca

Contents?: true

Size: 974 Bytes

Versions: 101

Compression:

Stored size: 974 Bytes

Contents

#!/usr/bin/env ruby

def File::realpath(path)
  if File.symlink?(path)
    return self.realpath(File.readlink(path))
  end
  
  return path
end

require File.dirname(File.realpath(__FILE__)) + "/../autoload"

$_FCGI_COUNT = 0
require File.dirname(File.realpath(__FILE__)) + "/include"
$knj_eruby = KnjEruby
FCGI.each_cgi do |fcgi|
  $_FCGI_COUNT += 1
  $_CGI = fcgi
  $_FCGI = fcgi
  
  loadfp = File.dirname(__FILE__) + "/" + File.basename(__FILE__).slice(0..-6) + ".rhtml"
  
  begin
    KnjEruby.fcgi = fcgi
    KnjEruby.load(loadfp)
    
    if KnjEruby.connects["exit"]
      KnjEruby.connects["exit"].each do |block|
        block.call
      end
    end
    
    if $_FCGI_EXIT
      #Kill self! Need to start a new thread because the app as to finish. Give it 0.1 second to do that before killing it.
      Thread.new do
        sleep 0.5
        Process.kill(9, Process.pid)
      end
    end
  rescue Exception => e
    puts e.inspect
    puts e.backtrace
  end
end

Version data entries

101 entries across 101 versions & 1 rubygems

Version Path
knjrbfw-0.0.29 lib/knj/erb/erb_fcgi.rb
knjrbfw-0.0.28 lib/knj/erb/erb_fcgi.rb
knjrbfw-0.0.27 lib/knj/erb/erb_fcgi.rb
knjrbfw-0.0.26 lib/knj/erb/erb_fcgi.rb
knjrbfw-0.0.25 lib/knj/erb/erb_fcgi.rb
knjrbfw-0.0.24 lib/knj/erb/erb_fcgi.rb
knjrbfw-0.0.23 lib/knj/erb/erb_fcgi.rb
knjrbfw-0.0.22 lib/knj/erb/erb_fcgi.rb
knjrbfw-0.0.21 lib/knj/erb/erb_fcgi.rb
knjrbfw-0.0.20 lib/knj/erb/erb_fcgi.rb
knjrbfw-0.0.19 lib/knj/erb/erb_fcgi.rb
knjrbfw-0.0.18 lib/knj/erb/erb_fcgi.rb
knjrbfw-0.0.17 lib/knj/erb/erb_fcgi.rb
knjrbfw-0.0.16 lib/knj/erb/erb_fcgi.rb
knjrbfw-0.0.15 lib/knj/erb/erb_fcgi.rb
knjrbfw-0.0.14 lib/knj/erb/erb_fcgi.rb
knjrbfw-0.0.13 lib/knj/erb/erb_fcgi.rb
knjrbfw-0.0.12 lib/knj/erb/erb_fcgi.rb
knjrbfw-0.0.11 lib/knj/erb/erb_fcgi.rb
knjrbfw-0.0.10 lib/knj/erb/erb_fcgi.rb