Sha256: 64b43a6342915431e5f5a4773532f9b8e407be62a78f104d5fec64d8808d1764

Contents?: true

Size: 416 Bytes

Versions: 7

Compression:

Stored size: 416 Bytes

Contents

# frozen_string_literal: true

require "rack"
require "toycol"

Toycol::Protocol.use(:ruby)

class App
  def call(env)
    case env["REQUEST_METHOD"]
    when "GET"
      case env["PATH_INFO"]
      when "/posts"
        [
          200,
          { "Content-Type" => "text/html" },
          ["I love Ruby!\n", "I've successfully accessed using instance_eval!\n"]
        ]
      end
    end
  end
end

run App.new

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
toycol-1.0.0 examples/unsafe_ruby/config_unsafe_ruby.ru
toycol-0.3.1 examples/unsafe_ruby/config_unsafe_ruby.ru
toycol-0.3.0 examples/unsafe_ruby/config_unsafe_ruby.ru
toycol-0.2.2 examples/unsafe_ruby/config_unsafe_ruby.ru
toycol-0.2.1 examples/unsafe_ruby/config_unsafe_ruby.ru
toycol-0.2.0 examples/unsafe_ruby/config_unsafe_ruby.ru
toycol-0.1.0 examples/unsafe_ruby/config_unsafe_ruby.ru