Sha256: 81e34d58b3d8446eda5a1e70afad1c550d6a257d6a653a93e996fde28aa2f2b2

Contents?: true

Size: 397 Bytes

Versions: 3

Compression:

Stored size: 397 Bytes

Contents

module Yarn
  module ErrorPage

    def serve_404_page
      @response.status = 404
      fn = @request[:uri][:path] if @request
      @response.body = ["<html><head><title>404</title></head><body><h1>File #{fn} does not exist.</h1></body><html>"]
    end

    def serve_500_page
      @response.status = 500
      @response.body = ["<h1>Yarn!?</h1>\nA server error occured."]
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
yarn-0.1.0 lib/yarn/error_page.rb
yarn-0.0.9 lib/yarn/error_page.rb
yarn-0.0.2 lib/yarn/error_page.rb