Permalink
Browse files

Final commit of running app

  • Loading branch information...
1 parent a51c792 commit 9c76e3edd9ef2df2ad637a71f73ba6c0018ac8ca @kyledrake kyledrake committed Mar 26, 2011
View
19 Gemfile
@@ -1,16 +1,17 @@
source 'http://gems.rubyforge.org'
-gem 'sinatra', '1.2.1', :require => 'sinatra/base'
-gem 'yajl-ruby', '0.8.1', :require => 'yajl/json_gem'
-gem 'typhoeus', '0.2.4'
-gem 'dm-core', '1.1.0'
-gem 'dm-timestamps', '1.1.0'
-gem 'dm-migrations', '1.1.0'
-gem 'xmpp4r-simple', '0.8.8'
-gem 'symboltable', '1.0.0'
+gem 'sinatra', '1.2.1', :require => 'sinatra/base'
+gem 'yajl-ruby', '0.8.1', :require => 'yajl/json_gem'
+gem 'typhoeus', '0.2.4'
+gem 'dm-core', '1.1.0'
+gem 'dm-timestamps', '1.1.0'
+gem 'dm-migrations', '1.1.0'
+gem 'xmpp4r-simple', '0.8.8'
+gem 'symboltable', '1.0.0'
gem 'dm-mysql-adapter', '1.1.0'
+gem 'rainbows', '3.2.0'
group :development do
- gem 'shotgun', '0.9', :require => nil
+ gem 'shotgun', '0.9', :require => nil
platforms :mri_18 do
gem 'ruby-debug'
View
@@ -21,13 +21,17 @@ GEM
dm-core (~> 1.1.0)
do_mysql (0.10.3)
data_objects (= 0.10.3)
+ kgio (2.3.3)
linecache (0.43)
linecache19 (0.5.11)
ruby_core_source (>= 0.1.4)
mime-types (1.16)
rack (1.2.2)
rack-test (0.5.7)
rack (>= 1.0)
+ rainbows (3.2.0)
+ rack (~> 1.1)
+ unicorn (~> 3.5)
ruby-debug (0.10.4)
columnize (>= 0.1)
ruby-debug-base (~> 0.10.4.0)
@@ -53,6 +57,9 @@ GEM
typhoeus (0.2.4)
mime-types
mime-types
+ unicorn (3.5.0)
+ kgio (~> 2.3)
+ rack
xmpp4r (0.5)
xmpp4r-simple (0.8.8)
xmpp4r (>= 0.3.2)
@@ -68,6 +75,7 @@ DEPENDENCIES
dm-mysql-adapter (= 1.1.0)
dm-timestamps (= 1.1.0)
rack-test (= 0.5.7)
+ rainbows (= 3.2.0)
ruby-debug
ruby-debug19
shotgun (= 0.9)
View
@@ -15,12 +15,12 @@ class Sinatra::Base
config_hash = YAML.load_file File.join(root, 'config.yml')
Geoloqi::OAUTH_TOKEN = config_hash['oauth_token']
-
+
DataMapper.finalize
DataMapper.setup :default, ENV['DATABASE_URL'] || config_hash['database']
DataMapper.auto_upgrade!
DataMapper::Model.raise_on_save_failure = true
end
end
-require File.join(Sinatra::Base.root, 'pdx_pacman.rb')
+require File.join(Sinatra::Base.root, 'pdx_pacman.rb')
View
@@ -7,7 +7,7 @@ def self.post(oauth_token, url, body)
:body => body.to_json,
:headers => Geoloqi.headers(oauth_token)
obj = JSON.parse(response.body)
- puts response.body
+ # puts response.body
case obj
when Array
@@ -26,7 +26,7 @@ def self.get(oauth_token, url)
:method => :get,
:headers => Geoloqi.headers(oauth_token)
obj = JSON.parse(response.body)
- puts response.body
+ # puts response.body
case obj
when Array
@@ -40,4 +40,4 @@ def self.get(oauth_token, url)
ret
end
-end
+end
View
@@ -74,6 +74,11 @@ class PdxPacman < Sinatra::Base
Geoloqi.post Geoloqi::OAUTH_TOKEN, "place/update/#{body.place.place_id}", {:extra => {:active => 0, :team => @player.team.name}}
@player.add_points body.place.extra.points if body.place.extra && body.place.extra.points
@player.send_message "You ate a dot! #{body.place.extra.points} points"
+ #require 'socket'
+ #sock = UDPSocket.new
+ #data = '!say '+@player.name+' got '+body.place.extra.points+' points!'
+ #sock.send(data, 0, 'launchpad.pin13.net', 51776)
+ #sock.close
end
end
@@ -120,4 +125,4 @@ class PdxPacman < Sinatra::Base
{:places => places, :players => players}.to_json
end
-end
+end
View
@@ -0,0 +1,8 @@
+# For production
+listen 11000
+worker_processes 2
+pid 'tmp/rainbows.pid'
+Rainbows! do
+ use :ThreadSpawn
+ worker_connections 200
+end
View
@@ -0,0 +1,2 @@
+#!/bin/sh
+bundle exec rainbows -D -c rainbows_config.rb -E production -p 11000 >/dev/null &
View
No changes.
View
@@ -0,0 +1 @@
+28559
View
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 9c76e3e

Please sign in to comment.