Skip to content

Instantly share code, notes, and snippets.

/garbagetier.rb Secret

Created May 24, 2015 11:39
Show Gist options
  • Save anonymous/c5790c498ee9ecb15491 to your computer and use it in GitHub Desktop.
Save anonymous/c5790c498ee9ecb15491 to your computer and use it in GitHub Desktop.
class Yank < Sinatra::Base
# CONSISTENCY
Tilt.register(Tilt::ERBTemplate, 'html.erb')
helpers do
def config
config = YAML.load_file('./config.yml')
end
def redis
redis ||= Redis.new(:path => config['redis_socket'])
end
end
get '/' do
@host = config['base_url']
erb :index
end
get '/:slug' do
@slug = params[:slug]
Tempfile.open('crate') do |temp_file|
data = "GARBAGE"
temp_file.write(data)
temp_file.close
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment