Sha256: 959929ecc662ffbf8e9c4b4207027b8d39b02e8b7f23610022db0412bf63c40c

Contents?: true

Size: 615 Bytes

Versions: 9

Compression:

Stored size: 615 Bytes

Contents

#!/usr/bin/env ruby
require 'rubygems'
require 'sinatra/base'
require 'vegas'

class SammyTest < Sinatra::Application

  set :public, File.expand_path(File.dirname(__FILE__))

  get '/' do
    content_type 'text/html'
    read_relative_file 'index.html'
  end

  get /\/(lib|vendor)\/(.*)/ do
    filename = File.join(params['captures'][0],params['captures'][1])
    content_type File.extname(filename)
    read_relative_file '..', filename
  end

  def read_relative_file(*args)
    File.read(File.join(File.expand_path(File.dirname(__FILE__)), *args))
  end

end

Vegas::Runner.new(SammyTest, 'sammy_test_server')

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
jim-0.3.3 test/fixtures/sammy-0.5.0/test/test_server
jim-0.3.2 test/fixtures/sammy-0.5.0/test/test_server
jim-0.3.1 test/fixtures/sammy-0.5.0/test/test_server
jim-0.3.0 test/fixtures/sammy-0.5.0/test/test_server
jim-0.3.0.pre test/fixtures/sammy-0.5.0/test/test_server
jim-0.2.3 test/fixtures/sammy-0.5.0/test/test_server
jim-0.2.2 test/fixtures/sammy-0.5.0/test/test_server
jim-0.2.1 test/fixtures/sammy-0.5.0/test/test_server
jim-0.2.0 test/fixtures/sammy-0.5.0/test/test_server