class Gumdrop::Server

Public Instance Methods

get_content_path(file_path, site) click to toggle source
# File lib/gumdrop/server.rb, line 92
def get_content_path(file_path, site)
  keys= [
    file_path,
    "#{file_path}.html",
    "#{file_path}/index.html"
  ]
  if file_path == ""
    "index.html"
  else
    keys.detect {|k| site.contents.has_key?(k) } or file_path
  end
end
handle_proxy(params, env) click to toggle source
# File lib/gumdrop/server.rb, line 105
def handle_proxy(params, env)
  proxy_to= params[:splat][0]
  proxy_parts= proxy_to.split('/')
  host= proxy_parts.shift
  path_info= "/#{proxy_parts.join('/')}"
  #puts "HOST: #{host}  PATH_INFO: #{path_info}"
  opts={ :to=>host, :path_info=>path_info  }
  Gumdrop.handle_proxy opts, proxy_to, env
end
static_asset(file_path) click to toggle source
# File lib/gumdrop/server.rb, line 115
def static_asset(file_path)
  return false if file_path.nil? or File.extname(file_path).nil?
  STATIC_ASSETS.include? File.extname(file_path).to_s
end