1
0
mirror of https://github.com/danbee/scoreboard synced 2025-03-04 08:59:11 +00:00

First commit.

This commit is contained in:
Daniel Barber 2015-05-08 14:58:36 +01:00
commit 96ca60e6fa
5 changed files with 56 additions and 0 deletions

3
.env.example Normal file
View File

@ -0,0 +1,3 @@
PUSHER_KEY=
PUSHER_SECRET=
PUSHER_APP=

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.env

6
Gemfile Normal file
View File

@ -0,0 +1,6 @@
source 'https://rubygems.org'
gem 'dotenv'
gem 'sinatra'
gem 'pusher'

25
Gemfile.lock Normal file
View File

@ -0,0 +1,25 @@
GEM
remote: https://rubygems.org/
specs:
httpclient (2.6.0.1)
multi_json (1.11.0)
pusher (0.14.4)
httpclient (~> 2.5)
multi_json (~> 1.0)
signature (~> 0.1.8)
rack (1.6.0)
rack-protection (1.5.3)
rack
signature (0.1.8)
sinatra (1.4.6)
rack (~> 1.4)
rack-protection (~> 1.4)
tilt (>= 1.3, < 3)
tilt (1.4.1)
PLATFORMS
ruby
DEPENDENCIES
pusher
sinatra

21
scores.rb Executable file
View File

@ -0,0 +1,21 @@
#!/usr/bin/env ruby
require 'dotenv'
Dotenv.load
require 'sinatra'
require 'pusher'
Pusher.url = "http://#{ENV['PUSHER_KEY']}:#{ENV['PUSHER_SECRET']}@api.pusherapp.com/apps/#{ENV['PUSHER_APP']}"
put '/player1_scores' do
Pusher['scores'].trigger('player1_scores', {
message: 'Player 1 scores'
})
end
put '/player2_scores' do
Pusher['scores'].trigger('player2_scores', {
message: 'Player 2 scores'
})
end