Sha256: 45d541180c5477897e47dc1c14d61f31c8867905cfec43e6b5957e071ad27aab

Contents?: true

Size: 843 Bytes

Versions: 370

Compression:

Stored size: 843 Bytes

Contents

require "#{File.dirname(__FILE__)}/../testrequest"

$stderr = File.open("#{File.dirname(__FILE__)}/log_output", "w")

class EnvMiddleware
  def initialize(app)
    @app = app
  end

  def call(env)
    # provides a way to test that lint is present
    if env["PATH_INFO"] == "/broken_lint"
      return [200, {}, ["Broken Lint"]]
    # provides a way to kill the process without knowing the pid
    elsif env["PATH_INFO"] == "/die"
      exit!
    end

    env["test.$DEBUG"]      = $DEBUG
    env["test.$EVAL"]       = BUKKIT if defined?(BUKKIT)
    env["test.$VERBOSE"]    = $VERBOSE
    env["test.$LOAD_PATH"]  = $LOAD_PATH
    env["test.stderr"]      = File.expand_path($stderr.path)
    env["test.Ping"]        = defined?(Ping)
    env["test.pid"]         = Process.pid
    @app.call(env)
  end
end

use EnvMiddleware
run TestRequest.new

Version data entries

370 entries across 326 versions & 67 rubygems

Version Path
rack-2.0.9.4 test/rackup/config.ru
rack-2.0.9.3 test/rackup/config.ru
rack-2.0.9.2 test/rackup/config.ru
rack-2.0.9.1 test/rackup/config.ru
mountapi-0.11.1 vendor/bundle/ruby/2.7.0/gems/rack-2.0.5/test/rackup/config.ru
logstash-output-scalyr-0.2.1.beta vendor/bundle/jruby/2.5.0/gems/rack-1.6.6/test/rackup/config.ru
logstash-output-scalyr-0.2.0 vendor/bundle/jruby/2.5.0/gems/rack-1.6.6/test/rackup/config.ru
logstash-output-scalyr-0.2.0.beta vendor/bundle/jruby/2.5.0/gems/rack-1.6.6/test/rackup/config.ru
logstash-output-scalyr-0.1.26.beta vendor/bundle/jruby/2.5.0/gems/rack-1.6.6/test/rackup/config.ru
logstash-output-scalyr-0.1.25.beta vendor/bundle/jruby/2.5.0/gems/rack-1.6.6/test/rackup/config.ru
logstash-output-scalyr-0.1.24.beta vendor/bundle/jruby/2.5.0/gems/rack-1.6.6/test/rackup/config.ru
logstash-output-scalyr-0.1.23.beta vendor/bundle/jruby/2.5.0/gems/rack-1.6.6/test/rackup/config.ru
logstash-output-scalyr-0.1.22.beta vendor/bundle/jruby/2.5.0/gems/rack-1.6.6/test/rackup/config.ru
logstash-output-scalyr-0.1.21.beta vendor/bundle/jruby/2.5.0/gems/rack-1.6.6/test/rackup/config.ru
logstash-output-scalyr-0.1.20.beta vendor/bundle/jruby/2.5.0/gems/rack-1.6.6/test/rackup/config.ru
logstash-output-scalyr-0.1.19.beta vendor/bundle/jruby/2.5.0/gems/rack-1.6.6/test/rackup/config.ru
logstash-output-scalyr-0.1.18.beta vendor/bundle/jruby/2.5.0/gems/rack-1.6.6/test/rackup/config.ru
logstash-output-scalyr-0.1.17.beta vendor/bundle/jruby/2.5.0/gems/rack-1.6.6/test/rackup/config.ru
logstash-output-scalyr-0.1.16.beta vendor/bundle/jruby/2.5.0/gems/rack-1.6.6/test/rackup/config.ru
logstash-output-scalyr-0.1.15.beta vendor/bundle/jruby/2.5.0/gems/rack-1.6.6/test/rackup/config.ru