Sha256: 2d59641b1ac5170c7df23bc90b64d0361fc79685b5995edac1b311fcdb8085ad

Contents?: true

Size: 489 Bytes

Versions: 7

Compression:

Stored size: 489 Bytes

Contents

# frozen_string_literal: true

require "rack"
require "toycol"

Toycol::Protocol.use(:rubylike)

class App
  def call(env)
    case env["REQUEST_METHOD"]
    when "GET"
      [
        200,
        { "Content-Type" => "text/html" },
        ["I love ruby!\n", "I love RubyKaigi!\n"]
      ]
    when "OTHER"
      [
        700,
        { "Content-Type" => "text/html" },
        ["Sorry, but I'd like you to speak more like a Ruby programmer...\n"]
      ]
    end
  end
end

run App.new

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
toycol-1.0.0 examples/rubylike/config_rubylike.ru
toycol-0.3.1 examples/rubylike/config_rubylike.ru
toycol-0.3.0 examples/rubylike/config_rubylike.ru
toycol-0.2.2 examples/rubylike/config_rubylike.ru
toycol-0.2.1 examples/rubylike/config_rubylike.ru
toycol-0.2.0 examples/rubylike/config_rubylike.ru
toycol-0.1.0 examples/rubylike/config_rubylike.ru