Sha256: 5b38028d6b7f59fe8e818e622217e41c6a372f94b887cfe51da75ff72c219b86

Contents?: true

Size: 558 Bytes

Versions: 13

Compression:

Stored size: 558 Bytes

Contents

module JsTestCore
  module Resources
    class NotFound < Resource
      map "*"

      get "/" do
        call
      end

      put "/" do
        call
      end

      post "/" do
        call
      end

      delete "/" do
        call
      end

      def call
        body = Representations::NotFound.new(:message => "File #{request.path_info} not found").to_s
        [
          404,
          {
            "Content-Type" => "text/html",
            "Content-Length" => body.size.to_s
          },
          body
        ]
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 4 rubygems

Version Path
pivotal-screw-unit-0.5.0 vendor/js-test-core/lib/js_test_core/resources/not_found.rb
pivotal-screw-unit-0.5.1 vendor/js-test-core/lib/js_test_core/resources/not_found.rb
pivotal-screw-unit-0.5.2 vendor/js-test-core/lib/js_test_core/resources/not_found.rb
pivotal-screw-unit-0.5.3 vendor/js-test-core/lib/js_test_core/resources/not_found.rb
pivotal-screw-unit-server-0.5.3 vendor/js-test-core/lib/js_test_core/resources/not_found.rb
pivotal-screw-unit-server-0.5.4 vendor/js-test-core/lib/js_test_core/resources/not_found.rb
pivotal-screw-unit-server-0.5.5 vendor/js-test-core/lib/js_test_core/resources/not_found.rb
pivotal-screw-unit-server-0.5.6 vendor/js-test-core/lib/js_test_core/resources/not_found.rb
pivotal-screw-unit-server-0.5.7 vendor/js-test-core/lib/js_test_core/resources/not_found.rb
pivotal-screw-unit-server-0.5.8 vendor/js-test-core/lib/js_test_core/resources/not_found.rb
screw-unit-0.5.1 vendor/js-test-core/lib/js_test_core/resources/not_found.rb
screw-unit-server-0.5.3 vendor/js-test-core/lib/js_test_core/resources/not_found.rb
screw-unit-0.5.2 vendor/js-test-core/lib/js_test_core/resources/not_found.rb