Permalink
Browse files

move to sinatra app

  • Loading branch information...
1 parent 1712dd5 commit 32fa23f8ba58709a498e41e67ba141bdbea7eb16 @schacon schacon committed Sep 17, 2011
Showing with 243 additions and 64 deletions.
  1. +2 −0 .bundle/config
  2. +2 −1 .gitignore
  3. +20 −0 Gemfile
  4. +83 −0 Gemfile.lock
  5. +5 −0 TODO
  6. +12 −0 config.ru
  7. BIN css/.DS_Store
  8. +89 −0 dodgeball.rb
  9. 0 { → public}/css/style.css
  10. BIN { → public}/favicon.ico
  11. BIN { → public}/fonts/ArchitectsDaughter-webfont.eot
  12. 0 { → public}/fonts/ArchitectsDaughter-webfont.svg
  13. BIN { → public}/fonts/ArchitectsDaughter-webfont.ttf
  14. BIN { → public}/fonts/ArchitectsDaughter-webfont.woff
  15. BIN { → public}/fonts/BPdots-webfont.eot
  16. 0 { → public}/fonts/BPdots-webfont.svg
  17. BIN { → public}/fonts/BPdots-webfont.ttf
  18. BIN { → public}/fonts/BPdots-webfont.woff
  19. BIN { → public}/fonts/BebasNeue-webfont.eot
  20. 0 { → public}/fonts/BebasNeue-webfont.svg
  21. BIN { → public}/fonts/BebasNeue-webfont.ttf
  22. BIN { → public}/fonts/BebasNeue-webfont.woff
  23. BIN { → public}/fonts/GoodDog-webfont.eot
  24. 0 { → public}/fonts/GoodDog-webfont.svg
  25. BIN { → public}/fonts/GoodDog-webfont.ttf
  26. BIN { → public}/fonts/GoodDog-webfont.woff
  27. BIN { → public}/fonts/chunk-webfont.eot
  28. 0 { → public}/fonts/chunk-webfont.svg
  29. BIN { → public}/fonts/chunk-webfont.ttf
  30. BIN { → public}/fonts/chunk-webfont.woff
  31. BIN { → public}/images/check-sprite.png
  32. BIN { → public}/images/dodgeball.png
  33. BIN { → public}/images/dodgetocat.png
  34. BIN { → public}/images/hr.png
  35. BIN { → public}/images/paper.jpg
  36. BIN { → public}/images/shine.png
  37. BIN { → public}/images/team-image.png
  38. 0 { → public}/shared/.gitignore
  39. 0 { → public}/shared/css/documentation.css
  40. 0 { → public}/shared/css/pygments.css
  41. BIN { → public}/shared/images/active-arrow.png
  42. BIN { → public}/shared/images/background-v2.png
  43. BIN { → public}/shared/images/background-white.png
  44. BIN { → public}/shared/images/bg.png
  45. BIN { → public}/shared/images/bg_footer_bottom.png
  46. BIN { → public}/shared/images/bg_footer_top.png
  47. BIN { → public}/shared/images/blacktocat.png
  48. 0 { → public}/shared/images/blacktocat.svg
  49. BIN { → public}/shared/images/crud-sprite.png
  50. BIN { → public}/shared/images/dropdown_sprites.jpg
  51. BIN { → public}/shared/images/expand-arrows.png
  52. BIN { → public}/shared/images/footer-logo.png
  53. 0 { → public}/shared/images/footer-logo.svg
  54. BIN { → public}/shared/images/footer_logo.png
  55. BIN { → public}/shared/images/nav-rule.png
  56. BIN { → public}/shared/images/next_step_arrow.gif
  57. BIN { → public}/shared/images/qmark.png
  58. BIN { → public}/shared/images/rackspace_logo.png
  59. 0 { → public}/shared/js/documentation.js
  60. 0 { → public}/shared/js/jquery.js
  61. +30 −63 index.html → views/index.erb
