Skip to content

Instantly share code, notes, and snippets.

@opheliasdaisies
Created December 16, 2013 04:15
Show Gist options
  • Save opheliasdaisies/7982201 to your computer and use it in GitHub Desktop.
Save opheliasdaisies/7982201 to your computer and use it in GitHub Desktop.
require "bundler"
Bundler.require
require "./lib/compliment"
require "yaml"
module Compliments
class App < Sinatra::Application
compliments = YAML.load(File.read("./compliments.yaml"))
images = Dir["./public/images/*"].map {|image| "/images/#{Pathname.new(image).basename}"}
get "/compliments" do
@compliment = Compliment.new(compliments.sample, images.sample)
erb :compliment
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment