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
logstash-output-scalyr-0.1.14.beta vendor/bundle/jruby/2.5.0/gems/rack-1.6.6/test/rackup/config.ru
logstash-output-scalyr-0.1.13 vendor/bundle/jruby/2.5.0/gems/rack-1.6.6/test/rackup/config.ru
logstash-output-scalyr-0.1.12 vendor/bundle/jruby/2.5.0/gems/rack-1.6.6/test/rackup/config.ru
logstash-output-scalyr-0.1.11.beta vendor/bundle/jruby/2.5.0/gems/rack-1.6.6/test/rackup/config.ru
logstash-output-scalyr-0.1.10.beta vendor/bundle/jruby/2.5.0/gems/rack-1.6.6/test/rackup/config.ru
logstash-output-scalyr-0.1.9 vendor/bundle/jruby/2.5.0/gems/rack-1.6.6/test/rackup/config.ru
logstash-output-scalyr-0.1.8 vendor/bundle/jruby/2.5.0/gems/rack-1.6.6/test/rackup/config.ru
logstash-output-scalyr-0.1.7 vendor/bundle/jruby/2.5.0/gems/rack-1.6.6/test/rackup/config.ru
logstash-output-scalyr-0.1.6 vendor/bundle/jruby/2.5.0/gems/rack-1.6.6/test/rackup/config.ru
logstash-output-newrelic-1.2.0 vendor/bundle/jruby/2.5.0/gems/rack-1.6.6/test/rackup/config.ru
grape-extra_validators-2.0.0 vendor/bundle/ruby/2.6.0/gems/rack-2.0.8/test/rackup/config.ru
logstash-filter-csharp-0.2.1 vendor/bundle/jruby/2.5.0/gems/rack-1.6.6/test/rackup/config.ru
logstash-filter-csharp-0.2.1 vendor/bundle/jruby/2.3.0/gems/rack-1.6.5/test/rackup/config.ru
logstash-filter-csharp-0.2.0 vendor/bundle/jruby/2.3.0/gems/rack-1.6.5/test/rackup/config.ru
logstash-filter-csharp-0.2.0 vendor/bundle/jruby/2.5.0/gems/rack-1.6.6/test/rackup/config.ru
logstash-output-scalyr-0.1.5 vendor/bundle/jruby/2.5.0/gems/rack-1.6.6/test/rackup/config.ru
logstash-output-scalyr-0.1.4 vendor/bundle/jruby/2.5.0/gems/rack-1.6.6/test/rackup/config.ru
logstash-output-scalyr-0.1.3 vendor/bundle/jruby/2.5.0/gems/rack-1.6.6/test/rackup/config.ru
tdiary-5.1.2 vendor/bundle/ruby/2.6.0/gems/rack-2.0.7/test/rackup/config.ru
files.com-1.0.55 docs/vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/test/rackup/config.ru