Skip to content

Commit

Permalink
FIRST!
Browse files Browse the repository at this point in the history
  • Loading branch information
bascht committed Jun 20, 2012
0 parents commit eafe145
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Gemfile
@@ -0,0 +1,9 @@
source :rubygems

gem 'sinatra'
gem 'sinatra-contrib'

group :development do
gem 'foreman'
gem 'shotgun'
end
36 changes: 36 additions & 0 deletions Gemfile.lock
@@ -0,0 +1,36 @@
GEM
remote: http://rubygems.org/
specs:
backports (2.6.0)
eventmachine (0.12.10)
foreman (0.46.0)
thor (>= 0.13.6)
rack (1.4.1)
rack-protection (1.2.0)
rack
rack-test (0.6.1)
rack (>= 1.0)
shotgun (0.9)
rack (>= 1.0)
sinatra (1.3.2)
rack (~> 1.3, >= 1.3.6)
rack-protection (~> 1.2)
tilt (~> 1.3, >= 1.3.3)
sinatra-contrib (1.3.1)
backports (>= 2.0)
eventmachine
rack-protection
rack-test
sinatra (~> 1.3.0)
tilt (~> 1.3)
thor (0.15.2)
tilt (1.3.3)

PLATFORMS
ruby

DEPENDENCIES
foreman
shotgun
sinatra
sinatra-contrib
1 change: 1 addition & 0 deletions Procfile
@@ -0,0 +1 @@
web: bundle exec shotgun -p $PORT
2 changes: 2 additions & 0 deletions config.ru
@@ -0,0 +1,2 @@
require './em'
run Sinatra::Application
20 changes: 20 additions & 0 deletions em.rb
@@ -0,0 +1,20 @@
require 'sinatra'
require 'sinatra/json'

MATCHES = [
["Tschechien", "Portugal"],
["Deutschland", "Griechenland"],
["Spanien", "Frankreich"],
["England", "Italien"]
]

get '/viertelfinale.json' do
results = MATCHES.collect do |teams|
goals = (0...5).to_a.shuffle
result = goals[0,2].join ":"
{ :match => teams, :result => result.to_s }
end

json results
end

0 comments on commit eafe145

Please sign in to comment.