Sha256: 45fac175d54b57382db95cc298029734ea533135ac222cfceef35ef2b20ac9fc

Contents?: true

Size: 489 Bytes

Versions: 2

Compression:

Stored size: 489 Bytes

Contents

require 'sinatra'
require 'haml'

class Mercury < Sinatra::Default
  set :root,  %x["pwd"].gsub("\n",'')
  set :public, File.dirname(__FILE__) + '/public'

  get '/*' do
    unless params["splat"][0].empty?
      haml params["splat"][0].to_sym, :layout => open(File.dirname(__FILE__) + '/views/layout.haml','r').read
    else
      haml open(File.dirname(__FILE__) + '/views/index.haml','r').read, :layout => open(File.dirname(__FILE__) + '/views/layout.haml','r').read
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mercury-0.4.1 lib/mercury.rb
mercury-0.2.4 lib/mercury.rb