View
@@ -0,0 +1,2 @@
+---
+BUNDLE_WITHOUT: production
View
@@ -1 +1,2 @@
-.DS_Store
+.DS_Store
+local.db
View
20 Gemfile
@@ -0,0 +1,20 @@
+source "http://rubygems.org"
+
+gem "sinatra"
+gem "dm-core"
+gem "dm-migrations"
+gem "dm-validations"
+gem "dm-timestamps"
+gem "tinder"
+
+group :production do
+ gem "pg"
+ gem "dm-postgres-adapter"
+end
+
+group :development do
+ gem "sqlite3-ruby"
+ gem "dm-sqlite-adapter"
+ gem "shotgun"
+end
+
View
@@ -0,0 +1,83 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ activesupport (3.1.0)
+ multi_json (~> 1.0)
+ addressable (2.2.6)
+ data_objects (0.10.6)
+ addressable (~> 2.1)
+ dm-core (1.1.0)
+ addressable (~> 2.2.4)
+ dm-do-adapter (1.1.0)
+ data_objects (~> 0.10.2)
+ dm-core (~> 1.1.0)
+ dm-migrations (1.1.0)
+ dm-core (~> 1.1.0)
+ dm-postgres-adapter (1.1.0)
+ dm-do-adapter (~> 1.1.0)
+ do_postgres (~> 0.10.2)
+ dm-sqlite-adapter (1.1.0)
+ dm-do-adapter (~> 1.1.0)
+ do_sqlite3 (~> 0.10.2)
+ dm-timestamps (1.1.0)
+ dm-core (~> 1.1.0)
+ dm-validations (1.1.0)
+ dm-core (~> 1.1.0)
+ do_postgres (0.10.6)
+ data_objects (= 0.10.6)
+ do_sqlite3 (0.10.6)
+ data_objects (= 0.10.6)
+ eventmachine (0.12.10)
+ faraday (0.7.4)
+ addressable (~> 2.2.6)
+ multipart-post (~> 1.1.0)
+ rack (>= 1.1.0, < 2)
+ faraday_middleware (0.7.0)
+ faraday (~> 0.7.3)
+ hashie (1.1.0)
+ http_parser.rb (0.5.2)
+ mime-types (1.16)
+ multi_json (1.0.3)
+ multipart-post (1.1.3)
+ pg (0.11.0)
+ rack (1.3.2)
+ shotgun (0.9)
+ rack (>= 1.0)
+ simple_oauth (0.1.5)
+ sinatra (1.2.6)
+ rack (~> 1.1)
+ tilt (>= 1.2.2, < 2.0)
+ sqlite3 (1.3.4)
+ sqlite3-ruby (1.3.3)
+ sqlite3 (>= 1.3.3)
+ tilt (1.3.3)
+ tinder (1.7.0)
+ activesupport (>= 2.3, < 4)
+ eventmachine (~> 0.12)
+ faraday (>= 0.6, < 0.8)
+ faraday_middleware (>= 0.6, < 0.8)
+ hashie (~> 1.0)
+ mime-types (~> 1.16)
+ multi_json (~> 1.0)
+ multipart-post (~> 1.1)
+ twitter-stream (~> 0.1)
+ twitter-stream (0.1.14)
+ eventmachine (>= 0.12.8)
+ http_parser.rb (~> 0.5.1)
+ simple_oauth (~> 0.1.4)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ dm-core
+ dm-migrations
+ dm-postgres-adapter
+ dm-sqlite-adapter
+ dm-timestamps
+ dm-validations
+ pg
+ shotgun
+ sinatra
+ sqlite3-ruby
+ tinder
View
5 TODO
@@ -0,0 +1,5 @@
+* sanitize stuff
+
+* admin screen where mel/heather/kami can validate the team and update the amount
+
+* media section?
View
@@ -0,0 +1,12 @@
+require "rubygems"
+require "bundler"
+
+Bundler.setup
+Bundler.require(:runtime)
+
+require './dodgeball'
+
+use Rack::Static, :urls => ["/css", "/images", "/fonts", "/shared"], :root => "public"
+
+run Dodgeball
+
View
Binary file not shown.
View
@@ -0,0 +1,89 @@
+require 'sinatra/base'
+
+require 'dm-core'
+require 'dm-migrations'
+require 'dm-validations'
+require 'dm-timestamps'
+
+## -- DATABASE STUFF --
+
+DataMapper.setup(:default, ENV['DATABASE_URL'] || "sqlite3://#{Dir.pwd}/local.db")
+
+class Team
+ include DataMapper::Resource
+ has n, :sponsors
+
+ property :id, Serial
+ property :name, String
+ property :company, String
+ property :charity, String
+ property :charity_url, String
+ property :github, String
+ property :twitter, String
+ property :image, String
+ property :donation, Integer
+ property :sponsored, Integer
+ property :valid, Boolean
+ property :owner, String
+ property :email, String
+ property :player_1, String
+ property :player_2, String
+ property :player_3, String
+ property :player_4, String
+ property :player_5, String
+ property :player_6, String
+ property :player_7, String
+ property :player_8, String
+ property :updated_at, DateTime
+end
+
+class Sponsor
+ include DataMapper::Resource
+ property :id, Serial
+ property :name, String
+ property :amount, Integer
+ property :github, String
+ property :twitter, String
+end
+
+DataMapper.auto_upgrade!
+
+class Dodgeball < Sinatra::Base
+
+ def get_data
+ @teams = Team.all(:valid => true)
+ @pot = 3001
+ end
+
+ get '/' do
+ get_data
+ @team = Team.new
+ erb :index
+ end
+
+ post '/new' do
+ @team = Team.new
+ @team.name = params['team-name']
+ @team.company = params['company-name']
+ @team.charity = params['charity-name']
+ @team.charity_url = params['charity-url']
+ @team.twitter = params['company-twitter']
+ @team.email = params['contact-email']
+ @team.image = params['team-image']
+ @team.player_1 = params['player-1']
+ @team.player_2 = params['player-2']
+ @team.player_3 = params['player-3']
+ @team.player_4 = params['player-4']
+ @team.player_5 = params['player-5']
+ @team.player_6 = params['player-6']
+ @team.player_7 = params['player-7']
+ @team.player_8 = params['player-8']
+ if @team.save
+ redirect '/'
+ else
+ get_data
+ erb :index
+ end
+ end
+
+end
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.

0 comments on commit 32fa23f

Please sign in to comment.