Sha256: 2bedb27f1558530e02ac707cacc8a2aaf78a5a39d4dae8ae499aaa9da16c10b6

Contents?: true

Size: 497 Bytes

Versions: 96

Compression:

Stored size: 497 Bytes

Contents

module Rack
  module Jasmine

    class Runner
      def initialize(page)
        @page = page
      end

      def call(env)
        @path = env["PATH_INFO"]
        return not_found if @path != "/"
        [
          200,
          { 'Content-Type' => 'text/html'},
          [@page.render]
        ]
      end

      def not_found
        [404, {"Content-Type" => "text/plain",
               "X-Cascade" => "pass"},
               ["File not found: #{@path}\n"]]
      end
    end

  end
end

Version data entries

96 entries across 81 versions & 4 rubygems

Version Path
tdiary-5.2.4 vendor/bundle/ruby/3.1.0/gems/jasmine-2.99.0/lib/rack/jasmine/runner.rb
tdiary-5.2.3 vendor/bundle/ruby/3.1.0/gems/jasmine-2.99.0/lib/rack/jasmine/runner.rb
tdiary-5.2.2 vendor/bundle/ruby/3.1.0/gems/jasmine-2.99.0/lib/rack/jasmine/runner.rb
tdiary-5.2.1 vendor/bundle/ruby/3.1.0/gems/jasmine-2.99.0/lib/rack/jasmine/runner.rb
jasmine-3.99.0 lib/rack/jasmine/runner.rb
tdiary-5.2.0 vendor/bundle/ruby/2.7.0/gems/jasmine-2.99.0/lib/rack/jasmine/runner.rb
tdiary-5.2.0 vendor/bundle/ruby/3.0.0/gems/jasmine-2.99.0/lib/rack/jasmine/runner.rb
jasmine-3.10.0 lib/rack/jasmine/runner.rb
tdiary-5.1.7 vendor/bundle/ruby/3.0.0/gems/jasmine-2.99.0/lib/rack/jasmine/runner.rb
tdiary-5.1.7 vendor/bundle/ruby/2.7.0/gems/jasmine-2.99.0/lib/rack/jasmine/runner.rb
jasmine-3.9.2 lib/rack/jasmine/runner.rb
jasmine-3.9.1 lib/rack/jasmine/runner.rb
jasmine-3.9.0 lib/rack/jasmine/runner.rb
jasmine-3.8.1 lib/rack/jasmine/runner.rb
jasmine-3.8.0 lib/rack/jasmine/runner.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/tdiary-5.1.4/vendor/bundle/ruby/2.7.0/gems/jasmine-2.99.0/lib/rack/jasmine/runner.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/2.7.0/gems/jasmine-2.99.0/lib/rack/jasmine/runner.rb
tdiary-5.1.6 vendor/bundle/ruby/3.0.0/gems/jasmine-2.99.0/lib/rack/jasmine/runner.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/jasmine-2.99.0/lib/rack/jasmine/runner.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/jasmine-2.99.0/lib/rack/jasmine/runner.rb