This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'bundler/setup' | |
require 'sinatra/base' | |
require 'rack/contrib' | |
# The project root directory | |
$root = ::File.dirname(__FILE__) | |
class SinatraStaticServer < Sinatra::Base | |
get(/.+/) do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module CuntCatcher | |
def cunt | |
warn "I'm guessing you meant 'count'?" | |
count | |
end | |
end | |
class Object | |
include CuntCatcher | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def render_once options = nil, extra_options = {}, &block | |
@rendered_once ||= [] | |
args = [options, extra_options] | |
return '' if @rendered_once.include?(args.hash) | |
@rendered_once << args.hash | |
render options, extra_options, &block | |
end |