Sha256: cec6d1bcf25edcbd0dbd9ac5466f601969f187c66dd4e406be8e33a9d82c9a18

Contents?: true

Size: 490 Bytes

Versions: 2

Compression:

Stored size: 490 Bytes

Contents

#!/usr/bin/env ruby

require 'rubygems'
require 'sinatra'
require 'erb'

disable :logging
STDOUT.sync = true

get '/' do
  erb :index
end

get '/form' do
  erb :form
end

post '/form' do
  erb :form_output
end

get '/table' do
  erb :table
end

get '/upload' do
  erb :upload_form
end

post '/upload' do
  unless params[:upload] &&
      (tmpfile = params[:upload][:tempfile]) &&
      (name = params[:upload][:filename])
    "No file selected"
  else
    "File #{name} uploaded"
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mechanical-cuke-0.3.0 test/fixtures/server/server.rb
mechanical-cuke-0.2.0 test/fixtures/server/server.rb