├── log └── .keep ├── .ruby-version ├── public ├── favicon.ico ├── robots.txt └── 500.html ├── .ruby-gemset ├── components ├── games │ ├── spec │ │ ├── dummy │ │ │ ├── log │ │ │ │ └── .keep │ │ │ ├── app │ │ │ │ ├── mailers │ │ │ │ │ └── .keep │ │ │ │ ├── models │ │ │ │ │ ├── .keep │ │ │ │ │ └── concerns │ │ │ │ │ │ └── .keep │ │ │ │ ├── assets │ │ │ │ │ ├── images │ │ │ │ │ │ └── .keep │ │ │ │ │ ├── javascripts │ │ │ │ │ │ └── application.js │ │ │ │ │ └── stylesheets │ │ │ │ │ │ └── application.css │ │ │ │ ├── controllers │ │ │ │ │ ├── concerns │ │ │ │ │ │ └── .keep │ │ │ │ │ └── application_controller.rb │ │ │ │ ├── helpers │ │ │ │ │ └── application_helper.rb │ │ │ │ └── views │ │ │ │ │ └── layouts │ │ │ │ │ └── application.html.erb │ │ │ ├── lib │ │ │ │ └── assets │ │ │ │ │ └── .keep │ │ │ ├── public │ │ │ │ └── favicon.ico │ │ │ ├── config │ │ │ │ ├── routes.rb │ │ │ │ ├── initializers │ │ │ │ │ ├── cookies_serializer.rb │ │ │ │ │ ├── session_store.rb │ │ │ │ │ ├── mime_types.rb │ │ │ │ │ ├── filter_parameter_logging.rb │ │ │ │ │ ├── assets.rb │ │ │ │ │ ├── backtrace_silencers.rb │ │ │ │ │ ├── wrap_parameters.rb │ │ │ │ │ └── inflections.rb │ │ │ │ ├── environment.rb │ │ │ │ ├── boot.rb │ │ │ │ ├── database.yml │ │ │ │ ├── locales │ │ │ │ │ └── en.yml │ │ │ │ ├── application.rb │ │ │ │ ├── secrets.yml │ │ │ │ └── environments │ │ │ │ │ └── development.rb │ │ │ ├── bin │ │ │ │ ├── rake │ │ │ │ ├── bundle │ │ │ │ └── rails │ │ │ ├── config.ru │ │ │ ├── Rakefile │ │ │ ├── README.rdoc │ │ │ └── db │ │ │ │ └── schema.rb │ │ ├── models │ │ │ └── games │ │ │ │ └── game_spec.rb │ │ ├── support │ │ │ └── object_creation_methods.rb │ │ └── spec_helper.rb │ ├── README.rdoc │ ├── .rspec │ ├── lib │ │ ├── games │ │ │ ├── test_helpers.rb │ │ │ └── engine.rb │ │ └── games.rb │ ├── Gemfile │ ├── db │ │ └── migrate │ │ │ ├── 20150409032329_move_app_games_to_games_games.rb │ │ │ └── 20150110184219_create_app_games.rb │ ├── test.sh │ ├── app │ │ └── models │ │ │ └── games │ │ │ └── game.rb │ ├── bin │ │ └── rails │ ├── Rakefile │ └── games.gemspec ├── teams │ ├── spec │ │ ├── dummy │ │ │ ├── log │ │ │ │ └── .keep │ │ │ ├── app │ │ │ │ ├── mailers │ │ │ │ │ └── .keep │ │ │ │ ├── models │ │ │ │ │ ├── .keep │ │ │ │ │ └── concerns │ │ │ │ │ │ └── .keep │ │ │ │ ├── assets │ │ │ │ │ ├── images │ │ │ │ │ │ └── .keep │ │ │ │ │ ├── javascripts │ │ │ │ │ │ └── application.js │ │ │ │ │ └── stylesheets │ │ │ │ │ │ └── application.css │ │ │ │ ├── controllers │ │ │ │ │ ├── concerns │ │ │ │ │ │ └── .keep │ │ │ │ │ └── application_controller.rb │ │ │ │ ├── helpers │ │ │ │ │ └── application_helper.rb │ │ │ │ └── views │ │ │ │ │ └── layouts │ │ │ │ │ └── application.html.erb │ │ │ ├── lib │ │ │ │ └── assets │ │ │ │ │ └── .keep │ │ │ ├── public │ │ │ │ └── favicon.ico │ │ │ ├── config │ │ │ │ ├── routes.rb │ │ │ │ ├── initializers │ │ │ │ │ ├── cookies_serializer.rb │ │ │ │ │ ├── session_store.rb │ │ │ │ │ ├── mime_types.rb │ │ │ │ │ ├── filter_parameter_logging.rb │ │ │ │ │ ├── assets.rb │ │ │ │ │ ├── backtrace_silencers.rb │ │ │ │ │ ├── wrap_parameters.rb │ │ │ │ │ └── inflections.rb │ │ │ │ ├── environment.rb │ │ │ │ ├── boot.rb │ │ │ │ ├── database.yml │ │ │ │ ├── locales │ │ │ │ │ └── en.yml │ │ │ │ ├── application.rb │ │ │ │ ├── secrets.yml │ │ │ │ └── environments │ │ │ │ │ └── development.rb │ │ │ ├── bin │ │ │ │ ├── rake │ │ │ │ ├── bundle │ │ │ │ └── rails │ │ │ ├── config.ru │ │ │ ├── Rakefile │ │ │ ├── README.rdoc │ │ │ └── db │ │ │ │ └── schema.rb │ │ ├── models │ │ │ └── teams │ │ │ │ └── team_spec.rb │ │ ├── support │ │ │ └── object_creation_methods.rb │ │ └── spec_helper.rb │ ├── README.rdoc │ ├── .rspec │ ├── Gemfile │ ├── lib │ │ ├── teams.rb │ │ └── teams │ │ │ ├── test_helpers.rb │ │ │ └── engine.rb │ ├── app │ │ └── models │ │ │ └── teams │ │ │ └── team.rb │ ├── db │ │ └── migrate │ │ │ ├── 20150409014709_move_app_team_to_teams_teams.rb │ │ │ └── 20150110181102_create_app_teams.rb │ ├── test.sh │ ├── bin │ │ └── rails │ ├── Rakefile │ └── teams.gemspec ├── games_ui │ ├── spec │ │ ├── dummy │ │ │ ├── log │ │ │ │ └── .keep │ │ │ ├── app │ │ │ │ ├── mailers │ │ │ │ │ └── .keep │ │ │ │ ├── models │ │ │ │ │ ├── .keep │ │ │ │ │ └── concerns │ │ │ │ │ │ └── .keep │ │ │ │ ├── assets │ │ │ │ │ ├── images │ │ │ │ │ │ └── .keep │ │ │ │ │ ├── javascripts │ │ │ │ │ │ └── application.js │ │ │ │ │ └── stylesheets │ │ │ │ │ │ └── application.css │ │ │ │ ├── controllers │ │ │ │ │ ├── concerns │ │ │ │ │ │ └── .keep │ │ │ │ │ └── application_controller.rb │ │ │ │ ├── helpers │ │ │ │ │ └── application_helper.rb │ │ │ │ └── views │ │ │ │ │ └── layouts │ │ │ │ │ └── application.html.erb │ │ │ ├── lib │ │ │ │ └── assets │ │ │ │ │ └── .keep │ │ │ ├── public │ │ │ │ └── favicon.ico │ │ │ ├── bin │ │ │ │ ├── rake │ │ │ │ ├── bundle │ │ │ │ └── rails │ │ │ ├── config │ │ │ │ ├── initializers │ │ │ │ │ ├── main_nav.rb │ │ │ │ │ ├── cookies_serializer.rb │ │ │ │ │ ├── session_store.rb │ │ │ │ │ ├── mime_types.rb │ │ │ │ │ ├── filter_parameter_logging.rb │ │ │ │ │ ├── assets.rb │ │ │ │ │ ├── backtrace_silencers.rb │ │ │ │ │ ├── wrap_parameters.rb │ │ │ │ │ └── inflections.rb │ │ │ │ ├── routes.rb │ │ │ │ ├── environment.rb │ │ │ │ ├── boot.rb │ │ │ │ ├── database.yml │ │ │ │ ├── locales │ │ │ │ │ └── en.yml │ │ │ │ ├── application.rb │ │ │ │ ├── secrets.yml │ │ │ │ └── environments │ │ │ │ │ └── development.rb │ │ │ ├── config.ru │ │ │ ├── Rakefile │ │ │ ├── README.rdoc │ │ │ └── db │ │ │ │ └── schema.rb │ │ ├── nav_entry_spec.rb │ │ ├── support │ │ │ └── view_spec_fixes.rb │ │ ├── views │ │ │ └── games_ui │ │ │ │ └── games │ │ │ │ ├── show.html.slim_spec.rb │ │ │ │ ├── index.html.slim_spec.rb │ │ │ │ ├── edit.html.slim_spec.rb │ │ │ │ └── new.html.slim_spec.rb │ │ ├── features │ │ │ └── games_spec.rb │ │ ├── routing │ │ │ └── games_ui │ │ │ │ └── games_routing_spec.rb │ │ └── spec_helper.rb │ ├── README.rdoc │ ├── .rspec │ ├── config │ │ └── routes.rb │ ├── lib │ │ ├── tasks │ │ │ └── app_tasks.rake │ │ ├── games_ui.rb │ │ └── games_ui │ │ │ └── engine.rb │ ├── app │ │ ├── views │ │ │ └── games_ui │ │ │ │ └── games │ │ │ │ ├── new.html.slim │ │ │ │ ├── edit.html.slim │ │ │ │ ├── show.html.slim │ │ │ │ ├── index.html.slim │ │ │ │ └── _form.html.slim │ │ └── controllers │ │ │ └── games_ui │ │ │ ├── application_controller.rb │ │ │ └── games_controller.rb │ ├── Gemfile │ ├── test.sh │ ├── bin │ │ └── rails │ ├── Rakefile │ └── web_ui.gemspec ├── teams_ui │ ├── spec │ │ ├── dummy │ │ │ ├── log │ │ │ │ └── .keep │ │ │ ├── app │ │ │ │ ├── mailers │ │ │ │ │ └── .keep │ │ │ │ ├── models │ │ │ │ │ ├── .keep │ │ │ │ │ └── concerns │ │ │ │ │ │ └── .keep │ │ │ │ ├── assets │ │ │ │ │ ├── images │ │ │ │ │ │ └── .keep │ │ │ │ │ ├── javascripts │ │ │ │ │ │ └── application.js │ │ │ │ │ └── stylesheets │ │ │ │ │ │ └── application.css │ │ │ │ ├── controllers │ │ │ │ │ ├── concerns │ │ │ │ │ │ └── .keep │ │ │ │ │ └── application_controller.rb │ │ │ │ ├── helpers │ │ │ │ │ └── application_helper.rb │ │ │ │ └── views │ │ │ │ │ └── layouts │ │ │ │ │ └── application.html.erb │ │ │ ├── lib │ │ │ │ └── assets │ │ │ │ │ └── .keep │ │ │ ├── public │ │ │ │ └── favicon.ico │ │ │ ├── bin │ │ │ │ ├── rake │ │ │ │ ├── bundle │ │ │ │ └── rails │ │ │ ├── config │ │ │ │ ├── initializers │ │ │ │ │ ├── main_nav.rb │ │ │ │ │ ├── cookies_serializer.rb │ │ │ │ │ ├── session_store.rb │ │ │ │ │ ├── mime_types.rb │ │ │ │ │ ├── filter_parameter_logging.rb │ │ │ │ │ ├── assets.rb │ │ │ │ │ ├── backtrace_silencers.rb │ │ │ │ │ ├── wrap_parameters.rb │ │ │ │ │ └── inflections.rb │ │ │ │ ├── routes.rb │ │ │ │ ├── environment.rb │ │ │ │ ├── boot.rb │ │ │ │ ├── database.yml │ │ │ │ ├── locales │ │ │ │ │ └── en.yml │ │ │ │ ├── application.rb │ │ │ │ ├── secrets.yml │ │ │ │ └── environments │ │ │ │ │ └── development.rb │ │ │ ├── config.ru │ │ │ ├── Rakefile │ │ │ ├── README.rdoc │ │ │ └── db │ │ │ │ └── schema.rb │ │ ├── nav_entry_spec.rb │ │ ├── support │ │ │ └── view_spec_fixes.rb │ │ ├── features │ │ │ └── teams_spec.rb │ │ ├── views │ │ │ └── teams_ui │ │ │ │ └── teams │ │ │ │ ├── new.html.slim_spec.rb │ │ │ │ ├── edit.html.slim_spec.rb │ │ │ │ └── index.html.slim_spec.rb │ │ ├── routing │ │ │ └── teams_ui │ │ │ │ └── teams_routing_spec.rb │ │ └── spec_helper.rb │ ├── README.rdoc │ ├── .rspec │ ├── config │ │ └── routes.rb │ ├── lib │ │ ├── tasks │ │ │ └── app_tasks.rake │ │ ├── teams_ui.rb │ │ └── teams_ui │ │ │ └── engine.rb │ ├── app │ │ ├── views │ │ │ └── teams_ui │ │ │ │ └── teams │ │ │ │ ├── new.html.slim │ │ │ │ ├── edit.html.slim │ │ │ │ ├── _form.html.slim │ │ │ │ └── index.html.slim │ │ └── controllers │ │ │ └── teams_ui │ │ │ ├── application_controller.rb │ │ │ └── teams_controller.rb │ ├── Gemfile │ ├── test.sh │ ├── bin │ │ └── rails │ ├── Rakefile │ └── teams_ui.gemspec ├── welcome_ui │ ├── spec │ │ ├── dummy │ │ │ ├── log │ │ │ │ └── .keep │ │ │ ├── app │ │ │ │ ├── mailers │ │ │ │ │ └── .keep │ │ │ │ ├── models │ │ │ │ │ ├── .keep │ │ │ │ │ └── concerns │ │ │ │ │ │ └── .keep │ │ │ │ ├── assets │ │ │ │ │ ├── images │ │ │ │ │ │ └── .keep │ │ │ │ │ ├── javascripts │ │ │ │ │ │ └── application.js │ │ │ │ │ └── stylesheets │ │ │ │ │ │ └── application.css │ │ │ │ ├── controllers │ │ │ │ │ ├── concerns │ │ │ │ │ │ └── .keep │ │ │ │ │ └── application_controller.rb │ │ │ │ ├── helpers │ │ │ │ │ └── application_helper.rb │ │ │ │ └── views │ │ │ │ │ └── layouts │ │ │ │ │ └── application.html.erb │ │ │ ├── lib │ │ │ │ └── assets │ │ │ │ │ └── .keep │ │ │ ├── public │ │ │ │ └── favicon.ico │ │ │ ├── bin │ │ │ │ ├── rake │ │ │ │ ├── bundle │ │ │ │ └── rails │ │ │ ├── config │ │ │ │ ├── routes.rb │ │ │ │ ├── initializers │ │ │ │ │ ├── cookies_serializer.rb │ │ │ │ │ ├── session_store.rb │ │ │ │ │ ├── mime_types.rb │ │ │ │ │ ├── filter_parameter_logging.rb │ │ │ │ │ ├── assets.rb │ │ │ │ │ ├── backtrace_silencers.rb │ │ │ │ │ ├── wrap_parameters.rb │ │ │ │ │ └── inflections.rb │ │ │ │ ├── environment.rb │ │ │ │ ├── boot.rb │ │ │ │ ├── database.yml │ │ │ │ ├── locales │ │ │ │ │ └── en.yml │ │ │ │ ├── application.rb │ │ │ │ ├── secrets.yml │ │ │ │ └── environments │ │ │ │ │ └── development.rb │ │ │ ├── config.ru │ │ │ ├── Rakefile │ │ │ ├── README.rdoc │ │ │ └── db │ │ │ │ └── schema.rb │ │ ├── controllers │ │ │ └── welcomes_controller_spec.rb │ │ └── spec_helper.rb │ ├── README.rdoc │ ├── .rspec │ ├── app │ │ ├── views │ │ │ └── welcome_ui │ │ │ │ └── welcomes │ │ │ │ └── show.html.slim │ │ └── controllers │ │ │ └── welcome_ui │ │ │ ├── welcomes_controller.rb │ │ │ └── application_controller.rb │ ├── lib │ │ ├── tasks │ │ │ └── app_tasks.rake │ │ ├── welcome_ui.rb │ │ └── welcome_ui │ │ │ └── engine.rb │ ├── config │ │ └── routes.rb │ ├── Gemfile │ ├── test.sh │ ├── bin │ │ └── rails │ ├── welcome_ui.gemspec │ └── Rakefile ├── predictor_ui │ ├── spec │ │ ├── dummy │ │ │ ├── log │ │ │ │ └── .keep │ │ │ ├── app │ │ │ │ ├── mailers │ │ │ │ │ └── .keep │ │ │ │ ├── models │ │ │ │ │ ├── .keep │ │ │ │ │ └── concerns │ │ │ │ │ │ └── .keep │ │ │ │ ├── assets │ │ │ │ │ ├── images │ │ │ │ │ │ └── .keep │ │ │ │ │ ├── javascripts │ │ │ │ │ │ └── application.js │ │ │ │ │ └── stylesheets │ │ │ │ │ │ └── application.css │ │ │ │ ├── controllers │ │ │ │ │ ├── concerns │ │ │ │ │ │ └── .keep │ │ │ │ │ └── application_controller.rb │ │ │ │ ├── helpers │ │ │ │ │ └── application_helper.rb │ │ │ │ └── views │ │ │ │ │ └── layouts │ │ │ │ │ └── application.html.erb │ │ │ ├── lib │ │ │ │ └── assets │ │ │ │ │ └── .keep │ │ │ ├── public │ │ │ │ └── favicon.ico │ │ │ ├── bin │ │ │ │ ├── rake │ │ │ │ ├── bundle │ │ │ │ └── rails │ │ │ ├── config │ │ │ │ ├── initializers │ │ │ │ │ ├── main_nav.rb │ │ │ │ │ ├── cookies_serializer.rb │ │ │ │ │ ├── session_store.rb │ │ │ │ │ ├── mime_types.rb │ │ │ │ │ ├── filter_parameter_logging.rb │ │ │ │ │ ├── assets.rb │ │ │ │ │ ├── backtrace_silencers.rb │ │ │ │ │ ├── wrap_parameters.rb │ │ │ │ │ └── inflections.rb │ │ │ │ ├── routes.rb │ │ │ │ ├── environment.rb │ │ │ │ ├── boot.rb │ │ │ │ ├── database.yml │ │ │ │ ├── locales │ │ │ │ │ └── en.yml │ │ │ │ ├── application.rb │ │ │ │ ├── secrets.yml │ │ │ │ └── environments │ │ │ │ │ └── development.rb │ │ │ ├── config.ru │ │ │ ├── Rakefile │ │ │ ├── README.rdoc │ │ │ └── db │ │ │ │ └── schema.rb │ │ ├── nav_entry_spec.rb │ │ ├── helpers │ │ │ └── app │ │ │ │ └── predictions_helper_spec.rb │ │ ├── features │ │ │ └── predictions_spec.rb │ │ ├── controllers │ │ │ └── app │ │ │ │ └── predictions_controller_spec.rb │ │ └── spec_helper.rb │ ├── README.rdoc │ ├── .rspec │ ├── config │ │ └── routes.rb │ ├── app │ │ ├── helpers │ │ │ └── predictor_ui │ │ │ │ ├── application_helper.rb │ │ │ │ └── predictions_helper.rb │ │ ├── controllers │ │ │ └── predictor_ui │ │ │ │ ├── application_controller.rb │ │ │ │ └── predictions_controller.rb │ │ └── views │ │ │ └── predictor_ui │ │ │ └── predictions │ │ │ ├── create.html.slim │ │ │ └── new.html.slim │ ├── lib │ │ ├── tasks │ │ │ └── app_tasks.rake │ │ ├── predictor_ui.rb │ │ └── predictor_ui │ │ │ └── engine.rb │ ├── Gemfile │ ├── test.sh │ ├── bin │ │ └── rails │ ├── Rakefile │ └── predictor_ui.gemspec ├── web_style │ ├── README.rdoc │ ├── Gemfile │ ├── lib │ │ ├── web_style.rb │ │ └── web_style │ │ │ └── engine.rb │ ├── app │ │ ├── assets │ │ │ ├── images │ │ │ │ └── web_style │ │ │ │ │ └── logo.png │ │ │ ├── stylesheets │ │ │ │ └── web_style │ │ │ │ │ └── application.css │ │ │ └── javascripts │ │ │ │ └── web_style │ │ │ │ └── application.js │ │ └── views │ │ │ └── layouts │ │ │ └── web_style │ │ │ └── application.html.slim │ ├── web_style.gemspec │ └── vendor │ │ └── assets │ │ └── javascripts │ │ └── web_style │ │ └── jquery.cookie.js └── predictor │ ├── .rspec │ ├── Rakefile │ ├── spec │ └── spec_helper.rb │ ├── lib │ ├── predictor.rb │ └── predictor │ │ ├── prediction.rb │ │ └── predictor.rb │ ├── test.sh │ ├── Gemfile │ ├── Gemfile.lock │ ├── predictor.gemspec │ └── README.md ├── .rspec ├── bin ├── bundle ├── rake ├── rails └── spring ├── config ├── initializers │ ├── cookies_serializer.rb │ ├── main_nav.rb │ ├── session_store.rb │ ├── mime_types.rb │ ├── filter_parameter_logging.rb │ ├── assets.rb │ ├── backtrace_silencers.rb │ ├── wrap_parameters.rb │ └── inflections.rb ├── environment.rb ├── boot.rb ├── routes.rb ├── database.yml ├── locales │ └── en.yml ├── secrets.yml ├── application.rb └── environments │ └── development.rb ├── config.ru ├── Rakefile ├── test.sh ├── .travis.yml ├── README.md ├── .gitignore ├── spec ├── features │ └── app_spec.rb └── spec_helper.rb ├── Gemfile ├── db ├── schema.rb └── seeds.rb └── Gemfile.bac /log/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.ruby-version: -------------------------------------------------------------------------------- 1 | 2.2.2 -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.ruby-gemset: -------------------------------------------------------------------------------- 1 | sportsball -------------------------------------------------------------------------------- /components/games/spec/dummy/log/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/teams/spec/dummy/log/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/games_ui/spec/dummy/log/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/teams_ui/spec/dummy/log/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/welcome_ui/spec/dummy/log/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.rspec: -------------------------------------------------------------------------------- 1 | --color 2 | --require spec_helper 3 | -------------------------------------------------------------------------------- /components/games/README.rdoc: -------------------------------------------------------------------------------- 1 | = Game 2 | 3 | -------------------------------------------------------------------------------- /components/games/spec/dummy/app/mailers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/games/spec/dummy/app/models/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/games/spec/dummy/lib/assets/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/games/spec/dummy/public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/games_ui/spec/dummy/app/mailers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/games_ui/spec/dummy/app/models/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/games_ui/spec/dummy/lib/assets/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/predictor_ui/spec/dummy/log/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/teams/README.rdoc: -------------------------------------------------------------------------------- 1 | = Teams 2 | 3 | -------------------------------------------------------------------------------- /components/teams/spec/dummy/app/mailers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/teams/spec/dummy/app/models/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/teams/spec/dummy/lib/assets/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/teams/spec/dummy/public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/teams_ui/spec/dummy/app/mailers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/teams_ui/spec/dummy/app/models/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/teams_ui/spec/dummy/lib/assets/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/games/spec/dummy/app/assets/images/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/games/spec/dummy/app/models/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/games_ui/README.rdoc: -------------------------------------------------------------------------------- 1 | = GamesUi 2 | 3 | -------------------------------------------------------------------------------- /components/games_ui/spec/dummy/public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/predictor_ui/spec/dummy/app/mailers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/predictor_ui/spec/dummy/app/models/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/predictor_ui/spec/dummy/lib/assets/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/predictor_ui/spec/dummy/public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/teams/spec/dummy/app/assets/images/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/teams/spec/dummy/app/models/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/teams_ui/README.rdoc: -------------------------------------------------------------------------------- 1 | = TeamsUi 2 | 3 | -------------------------------------------------------------------------------- /components/teams_ui/spec/dummy/public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/web_style/README.rdoc: -------------------------------------------------------------------------------- 1 | = WebStyle 2 | 3 | -------------------------------------------------------------------------------- /components/welcome_ui/spec/dummy/app/mailers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/welcome_ui/spec/dummy/app/models/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/welcome_ui/spec/dummy/lib/assets/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/welcome_ui/spec/dummy/public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/games/spec/dummy/app/controllers/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/games_ui/spec/dummy/app/assets/images/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/games_ui/spec/dummy/app/models/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/predictor_ui/README.rdoc: -------------------------------------------------------------------------------- 1 | = PredictorUi 2 | 3 | -------------------------------------------------------------------------------- /components/predictor_ui/spec/dummy/app/assets/images/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/teams/spec/dummy/app/controllers/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/teams_ui/spec/dummy/app/assets/images/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/teams_ui/spec/dummy/app/models/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/welcome_ui/README.rdoc: -------------------------------------------------------------------------------- 1 | = WelcomeUi 2 | 3 | -------------------------------------------------------------------------------- /components/welcome_ui/spec/dummy/app/assets/images/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/welcome_ui/spec/dummy/app/models/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/games/.rspec: -------------------------------------------------------------------------------- 1 | --color 2 | --require spec_helper 3 | -------------------------------------------------------------------------------- /components/games_ui/spec/dummy/app/controllers/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/predictor_ui/spec/dummy/app/models/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/teams/.rspec: -------------------------------------------------------------------------------- 1 | --color 2 | --require spec_helper 3 | -------------------------------------------------------------------------------- /components/teams_ui/spec/dummy/app/controllers/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/welcome_ui/spec/dummy/app/controllers/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/games_ui/.rspec: -------------------------------------------------------------------------------- 1 | --color 2 | --require spec_helper 3 | -------------------------------------------------------------------------------- /components/predictor/.rspec: -------------------------------------------------------------------------------- 1 | --color 2 | --require spec_helper 3 | -------------------------------------------------------------------------------- /components/predictor/Rakefile: -------------------------------------------------------------------------------- 1 | require "bundler/gem_tasks" 2 | 3 | -------------------------------------------------------------------------------- /components/predictor_ui/.rspec: -------------------------------------------------------------------------------- 1 | --color 2 | --require spec_helper 3 | -------------------------------------------------------------------------------- /components/predictor_ui/spec/dummy/app/controllers/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/teams_ui/.rspec: -------------------------------------------------------------------------------- 1 | --color 2 | --require spec_helper 3 | -------------------------------------------------------------------------------- /components/welcome_ui/.rspec: -------------------------------------------------------------------------------- 1 | --color 2 | --require spec_helper 3 | -------------------------------------------------------------------------------- /components/teams/Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | gemspec 4 | -------------------------------------------------------------------------------- /components/teams/lib/teams.rb: -------------------------------------------------------------------------------- 1 | module Teams 2 | require "teams/engine" 3 | end 4 | -------------------------------------------------------------------------------- /components/web_style/Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | gemspec 4 | -------------------------------------------------------------------------------- /components/games/spec/dummy/app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | end 3 | -------------------------------------------------------------------------------- /components/teams/spec/dummy/app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | end 3 | -------------------------------------------------------------------------------- /components/games/lib/games/test_helpers.rb: -------------------------------------------------------------------------------- 1 | require_relative "../../spec/support/object_creation_methods" -------------------------------------------------------------------------------- /components/games_ui/config/routes.rb: -------------------------------------------------------------------------------- 1 | GamesUi::Engine.routes.draw do 2 | resources :games 3 | end 4 | -------------------------------------------------------------------------------- /components/games_ui/spec/dummy/app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | end 3 | -------------------------------------------------------------------------------- /components/teams/lib/teams/test_helpers.rb: -------------------------------------------------------------------------------- 1 | require_relative "../../spec/support/object_creation_methods" -------------------------------------------------------------------------------- /components/teams_ui/config/routes.rb: -------------------------------------------------------------------------------- 1 | TeamsUi::Engine.routes.draw do 2 | resources :teams 3 | end 4 | -------------------------------------------------------------------------------- /components/teams_ui/spec/dummy/app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | end 3 | -------------------------------------------------------------------------------- /components/welcome_ui/spec/dummy/app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | end 3 | -------------------------------------------------------------------------------- /components/games/lib/games.rb: -------------------------------------------------------------------------------- 1 | require "teams" 2 | 3 | module Games 4 | require "games/engine" 5 | end 6 | -------------------------------------------------------------------------------- /components/predictor_ui/spec/dummy/app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | end 3 | -------------------------------------------------------------------------------- /components/games/Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | gemspec 4 | 5 | path "../" do 6 | gem "teams" 7 | end -------------------------------------------------------------------------------- /components/games/spec/dummy/config/routes.rb: -------------------------------------------------------------------------------- 1 | Rails.application.routes.draw do 2 | 3 | mount Games::Engine => "/games" 4 | end 5 | -------------------------------------------------------------------------------- /components/teams/spec/dummy/config/routes.rb: -------------------------------------------------------------------------------- 1 | Rails.application.routes.draw do 2 | 3 | mount Teams::Engine => "/teams" 4 | end 5 | -------------------------------------------------------------------------------- /components/predictor_ui/config/routes.rb: -------------------------------------------------------------------------------- 1 | PredictorUi::Engine.routes.draw do 2 | resource :prediction, only: [:new, :create] 3 | end 4 | -------------------------------------------------------------------------------- /components/teams/spec/models/teams/team_spec.rb: -------------------------------------------------------------------------------- 1 | RSpec.describe Teams::Team do 2 | it { should validate_presence_of(:name) } 3 | end 4 | -------------------------------------------------------------------------------- /components/games/spec/dummy/bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require_relative '../config/boot' 3 | require 'rake' 4 | Rake.application.run 5 | -------------------------------------------------------------------------------- /components/games_ui/lib/tasks/app_tasks.rake: -------------------------------------------------------------------------------- 1 | # desc "Explaining what the task does" 2 | # task :app do 3 | # # Task goes here 4 | # end 5 | -------------------------------------------------------------------------------- /components/predictor_ui/app/helpers/predictor_ui/application_helper.rb: -------------------------------------------------------------------------------- 1 | module PredictorUi 2 | module ApplicationHelper 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /components/teams/spec/dummy/bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require_relative '../config/boot' 3 | require 'rake' 4 | Rake.application.run 5 | -------------------------------------------------------------------------------- /components/teams_ui/lib/tasks/app_tasks.rake: -------------------------------------------------------------------------------- 1 | # desc "Explaining what the task does" 2 | # task :app do 3 | # # Task goes here 4 | # end 5 | -------------------------------------------------------------------------------- /components/welcome_ui/app/views/welcome_ui/welcomes/show.html.slim: -------------------------------------------------------------------------------- 1 | h1 Sportsball! 2 | h2 Predicting the outcome of matches since 2015. 3 | 4 | -------------------------------------------------------------------------------- /components/welcome_ui/lib/tasks/app_tasks.rake: -------------------------------------------------------------------------------- 1 | # desc "Explaining what the task does" 2 | # task :app do 3 | # # Task goes here 4 | # end 5 | -------------------------------------------------------------------------------- /components/games_ui/spec/dummy/bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require_relative '../config/boot' 3 | require 'rake' 4 | Rake.application.run 5 | -------------------------------------------------------------------------------- /components/games_ui/spec/dummy/config/initializers/main_nav.rb: -------------------------------------------------------------------------------- 1 | Rails.application.config.main_nav = 2 | [ 3 | GamesUi.nav_entry 4 | ] -------------------------------------------------------------------------------- /components/predictor_ui/lib/tasks/app_tasks.rake: -------------------------------------------------------------------------------- 1 | # desc "Explaining what the task does" 2 | # task :app do 3 | # # Task goes here 4 | # end 5 | -------------------------------------------------------------------------------- /components/teams_ui/spec/dummy/bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require_relative '../config/boot' 3 | require 'rake' 4 | Rake.application.run 5 | -------------------------------------------------------------------------------- /components/teams_ui/spec/dummy/config/initializers/main_nav.rb: -------------------------------------------------------------------------------- 1 | Rails.application.config.main_nav = 2 | [ 3 | TeamsUi.nav_entry 4 | ] -------------------------------------------------------------------------------- /components/welcome_ui/spec/dummy/bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require_relative '../config/boot' 3 | require 'rake' 4 | Rake.application.run 5 | -------------------------------------------------------------------------------- /bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 3 | load Gem.bin_path('bundler', 'bundle') 4 | -------------------------------------------------------------------------------- /components/predictor_ui/spec/dummy/bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require_relative '../config/boot' 3 | require 'rake' 4 | Rake.application.run 5 | -------------------------------------------------------------------------------- /components/welcome_ui/config/routes.rb: -------------------------------------------------------------------------------- 1 | WelcomeUi::Engine.routes.draw do 2 | resource :welcome, only: [:show] 3 | root to: "welcomes#show" 4 | end 5 | -------------------------------------------------------------------------------- /components/games_ui/app/views/games_ui/games/new.html.slim: -------------------------------------------------------------------------------- 1 | h1 New game 2 | 3 | == render 'form' 4 | 5 | = link_to 'Back', games_path, class: "button" 6 | -------------------------------------------------------------------------------- /components/predictor/spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) 2 | 3 | require 'predictor' 4 | require 'ostruct' 5 | -------------------------------------------------------------------------------- /components/predictor_ui/spec/dummy/config/initializers/main_nav.rb: -------------------------------------------------------------------------------- 1 | Rails.application.config.main_nav = 2 | [ 3 | PredictorUi.nav_entry 4 | ] -------------------------------------------------------------------------------- /components/teams/app/models/teams/team.rb: -------------------------------------------------------------------------------- 1 | module Teams 2 | class Team < ActiveRecord::Base 3 | validates :name, presence: true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /components/teams_ui/app/views/teams_ui/teams/new.html.slim: -------------------------------------------------------------------------------- 1 | h1 New team 2 | 3 | == render 'form' 4 | 5 | = link_to 'Back', teams_path, class: "button" 6 | -------------------------------------------------------------------------------- /components/web_style/lib/web_style.rb: -------------------------------------------------------------------------------- 1 | require "slim-rails" 2 | require "jquery-rails" 3 | 4 | module WebStyle 5 | require "web_style/engine" 6 | end 7 | -------------------------------------------------------------------------------- /components/teams_ui/app/views/teams_ui/teams/edit.html.slim: -------------------------------------------------------------------------------- 1 | h1 Editing team 2 | 3 | == render 'form' 4 | 5 | = link_to 'Back', teams_path, class: "button" 6 | 7 | -------------------------------------------------------------------------------- /components/web_style/app/assets/images/web_style/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shageman/sportsball/HEAD/components/web_style/app/assets/images/web_style/logo.png -------------------------------------------------------------------------------- /components/teams_ui/spec/dummy/config/routes.rb: -------------------------------------------------------------------------------- 1 | Rails.application.routes.draw do 2 | 3 | mount TeamsUi::Engine => "/teams_ui" 4 | 5 | root to: "teams#index" 6 | end 7 | -------------------------------------------------------------------------------- /config/initializers/cookies_serializer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Rails.application.config.action_dispatch.cookies_serializer = :json -------------------------------------------------------------------------------- /components/games/spec/dummy/bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 3 | load Gem.bin_path('bundler', 'bundle') 4 | -------------------------------------------------------------------------------- /components/games_ui/spec/dummy/bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 3 | load Gem.bin_path('bundler', 'bundle') 4 | -------------------------------------------------------------------------------- /components/games_ui/spec/dummy/config/routes.rb: -------------------------------------------------------------------------------- 1 | Rails.application.routes.draw do 2 | 3 | mount GamesUi::Engine => "/games_ui" 4 | 5 | root to: "games_ui/games#index" 6 | end 7 | -------------------------------------------------------------------------------- /components/teams/spec/dummy/bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 3 | load Gem.bin_path('bundler', 'bundle') 4 | -------------------------------------------------------------------------------- /components/teams_ui/spec/dummy/bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 3 | load Gem.bin_path('bundler', 'bundle') 4 | -------------------------------------------------------------------------------- /components/web_style/app/assets/stylesheets/web_style/application.css: -------------------------------------------------------------------------------- 1 | /* 2 | *= require web_style/normalize 3 | *= require web_style/foundation.min 4 | *= require_self 5 | */ 6 | -------------------------------------------------------------------------------- /config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require ::File.expand_path('../config/environment', __FILE__) 4 | run Rails.application 5 | -------------------------------------------------------------------------------- /config/initializers/main_nav.rb: -------------------------------------------------------------------------------- 1 | Rails.application.config.main_nav = 2 | [ 3 | TeamsUi.nav_entry, 4 | GamesUi.nav_entry, 5 | PredictorUi.nav_entry 6 | ] -------------------------------------------------------------------------------- /components/predictor_ui/spec/dummy/bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 3 | load Gem.bin_path('bundler', 'bundle') 4 | -------------------------------------------------------------------------------- /components/welcome_ui/lib/welcome_ui.rb: -------------------------------------------------------------------------------- 1 | require "slim-rails" 2 | require "jquery-rails" 3 | 4 | require "web_style" 5 | 6 | module WelcomeUi 7 | require "welcome_ui/engine" 8 | end 9 | -------------------------------------------------------------------------------- /components/welcome_ui/spec/dummy/bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 3 | load Gem.bin_path('bundler', 'bundle') 4 | -------------------------------------------------------------------------------- /config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require File.expand_path('../application', __FILE__) 3 | 4 | # Initialize the Rails application. 5 | Rails.application.initialize! 6 | -------------------------------------------------------------------------------- /config/initializers/session_store.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Rails.application.config.session_store :cookie_store, key: '_sportsball_session' 4 | -------------------------------------------------------------------------------- /components/predictor/lib/predictor.rb: -------------------------------------------------------------------------------- 1 | require 'saulabs/trueskill' 2 | 3 | module Predictor 4 | require_relative "predictor/prediction" 5 | require_relative "predictor/predictor" 6 | end 7 | -------------------------------------------------------------------------------- /components/welcome_ui/app/controllers/welcome_ui/welcomes_controller.rb: -------------------------------------------------------------------------------- 1 | module WelcomeUi 2 | class WelcomesController < ApplicationController 3 | def show 4 | end 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /components/welcome_ui/spec/dummy/config/routes.rb: -------------------------------------------------------------------------------- 1 | Rails.application.routes.draw do 2 | 3 | mount WelcomeUi::Engine => "/welcome_ui" 4 | 5 | root to: "welcome_ui/predictions#new" 6 | end 7 | -------------------------------------------------------------------------------- /components/games/spec/dummy/bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | APP_PATH = File.expand_path('../../config/application', __FILE__) 3 | require_relative '../config/boot' 4 | require 'rails/commands' 5 | -------------------------------------------------------------------------------- /components/games_ui/spec/dummy/bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | APP_PATH = File.expand_path('../../config/application', __FILE__) 3 | require_relative '../config/boot' 4 | require 'rails/commands' 5 | -------------------------------------------------------------------------------- /components/predictor_ui/spec/dummy/config/routes.rb: -------------------------------------------------------------------------------- 1 | Rails.application.routes.draw do 2 | 3 | mount PredictorUi::Engine => "/predictor_ui" 4 | 5 | root to: "predictor_ui/predictions#new" 6 | end 7 | -------------------------------------------------------------------------------- /components/teams/spec/dummy/bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | APP_PATH = File.expand_path('../../config/application', __FILE__) 3 | require_relative '../config/boot' 4 | require 'rails/commands' 5 | -------------------------------------------------------------------------------- /components/teams_ui/spec/dummy/bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | APP_PATH = File.expand_path('../../config/application', __FILE__) 3 | require_relative '../config/boot' 4 | require 'rails/commands' 5 | -------------------------------------------------------------------------------- /config/boot.rb: -------------------------------------------------------------------------------- 1 | # Set up gems listed in the Gemfile. 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 3 | 4 | require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) 5 | -------------------------------------------------------------------------------- /bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | begin 3 | load File.expand_path("../spring", __FILE__) 4 | rescue LoadError 5 | end 6 | require_relative '../config/boot' 7 | require 'rake' 8 | Rake.application.run 9 | -------------------------------------------------------------------------------- /components/games/spec/dummy/config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require ::File.expand_path('../config/environment', __FILE__) 4 | run Rails.application 5 | -------------------------------------------------------------------------------- /components/games/spec/dummy/config/initializers/cookies_serializer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Rails.application.config.action_dispatch.cookies_serializer = :json -------------------------------------------------------------------------------- /components/games_ui/app/controllers/games_ui/application_controller.rb: -------------------------------------------------------------------------------- 1 | module GamesUi 2 | class ApplicationController < ActionController::Base 3 | layout "web_style/application" 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /components/games_ui/spec/dummy/config/initializers/cookies_serializer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Rails.application.config.action_dispatch.cookies_serializer = :json -------------------------------------------------------------------------------- /components/predictor_ui/spec/dummy/bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | APP_PATH = File.expand_path('../../config/application', __FILE__) 3 | require_relative '../config/boot' 4 | require 'rails/commands' 5 | -------------------------------------------------------------------------------- /components/teams/spec/dummy/config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require ::File.expand_path('../config/environment', __FILE__) 4 | run Rails.application 5 | -------------------------------------------------------------------------------- /components/teams/spec/dummy/config/initializers/cookies_serializer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Rails.application.config.action_dispatch.cookies_serializer = :json -------------------------------------------------------------------------------- /components/teams_ui/app/controllers/teams_ui/application_controller.rb: -------------------------------------------------------------------------------- 1 | module TeamsUi 2 | class ApplicationController < ActionController::Base 3 | layout "web_style/application" 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /components/teams_ui/spec/dummy/config/initializers/cookies_serializer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Rails.application.config.action_dispatch.cookies_serializer = :json -------------------------------------------------------------------------------- /components/welcome_ui/spec/dummy/bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | APP_PATH = File.expand_path('../../config/application', __FILE__) 3 | require_relative '../config/boot' 4 | require 'rails/commands' 5 | -------------------------------------------------------------------------------- /config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | -------------------------------------------------------------------------------- /components/games/spec/dummy/config/initializers/session_store.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Rails.application.config.session_store :cookie_store, key: '_dummy_session' 4 | -------------------------------------------------------------------------------- /components/games_ui/spec/dummy/config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require ::File.expand_path('../config/environment', __FILE__) 4 | run Rails.application 5 | -------------------------------------------------------------------------------- /components/predictor_ui/spec/dummy/config/initializers/cookies_serializer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Rails.application.config.action_dispatch.cookies_serializer = :json -------------------------------------------------------------------------------- /components/teams/spec/dummy/config/initializers/session_store.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Rails.application.config.session_store :cookie_store, key: '_dummy_session' 4 | -------------------------------------------------------------------------------- /components/teams_ui/spec/dummy/config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require ::File.expand_path('../config/environment', __FILE__) 4 | run Rails.application 5 | -------------------------------------------------------------------------------- /components/welcome_ui/app/controllers/welcome_ui/application_controller.rb: -------------------------------------------------------------------------------- 1 | module WelcomeUi 2 | class ApplicationController < ActionController::Base 3 | layout "web_style/application" 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /components/welcome_ui/spec/dummy/config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require ::File.expand_path('../config/environment', __FILE__) 4 | run Rails.application 5 | -------------------------------------------------------------------------------- /components/welcome_ui/spec/dummy/config/initializers/cookies_serializer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Rails.application.config.action_dispatch.cookies_serializer = :json -------------------------------------------------------------------------------- /components/games/db/migrate/20150409032329_move_app_games_to_games_games.rb: -------------------------------------------------------------------------------- 1 | class MoveAppGamesToGamesGames < ActiveRecord::Migration 2 | def change 3 | rename_table :app_games, :games_games 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /components/games_ui/app/views/games_ui/games/edit.html.slim: -------------------------------------------------------------------------------- 1 | h1 Editing game 2 | 3 | == render 'form' 4 | 5 | = link_to 'Show', @game, class: "button" 6 | '| 7 | = link_to 'Back', games_path, class: "button" 8 | 9 | -------------------------------------------------------------------------------- /components/games_ui/spec/dummy/config/initializers/session_store.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Rails.application.config.session_store :cookie_store, key: '_dummy_session' 4 | -------------------------------------------------------------------------------- /components/predictor_ui/app/controllers/predictor_ui/application_controller.rb: -------------------------------------------------------------------------------- 1 | module PredictorUi 2 | class ApplicationController < ActionController::Base 3 | layout "web_style/application" 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /components/predictor_ui/spec/dummy/config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require ::File.expand_path('../config/environment', __FILE__) 4 | run Rails.application 5 | -------------------------------------------------------------------------------- /components/teams/db/migrate/20150409014709_move_app_team_to_teams_teams.rb: -------------------------------------------------------------------------------- 1 | class MoveAppTeamToTeamsTeams < ActiveRecord::Migration 2 | def change 3 | rename_table :app_teams, :teams_teams 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /components/teams_ui/spec/dummy/config/initializers/session_store.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Rails.application.config.session_store :cookie_store, key: '_dummy_session' 4 | -------------------------------------------------------------------------------- /components/welcome_ui/spec/dummy/config/initializers/session_store.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Rails.application.config.session_store :cookie_store, key: '_dummy_session' 4 | -------------------------------------------------------------------------------- /components/games/spec/dummy/config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require File.expand_path('../application', __FILE__) 3 | 4 | # Initialize the Rails application. 5 | Rails.application.initialize! 6 | -------------------------------------------------------------------------------- /components/games_ui/spec/dummy/config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require File.expand_path('../application', __FILE__) 3 | 4 | # Initialize the Rails application. 5 | Rails.application.initialize! 6 | -------------------------------------------------------------------------------- /components/predictor_ui/spec/dummy/config/initializers/session_store.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Rails.application.config.session_store :cookie_store, key: '_dummy_session' 4 | -------------------------------------------------------------------------------- /components/teams/spec/dummy/config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require File.expand_path('../application', __FILE__) 3 | 4 | # Initialize the Rails application. 5 | Rails.application.initialize! 6 | -------------------------------------------------------------------------------- /components/teams_ui/spec/dummy/config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require File.expand_path('../application', __FILE__) 3 | 4 | # Initialize the Rails application. 5 | Rails.application.initialize! 6 | -------------------------------------------------------------------------------- /components/predictor_ui/spec/dummy/config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require File.expand_path('../application', __FILE__) 3 | 4 | # Initialize the Rails application. 5 | Rails.application.initialize! 6 | -------------------------------------------------------------------------------- /components/welcome_ui/spec/dummy/config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require File.expand_path('../application', __FILE__) 3 | 4 | # Initialize the Rails application. 5 | Rails.application.initialize! 6 | -------------------------------------------------------------------------------- /components/games/spec/dummy/config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | -------------------------------------------------------------------------------- /components/predictor/test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | exit_code=0 4 | 5 | echo "*** Running predictor gem specs" 6 | bundle install | grep Installing 7 | bundle exec rspec spec 8 | exit_code+=$? 9 | 10 | exit $exit_code 11 | -------------------------------------------------------------------------------- /components/teams/spec/dummy/config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | -------------------------------------------------------------------------------- /components/games_ui/spec/dummy/config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | -------------------------------------------------------------------------------- /components/teams_ui/spec/dummy/config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | -------------------------------------------------------------------------------- /components/welcome_ui/spec/dummy/config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | -------------------------------------------------------------------------------- /components/predictor_ui/spec/dummy/config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file 2 | # 3 | # To ban all spiders from the entire site uncomment the next two lines: 4 | # User-agent: * 5 | # Disallow: / 6 | -------------------------------------------------------------------------------- /components/welcome_ui/Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | gemspec 4 | 5 | gem "trueskill", git: "https://github.com/benjaminleesmith/trueskill", ref: "e404f45af5b3fb86982881ce064a9c764cc6a901" 6 | 7 | path "../" do 8 | gem "web_style" 9 | end -------------------------------------------------------------------------------- /config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure sensitive parameters which will be filtered from the log file. 4 | Rails.application.config.filter_parameters += [:password] 5 | -------------------------------------------------------------------------------- /bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | begin 3 | load File.expand_path("../spring", __FILE__) 4 | rescue LoadError 5 | end 6 | APP_PATH = File.expand_path('../../config/application', __FILE__) 7 | require_relative '../config/boot' 8 | require 'rails/commands' 9 | -------------------------------------------------------------------------------- /components/teams/db/migrate/20150110181102_create_app_teams.rb: -------------------------------------------------------------------------------- 1 | class CreateAppTeams < ActiveRecord::Migration 2 | def change 3 | create_table :app_teams do |t| 4 | t.string :name 5 | 6 | t.timestamps 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /components/games_ui/spec/nav_entry_spec.rb: -------------------------------------------------------------------------------- 1 | RSpec.describe "nav entry" do 2 | it "points at the list of games" do 3 | entry = GamesUi.nav_entry 4 | expect(entry[:name]).to eq "Games" 5 | expect(entry[:link].call).to eq "/games_ui/games" 6 | end 7 | end -------------------------------------------------------------------------------- /components/predictor/Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | # Specify your gem's dependencies in predictor.gemspec 4 | gemspec 5 | 6 | gem "trueskill", git: "https://github.com/benjaminleesmith/trueskill", ref: "e404f45af5b3fb86982881ce064a9c764cc6a901" 7 | -------------------------------------------------------------------------------- /components/predictor_ui/app/views/predictor_ui/predictions/create.html.slim: -------------------------------------------------------------------------------- 1 | h1 Prediction 2 | 3 | =prediction_text @prediction.first_team, @prediction.second_team, @prediction.winner 4 | 5 | .actions 6 | = link_to "Try again!", new_prediction_path, class: "button" -------------------------------------------------------------------------------- /components/teams_ui/spec/nav_entry_spec.rb: -------------------------------------------------------------------------------- 1 | RSpec.describe "nav entry" do 2 | it "points at the list of games" do 3 | entry = TeamsUi.nav_entry 4 | expect(entry[:name]).to eq "Teams" 5 | expect(entry[:link].call).to eq "/teams_ui/teams" 6 | end 7 | end -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require File.expand_path('../config/application', __FILE__) 5 | 6 | Rails.application.load_tasks 7 | -------------------------------------------------------------------------------- /components/games_ui/Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | gemspec 4 | 5 | gem "trueskill", git: "https://github.com/benjaminleesmith/trueskill", ref: "e404f45af5b3fb86982881ce064a9c764cc6a901" 6 | 7 | path "../" do 8 | gem "games" 9 | gem "web_style" 10 | end -------------------------------------------------------------------------------- /components/teams_ui/Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | gemspec 4 | 5 | gem "trueskill", git: "https://github.com/benjaminleesmith/trueskill", ref: "e404f45af5b3fb86982881ce064a9c764cc6a901" 6 | 7 | path "../" do 8 | gem "teams" 9 | gem "web_style" 10 | end -------------------------------------------------------------------------------- /components/games/spec/dummy/config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure sensitive parameters which will be filtered from the log file. 4 | Rails.application.config.filter_parameters += [:password] 5 | -------------------------------------------------------------------------------- /components/games_ui/spec/dummy/config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure sensitive parameters which will be filtered from the log file. 4 | Rails.application.config.filter_parameters += [:password] 5 | -------------------------------------------------------------------------------- /components/games_ui/spec/support/view_spec_fixes.rb: -------------------------------------------------------------------------------- 1 | ActionView::TestCase::TestController.instance_eval do 2 | helper GamesUi::Engine.routes.url_helpers 3 | end 4 | ActionView::TestCase::TestController.class_eval do 5 | def _routes 6 | GamesUi::Engine.routes 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /components/teams/spec/dummy/config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure sensitive parameters which will be filtered from the log file. 4 | Rails.application.config.filter_parameters += [:password] 5 | -------------------------------------------------------------------------------- /components/teams_ui/spec/dummy/config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure sensitive parameters which will be filtered from the log file. 4 | Rails.application.config.filter_parameters += [:password] 5 | -------------------------------------------------------------------------------- /components/teams_ui/spec/support/view_spec_fixes.rb: -------------------------------------------------------------------------------- 1 | ActionView::TestCase::TestController.instance_eval do 2 | helper TeamsUi::Engine.routes.url_helpers 3 | end 4 | ActionView::TestCase::TestController.class_eval do 5 | def _routes 6 | TeamsUi::Engine.routes 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /components/games/spec/dummy/app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | # Prevent CSRF attacks by raising an exception. 3 | # For APIs, you may want to use :null_session instead. 4 | protect_from_forgery with: :exception 5 | end 6 | -------------------------------------------------------------------------------- /components/predictor_ui/spec/dummy/config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure sensitive parameters which will be filtered from the log file. 4 | Rails.application.config.filter_parameters += [:password] 5 | -------------------------------------------------------------------------------- /components/predictor_ui/spec/nav_entry_spec.rb: -------------------------------------------------------------------------------- 1 | RSpec.describe "nav entry" do 2 | it "points at the list of games" do 3 | entry = PredictorUi.nav_entry 4 | expect(entry[:name]).to eq "Predictions" 5 | expect(entry[:link].call).to eq "/predictor_ui/prediction/new" 6 | end 7 | end -------------------------------------------------------------------------------- /components/teams/spec/dummy/app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | # Prevent CSRF attacks by raising an exception. 3 | # For APIs, you may want to use :null_session instead. 4 | protect_from_forgery with: :exception 5 | end 6 | -------------------------------------------------------------------------------- /components/welcome_ui/spec/dummy/config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure sensitive parameters which will be filtered from the log file. 4 | Rails.application.config.filter_parameters += [:password] 5 | -------------------------------------------------------------------------------- /components/games_ui/spec/dummy/app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | # Prevent CSRF attacks by raising an exception. 3 | # For APIs, you may want to use :null_session instead. 4 | protect_from_forgery with: :exception 5 | end 6 | -------------------------------------------------------------------------------- /components/teams_ui/spec/dummy/app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | # Prevent CSRF attacks by raising an exception. 3 | # For APIs, you may want to use :null_session instead. 4 | protect_from_forgery with: :exception 5 | end 6 | -------------------------------------------------------------------------------- /components/welcome_ui/spec/dummy/app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | # Prevent CSRF attacks by raising an exception. 3 | # For APIs, you may want to use :null_session instead. 4 | protect_from_forgery with: :exception 5 | end 6 | -------------------------------------------------------------------------------- /components/games/spec/dummy/config/boot.rb: -------------------------------------------------------------------------------- 1 | # Set up gems listed in the Gemfile. 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__) 3 | 4 | require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) 5 | $LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__) 6 | -------------------------------------------------------------------------------- /components/predictor_ui/app/helpers/predictor_ui/predictions_helper.rb: -------------------------------------------------------------------------------- 1 | module PredictorUi 2 | module PredictionsHelper 3 | def prediction_text(team1, team2, winner) 4 | "In the game between #{team1.name} and #{team2.name} the winner will be #{winner.name}" 5 | end 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /components/predictor_ui/spec/dummy/app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | # Prevent CSRF attacks by raising an exception. 3 | # For APIs, you may want to use :null_session instead. 4 | protect_from_forgery with: :exception 5 | end 6 | -------------------------------------------------------------------------------- /components/teams/spec/dummy/config/boot.rb: -------------------------------------------------------------------------------- 1 | # Set up gems listed in the Gemfile. 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__) 3 | 4 | require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) 5 | $LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__) 6 | -------------------------------------------------------------------------------- /components/games_ui/spec/dummy/config/boot.rb: -------------------------------------------------------------------------------- 1 | # Set up gems listed in the Gemfile. 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__) 3 | 4 | require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) 5 | $LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__) 6 | -------------------------------------------------------------------------------- /components/teams_ui/spec/dummy/config/boot.rb: -------------------------------------------------------------------------------- 1 | # Set up gems listed in the Gemfile. 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__) 3 | 4 | require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) 5 | $LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__) 6 | -------------------------------------------------------------------------------- /components/welcome_ui/spec/dummy/config/boot.rb: -------------------------------------------------------------------------------- 1 | # Set up gems listed in the Gemfile. 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__) 3 | 4 | require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) 5 | $LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__) 6 | -------------------------------------------------------------------------------- /components/games/spec/dummy/Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require File.expand_path('../config/application', __FILE__) 5 | 6 | Rails.application.load_tasks 7 | -------------------------------------------------------------------------------- /components/games_ui/spec/dummy/Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require File.expand_path('../config/application', __FILE__) 5 | 6 | Rails.application.load_tasks 7 | -------------------------------------------------------------------------------- /components/predictor_ui/spec/dummy/config/boot.rb: -------------------------------------------------------------------------------- 1 | # Set up gems listed in the Gemfile. 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__) 3 | 4 | require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) 5 | $LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__) 6 | -------------------------------------------------------------------------------- /components/teams/spec/dummy/Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require File.expand_path('../config/application', __FILE__) 5 | 6 | Rails.application.load_tasks 7 | -------------------------------------------------------------------------------- /components/teams_ui/spec/dummy/Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require File.expand_path('../config/application', __FILE__) 5 | 6 | Rails.application.load_tasks 7 | -------------------------------------------------------------------------------- /test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | exit_code=0 4 | 5 | echo "*** Running container app specs" 6 | bundle install | grep Installing 7 | RAILS_ENV=test bundle exec rake db:create 8 | RAILS_ENV=test bundle exec rake db:migrate 9 | bundle exec rspec spec 10 | exit_code+=$? 11 | 12 | exit $exit_code 13 | 14 | -------------------------------------------------------------------------------- /components/predictor_ui/spec/dummy/Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require File.expand_path('../config/application', __FILE__) 5 | 6 | Rails.application.load_tasks 7 | -------------------------------------------------------------------------------- /components/welcome_ui/spec/dummy/Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require File.expand_path('../config/application', __FILE__) 5 | 6 | Rails.application.load_tasks 7 | -------------------------------------------------------------------------------- /config/routes.rb: -------------------------------------------------------------------------------- 1 | Rails.application.routes.draw do 2 | mount WelcomeUi::Engine, at: "/welcome_ui" 3 | 4 | mount TeamsUi::Engine, at: "/teams_ui" 5 | mount GamesUi::Engine, at: "/games_ui" 6 | mount PredictorUi::Engine, at: "/predictor_ui" 7 | 8 | root to: "welcome_ui/welcomes#show" 9 | end 10 | -------------------------------------------------------------------------------- /components/teams/test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | exit_code=0 4 | 5 | echo "*** Running team engine specs" 6 | bundle install | grep Installing 7 | RAILS_ENV=test bundle exec rake db:create 8 | RAILS_ENV=test bundle exec rake db:migrate 9 | bundle exec rspec spec 10 | exit_code+=$? 11 | 12 | exit $exit_code 13 | -------------------------------------------------------------------------------- /components/games_ui/test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | exit_code=0 4 | 5 | echo "*** Running games_ui engine specs" 6 | bundle install | grep Installing 7 | RAILS_ENV=test bundle exec rake db:create 8 | RAILS_ENV=test bundle exec rake db:migrate 9 | bundle exec rspec spec 10 | exit_code+=$? 11 | 12 | exit $exit_code 13 | -------------------------------------------------------------------------------- /components/predictor_ui/Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | gemspec 4 | 5 | gem "trueskill", git: "https://github.com/benjaminleesmith/trueskill", ref: "e404f45af5b3fb86982881ce064a9c764cc6a901" 6 | 7 | path "../" do 8 | gem "predictor" 9 | gem "teams" 10 | gem "games" 11 | gem "web_style" 12 | end -------------------------------------------------------------------------------- /components/teams_ui/test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | exit_code=0 4 | 5 | echo "*** Running teams_ui engine specs" 6 | bundle install | grep Installing 7 | RAILS_ENV=test bundle exec rake db:create 8 | RAILS_ENV=test bundle exec rake db:migrate 9 | bundle exec rspec spec 10 | exit_code+=$? 11 | 12 | exit $exit_code 13 | -------------------------------------------------------------------------------- /components/welcome_ui/test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | exit_code=0 4 | 5 | echo "*** Running welcome_ui engine specs" 6 | bundle install | grep Installing 7 | RAILS_ENV=test bundle exec rake db:create 8 | RAILS_ENV=test bundle exec rake db:migrate 9 | bundle exec rspec spec 10 | exit_code+=$? 11 | 12 | exit $exit_code 13 | -------------------------------------------------------------------------------- /components/games_ui/lib/games_ui.rb: -------------------------------------------------------------------------------- 1 | require "slim-rails" 2 | require "jquery-rails" 3 | 4 | require "games" 5 | require "web_style" 6 | 7 | module GamesUi 8 | require "games_ui/engine" 9 | 10 | def self.nav_entry 11 | {name: "Games", link: -> {::GamesUi::Engine.routes.url_helpers.games_path}} 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /components/predictor_ui/test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | exit_code=0 4 | 5 | echo "*** Running predictor_ui engine specs" 6 | bundle install | grep Installing 7 | RAILS_ENV=test bundle exec rake db:create 8 | RAILS_ENV=test bundle exec rake db:migrate 9 | bundle exec rspec spec 10 | exit_code+=$? 11 | 12 | exit $exit_code 13 | -------------------------------------------------------------------------------- /components/predictor/lib/predictor/prediction.rb: -------------------------------------------------------------------------------- 1 | module Predictor 2 | class Prediction 3 | attr_reader :first_team, :second_team, :winner 4 | 5 | def initialize(first_team, second_team, winner) 6 | @first_team = first_team 7 | @second_team = second_team 8 | @winner = winner 9 | end 10 | end 11 | end -------------------------------------------------------------------------------- /components/games/test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | exit_code=0 4 | 5 | echo "*** Running game engine specs" 6 | bundle install | grep Installing 7 | bundle exec rake db:create db:migrate 8 | RAILS_ENV=test bundle exec rake db:create 9 | RAILS_ENV=test bundle exec rake db:migrate 10 | bundle exec rspec spec 11 | exit_code+=$? 12 | 13 | exit $exit_code 14 | -------------------------------------------------------------------------------- /components/games_ui/spec/views/games_ui/games/show.html.slim_spec.rb: -------------------------------------------------------------------------------- 1 | RSpec.describe "games_ui/games/show", :type => :view do 2 | before(:each) do 3 | @game = assign(:game, create_game(location: "Location")) 4 | end 5 | 6 | it "renders attributes in

" do 7 | render 8 | expect(rendered).to match(/Location/) 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /components/teams_ui/lib/teams_ui.rb: -------------------------------------------------------------------------------- 1 | require "slim-rails" 2 | require "jquery-rails" 3 | 4 | require "teams" 5 | require "games" 6 | require "web_style" 7 | 8 | module TeamsUi 9 | require "teams_ui/engine" 10 | 11 | def self.nav_entry 12 | {name: "Teams", link: -> {::TeamsUi::Engine.routes.url_helpers.teams_path}} 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /components/welcome_ui/spec/controllers/welcomes_controller_spec.rb: -------------------------------------------------------------------------------- 1 | RSpec.describe WelcomeUi::WelcomesController, :type => :controller do 2 | routes { WelcomeUi::Engine.routes } 3 | 4 | describe "GET index" do 5 | it "returns http success" do 6 | get :show 7 | expect(response).to have_http_status(:success) 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /components/games/app/models/games/game.rb: -------------------------------------------------------------------------------- 1 | module Games 2 | class Game < ActiveRecord::Base 3 | validates :date, :location, :first_team, :second_team, :winning_team, 4 | :first_team_score, :second_team_score, presence: true 5 | belongs_to :first_team, class_name: 'Teams::Team' 6 | belongs_to :second_team, class_name: 'Teams::Team' 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /components/predictor_ui/spec/helpers/app/predictions_helper_spec.rb: -------------------------------------------------------------------------------- 1 | RSpec.describe PredictorUi::PredictionsHelper, :type => :helper do 2 | it "returns a nice prediction text" do 3 | Named = Struct.new(:name) 4 | text = prediction_text(Named.new("A"), Named.new("B"), Named.new("C")) 5 | expect(text).to eq "In the game between A and B the winner will be C" 6 | end 7 | end -------------------------------------------------------------------------------- /components/teams_ui/spec/features/teams_spec.rb: -------------------------------------------------------------------------------- 1 | RSpec.describe "teams admin", :type => :feature do 2 | before :each do 3 | team1 = create_team name: "UofL" 4 | team2 = create_team name: "UK" 5 | end 6 | 7 | it "allows for the management of teams" do 8 | visit '/teams_ui/teams' 9 | 10 | click_link "Teams" 11 | 12 | expect(page).to have_content 'UofL' 13 | end 14 | end -------------------------------------------------------------------------------- /components/web_style/app/assets/javascripts/web_style/application.js: -------------------------------------------------------------------------------- 1 | //= require web_style/modernizr.js 2 | //= require jquery 3 | //= require web_style/jquery.cookie.js 4 | //= require web_style/placeholder.js 5 | //= require web_style/fastclick.js 6 | //= require web_style/foundation.min.js 7 | //= require jquery_ujs 8 | 9 | $(document).ready(function(){ 10 | $(document).foundation(); 11 | }); -------------------------------------------------------------------------------- /components/games_ui/spec/views/games_ui/games/index.html.slim_spec.rb: -------------------------------------------------------------------------------- 1 | RSpec.describe "games_ui/games/index", :type => :view do 2 | before(:each) do 3 | assign(:games, [create_game(location: "Location"), create_game(location: "Location")]) 4 | end 5 | 6 | it "renders a list of games" do 7 | render 8 | assert_select "tr>td", :text => "Location".to_s, :count => 2 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /components/predictor_ui/lib/predictor_ui.rb: -------------------------------------------------------------------------------- 1 | require "slim-rails" 2 | require "jquery-rails" 3 | 4 | require "predictor" 5 | require "teams" 6 | require "games" 7 | require "web_style" 8 | 9 | module PredictorUi 10 | require "predictor_ui/engine" 11 | 12 | def self.nav_entry 13 | {name: "Predictions", link: -> {::PredictorUi::Engine.routes.url_helpers.new_prediction_path}} 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | gemfile: 2 | - Gemfile 3 | - components/welcome_ui/Gemfile 4 | - components/predictor/Gemfile 5 | - components/predictor_ui/Gemfile 6 | - components/teams/Gemfile 7 | - components/teams_ui/Gemfile 8 | - components/games/Gemfile 9 | - components/games_ui/Gemfile 10 | script: 11 | - travis_retry ./test.sh 12 | before_install: 13 | - cd $(dirname $BUNDLE_GEMFILE) 14 | rvm: 15 | - 2.2.2 16 | -------------------------------------------------------------------------------- /components/games/spec/dummy/app/views/layouts/application.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Dummy 5 | <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> 6 | <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> 7 | <%= csrf_meta_tags %> 8 | 9 | 10 | 11 | <%= yield %> 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /components/teams/spec/dummy/app/views/layouts/application.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Dummy 5 | <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> 6 | <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> 7 | <%= csrf_meta_tags %> 8 | 9 | 10 | 11 | <%= yield %> 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /components/games_ui/spec/dummy/app/views/layouts/application.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Dummy 5 | <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> 6 | <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> 7 | <%= csrf_meta_tags %> 8 | 9 | 10 | 11 | <%= yield %> 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /components/teams_ui/spec/dummy/app/views/layouts/application.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Dummy 5 | <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> 6 | <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> 7 | <%= csrf_meta_tags %> 8 | 9 | 10 | 11 | <%= yield %> 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /components/welcome_ui/spec/dummy/app/views/layouts/application.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Dummy 5 | <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> 6 | <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> 7 | <%= csrf_meta_tags %> 8 | 9 | 10 | 11 | <%= yield %> 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /config/initializers/assets.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Version of your assets, change this if you want to expire all your assets. 4 | Rails.application.config.assets.version = '1.0' 5 | 6 | # Precompile additional assets. 7 | # application.js, application.css, and all non-JS/CSS in app/assets folder are already added. 8 | # Rails.application.config.assets.precompile += %w( search.js ) 9 | -------------------------------------------------------------------------------- /components/predictor_ui/spec/dummy/app/views/layouts/application.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Dummy 5 | <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> 6 | <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> 7 | <%= csrf_meta_tags %> 8 | 9 | 10 | 11 | <%= yield %> 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Sportsball [![Build Status](https://travis-ci.org/shageman/sportsball.svg?branch=master)](https://travis-ci.org/shageman/sportsball) 2 | 3 | Sample application used for http://leanpub.com/cbra and http://railsconf.com/program/labs#prop_923. 4 | 5 | ## Usage 6 | Switch into the workshop branch and see via the tags 1 .. 10 how the extraction of various components within the sportsball app progresses. 7 | 8 | Enoy! 9 | Stephan Hagemann 10 | -------------------------------------------------------------------------------- /components/games/spec/dummy/config/initializers/assets.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Version of your assets, change this if you want to expire all your assets. 4 | Rails.application.config.assets.version = '1.0' 5 | 6 | # Precompile additional assets. 7 | # application.js, application.css, and all non-JS/CSS in game/assets folder are already added. 8 | # Rails.application.config.assets.precompile += %w( search.js ) 9 | -------------------------------------------------------------------------------- /components/teams/spec/dummy/config/initializers/assets.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Version of your assets, change this if you want to expire all your assets. 4 | Rails.application.config.assets.version = '1.0' 5 | 6 | # Precompile additional assets. 7 | # application.js, application.css, and all non-JS/CSS in app/assets folder are already added. 8 | # Rails.application.config.assets.precompile += %w( search.js ) 9 | -------------------------------------------------------------------------------- /components/teams_ui/app/views/teams_ui/teams/_form.html.slim: -------------------------------------------------------------------------------- 1 | = form_for @team do |f| 2 | - if @team.errors.any? 3 | #error_explanation 4 | h2 = "#{pluralize(@team.errors.count, "error")} prohibited this team from being saved:" 5 | ul 6 | - @team.errors.full_messages.each do |message| 7 | li = message 8 | 9 | .field 10 | = f.label :name 11 | = f.text_field :name 12 | .actions = f.submit class: "button" 13 | -------------------------------------------------------------------------------- /components/games_ui/spec/dummy/config/initializers/assets.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Version of your assets, change this if you want to expire all your assets. 4 | Rails.application.config.assets.version = '1.0' 5 | 6 | # Precompile additional assets. 7 | # application.js, application.css, and all non-JS/CSS in games_ui/assets folder are already added. 8 | # Rails.application.config.assets.precompile += %w( search.js ) 9 | -------------------------------------------------------------------------------- /components/predictor_ui/app/views/predictor_ui/predictions/new.html.slim: -------------------------------------------------------------------------------- 1 | h1 Predictions 2 | 3 | = form_tag prediction_path, method: "post" do |f| 4 | .field 5 | = label_tag :first_team_id 6 | = collection_select(:first_team, :id, @teams, :id, :name) 7 | 8 | .field 9 | = label_tag :second_team_id 10 | = collection_select(:second_team, :id, @teams, :id, :name) 11 | .actions = submit_tag "What is it going to be?", class: "button" 12 | 13 | -------------------------------------------------------------------------------- /components/teams_ui/spec/dummy/config/initializers/assets.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Version of your assets, change this if you want to expire all your assets. 4 | Rails.application.config.assets.version = '1.0' 5 | 6 | # Precompile additional assets. 7 | # application.js, application.css, and all non-JS/CSS in teams_ui/assets folder are already added. 8 | # Rails.application.config.assets.precompile += %w( search.js ) 9 | -------------------------------------------------------------------------------- /components/welcome_ui/spec/dummy/config/initializers/assets.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Version of your assets, change this if you want to expire all your assets. 4 | Rails.application.config.assets.version = '1.0' 5 | 6 | # Precompile additional assets. 7 | # application.js, application.css, and all non-JS/CSS in welcome_ui/assets folder are already added. 8 | # Rails.application.config.assets.precompile += %w( search.js ) 9 | -------------------------------------------------------------------------------- /config/initializers/backtrace_silencers.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. 4 | # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } 5 | 6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. 7 | # Rails.backtrace_cleaner.remove_silencers! 8 | -------------------------------------------------------------------------------- /components/games/db/migrate/20150110184219_create_app_games.rb: -------------------------------------------------------------------------------- 1 | class CreateAppGames < ActiveRecord::Migration 2 | def change 3 | create_table :app_games do |t| 4 | t.datetime :date 5 | t.string :location 6 | t.integer :first_team_id 7 | t.integer :second_team_id 8 | t.integer :winning_team 9 | t.integer :first_team_score 10 | t.integer :second_team_score 11 | 12 | t.timestamps 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /components/predictor_ui/spec/dummy/config/initializers/assets.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Version of your assets, change this if you want to expire all your assets. 4 | Rails.application.config.assets.version = '1.0' 5 | 6 | # Precompile additional assets. 7 | # application.js, application.css, and all non-JS/CSS in predictor_ui/assets folder are already added. 8 | # Rails.application.config.assets.precompile += %w( search.js ) 9 | -------------------------------------------------------------------------------- /components/web_style/lib/web_style/engine.rb: -------------------------------------------------------------------------------- 1 | module WebStyle 2 | class Engine < ::Rails::Engine 3 | isolate_namespace WebStyle 4 | 5 | initializer :append_migrations do |app| 6 | unless app.root.to_s.match root.to_s+File::SEPARATOR 7 | app.config.paths["db/migrate"].concat config.paths["db/migrate"].expanded 8 | end 9 | end 10 | 11 | config.generators do |g| 12 | g.template_engine :slim 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /components/teams_ui/spec/views/teams_ui/teams/new.html.slim_spec.rb: -------------------------------------------------------------------------------- 1 | RSpec.describe "teams_ui/teams/new", :type => :view do 2 | before(:each) do 3 | assign(:team, Teams::Team.new( 4 | :name => "MyString" 5 | )) 6 | end 7 | 8 | it "renders new team form" do 9 | render 10 | assert_select "form[action=?][method=?]", teams_ui.teams_path, "post" do 11 | assert_select "input#team_name[name=?]", "team[name]" 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /components/games_ui/spec/features/games_spec.rb: -------------------------------------------------------------------------------- 1 | RSpec.describe "games admin", :type => :feature do 2 | before :each do 3 | team1 = create_team name: "UofL" 4 | team2 = create_team name: "UK" 5 | 6 | create_game first_team: team1, second_team: team2, winning_team: 1 7 | end 8 | 9 | it "allows for the management of games" do 10 | visit '/games_ui/games' 11 | 12 | click_link "Games" 13 | 14 | expect(page).to have_content 'UofL' 15 | end 16 | end -------------------------------------------------------------------------------- /components/web_style/web_style.gemspec: -------------------------------------------------------------------------------- 1 | Gem::Specification.new do |s| 2 | s.name = "web_style" 3 | s.version = "0.0.1" 4 | s.authors = ["The CBRA Book"] 5 | s.summary = "CBRA component" 6 | 7 | s.test_files = Dir["spec/**/*"] 8 | s.files = Dir["{app,config,db,lib}/**/*", "Rakefile", "README.rdoc"] 9 | 10 | s.add_dependency "rails", "4.1.9" 11 | s.add_dependency "slim-rails", "3.0.1" 12 | s.add_dependency "jquery-rails", "3.1.2" 13 | end 14 | -------------------------------------------------------------------------------- /components/games/spec/dummy/config/initializers/backtrace_silencers.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. 4 | # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } 5 | 6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. 7 | # Rails.backtrace_cleaner.remove_silencers! 8 | -------------------------------------------------------------------------------- /components/teams/spec/dummy/config/initializers/backtrace_silencers.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. 4 | # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } 5 | 6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. 7 | # Rails.backtrace_cleaner.remove_silencers! 8 | -------------------------------------------------------------------------------- /components/games_ui/spec/dummy/config/initializers/backtrace_silencers.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. 4 | # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } 5 | 6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. 7 | # Rails.backtrace_cleaner.remove_silencers! 8 | -------------------------------------------------------------------------------- /components/teams_ui/spec/dummy/config/initializers/backtrace_silencers.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. 4 | # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } 5 | 6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. 7 | # Rails.backtrace_cleaner.remove_silencers! 8 | -------------------------------------------------------------------------------- /components/welcome_ui/spec/dummy/config/initializers/backtrace_silencers.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. 4 | # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } 5 | 6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. 7 | # Rails.backtrace_cleaner.remove_silencers! 8 | -------------------------------------------------------------------------------- /components/games/lib/games/engine.rb: -------------------------------------------------------------------------------- 1 | module Games 2 | class Engine < ::Rails::Engine 3 | isolate_namespace Games 4 | 5 | initializer :append_migrations do |app| 6 | unless app.root.to_s.match root.to_s+File::SEPARATOR 7 | app.config.paths["db/migrate"].concat config.paths["db/migrate"].expanded 8 | end 9 | end 10 | 11 | config.generators do |g| 12 | g.orm :active_record 13 | g.test_framework :rspec 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /components/predictor_ui/spec/dummy/config/initializers/backtrace_silencers.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. 4 | # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } 5 | 6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. 7 | # Rails.backtrace_cleaner.remove_silencers! 8 | -------------------------------------------------------------------------------- /components/teams/lib/teams/engine.rb: -------------------------------------------------------------------------------- 1 | module Teams 2 | class Engine < ::Rails::Engine 3 | isolate_namespace Teams 4 | 5 | initializer :append_migrations do |app| 6 | unless app.root.to_s.match root.to_s+File::SEPARATOR 7 | app.config.paths["db/migrate"].concat config.paths["db/migrate"].expanded 8 | end 9 | end 10 | 11 | config.generators do |g| 12 | g.orm :active_record 13 | g.test_framework :rspec 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /components/teams_ui/spec/views/teams_ui/teams/edit.html.slim_spec.rb: -------------------------------------------------------------------------------- 1 | RSpec.describe "teams_ui/teams/edit", :type => :view do 2 | before(:each) do 3 | @team = assign(:team, Teams::Team.create!( 4 | :name => "MyString" 5 | )) 6 | end 7 | 8 | it "renders the edit team form" do 9 | render 10 | 11 | assert_select "form[action=?][method=?]", teams_ui.team_path(@team), "post" do 12 | 13 | assert_select "input#team_name[name=?]", "team[name]" 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /components/teams_ui/app/views/teams_ui/teams/index.html.slim: -------------------------------------------------------------------------------- 1 | h1 Teams 2 | 3 | table 4 | thead 5 | tr 6 | th Name 7 | th 8 | th 9 | 10 | tbody 11 | - @teams.each do |team| 12 | tr 13 | td = team.name 14 | td = link_to 'Edit', edit_team_path(team), class: "button tiny" 15 | td = link_to 'Destroy', team, data: {:confirm => 'Are you sure?'}, :method => :delete, class: "button tiny alert" 16 | 17 | br 18 | 19 | = link_to 'New Team', new_team_path, class: "button" 20 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files for more about ignoring files. 2 | # 3 | # If you find yourself ignoring temporary files generated by your text editor 4 | # or operating system, you probably want to add a global ignore instead: 5 | # git config --global core.excludesfile '~/.gitignore_global' 6 | 7 | # Ignore bundler config. 8 | /.bundle 9 | 10 | # Ignore the default SQLite database. 11 | *.sqlite3 12 | *.sqlite3-journal 13 | 14 | # Ignore all logfiles and tempfiles. 15 | *.log 16 | tmp 17 | 18 | .idea -------------------------------------------------------------------------------- /components/games_ui/lib/games_ui/engine.rb: -------------------------------------------------------------------------------- 1 | module GamesUi 2 | class Engine < ::Rails::Engine 3 | isolate_namespace GamesUi 4 | 5 | initializer :append_migrations do |app| 6 | unless app.root.to_s.match root.to_s+File::SEPARATOR 7 | app.config.paths["db/migrate"].concat config.paths["db/migrate"].expanded 8 | end 9 | end 10 | 11 | config.generators do |g| 12 | g.orm :active_record 13 | g.template_engine :slim 14 | g.test_framework :rspec 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /components/teams_ui/lib/teams_ui/engine.rb: -------------------------------------------------------------------------------- 1 | module TeamsUi 2 | class Engine < ::Rails::Engine 3 | isolate_namespace TeamsUi 4 | 5 | initializer :append_migrations do |app| 6 | unless app.root.to_s.match root.to_s+File::SEPARATOR 7 | app.config.paths["db/migrate"].concat config.paths["db/migrate"].expanded 8 | end 9 | end 10 | 11 | config.generators do |g| 12 | g.orm :active_record 13 | g.template_engine :slim 14 | g.test_framework :rspec 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /components/predictor_ui/app/controllers/predictor_ui/predictions_controller.rb: -------------------------------------------------------------------------------- 1 | module PredictorUi 2 | class PredictionsController < ApplicationController 3 | def new 4 | @teams = Teams::Team.all 5 | end 6 | 7 | def create 8 | predictor = ::Predictor::Predictor.new(Teams::Team.all) 9 | predictor.learn(Games::Game.all) 10 | @prediction = predictor.predict( 11 | Teams::Team.find(params['first_team']['id']), 12 | Teams::Team.find(params['second_team']['id'])) 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /components/welcome_ui/lib/welcome_ui/engine.rb: -------------------------------------------------------------------------------- 1 | module WelcomeUi 2 | class Engine < ::Rails::Engine 3 | isolate_namespace WelcomeUi 4 | 5 | initializer :append_migrations do |app| 6 | unless app.root.to_s.match root.to_s+File::SEPARATOR 7 | app.config.paths["db/migrate"].concat config.paths["db/migrate"].expanded 8 | end 9 | end 10 | 11 | config.generators do |g| 12 | g.orm :active_record 13 | g.template_engine :slim 14 | g.test_framework :rspec 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /components/games/bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # This command will automatically be run when you run "rails" with Rails 4 gems installed from the root of your application. 3 | 4 | ENGINE_ROOT = File.expand_path('../..', __FILE__) 5 | ENGINE_PATH = File.expand_path('../../lib/games/engine', __FILE__) 6 | 7 | # Set up gems listed in the Gemfile. 8 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 9 | require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) 10 | 11 | require 'rails/all' 12 | require 'rails/engine/commands' 13 | -------------------------------------------------------------------------------- /components/teams/bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # This command will automatically be run when you run "rails" with Rails 4 gems installed from the root of your application. 3 | 4 | ENGINE_ROOT = File.expand_path('../..', __FILE__) 5 | ENGINE_PATH = File.expand_path('../../lib/teams/engine', __FILE__) 6 | 7 | # Set up gems listed in the Gemfile. 8 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 9 | require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) 10 | 11 | require 'rails/all' 12 | require 'rails/engine/commands' 13 | -------------------------------------------------------------------------------- /components/games/spec/models/games/game_spec.rb: -------------------------------------------------------------------------------- 1 | RSpec.describe Games::Game do 2 | it { should validate_presence_of(:date) } 3 | it { should validate_presence_of(:location) } 4 | it { should validate_presence_of(:first_team) } 5 | it { should validate_presence_of(:second_team) } 6 | it { should validate_presence_of(:winning_team) } 7 | it { should validate_presence_of(:first_team_score) } 8 | it { should validate_presence_of(:second_team_score) } 9 | 10 | it { should belong_to :first_team} 11 | it { should belong_to :second_team} 12 | end 13 | -------------------------------------------------------------------------------- /components/predictor_ui/lib/predictor_ui/engine.rb: -------------------------------------------------------------------------------- 1 | module PredictorUi 2 | class Engine < ::Rails::Engine 3 | isolate_namespace PredictorUi 4 | 5 | initializer :append_migrations do |app| 6 | unless app.root.to_s.match root.to_s+File::SEPARATOR 7 | app.config.paths["db/migrate"].concat config.paths["db/migrate"].expanded 8 | end 9 | end 10 | 11 | config.generators do |g| 12 | g.orm :active_record 13 | g.template_engine :slim 14 | g.test_framework :rspec 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /components/games_ui/bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # This command will automatically be run when you run "rails" with Rails 4 gems installed from the root of your application. 3 | 4 | ENGINE_ROOT = File.expand_path('../..', __FILE__) 5 | ENGINE_PATH = File.expand_path('../../lib/games_ui/engine', __FILE__) 6 | 7 | # Set up gems listed in the Gemfile. 8 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 9 | require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) 10 | 11 | require 'rails/all' 12 | require 'rails/engine/commands' 13 | -------------------------------------------------------------------------------- /components/teams_ui/bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # This command will automatically be run when you run "rails" with Rails 4 gems installed from the root of your application. 3 | 4 | ENGINE_ROOT = File.expand_path('../..', __FILE__) 5 | ENGINE_PATH = File.expand_path('../../lib/teams_ui/engine', __FILE__) 6 | 7 | # Set up gems listed in the Gemfile. 8 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 9 | require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) 10 | 11 | require 'rails/all' 12 | require 'rails/engine/commands' 13 | -------------------------------------------------------------------------------- /components/welcome_ui/bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # This command will automatically be run when you run "rails" with Rails 4 gems installed from the root of your application. 3 | 4 | ENGINE_ROOT = File.expand_path('../..', __FILE__) 5 | ENGINE_PATH = File.expand_path('../../lib/welcome_ui/engine', __FILE__) 6 | 7 | # Set up gems listed in the Gemfile. 8 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 9 | require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) 10 | 11 | require 'rails/all' 12 | require 'rails/engine/commands' 13 | -------------------------------------------------------------------------------- /components/predictor_ui/bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # This command will automatically be run when you run "rails" with Rails 4 gems installed from the root of your application. 3 | 4 | ENGINE_ROOT = File.expand_path('../..', __FILE__) 5 | ENGINE_PATH = File.expand_path('../../lib/predictor_ui/engine', __FILE__) 6 | 7 | # Set up gems listed in the Gemfile. 8 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 9 | require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) 10 | 11 | require 'rails/all' 12 | require 'rails/engine/commands' 13 | -------------------------------------------------------------------------------- /components/teams_ui/spec/views/teams_ui/teams/index.html.slim_spec.rb: -------------------------------------------------------------------------------- 1 | RSpec.describe "teams_ui/teams/index", :type => :view do 2 | before(:each) do 3 | assign(:teams, [ 4 | Teams::Team.create!( 5 | :name => "Name" 6 | ), 7 | Teams::Team.create!( 8 | :name => "Name" 9 | ) 10 | ]) 11 | end 12 | 13 | it "renders a list of teams" do 14 | render 15 | assert_select "tr>td", :text => "Name".to_s, :count => 2 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /bin/spring: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | # This file loads spring without using Bundler, in order to be fast 4 | # It gets overwritten when you run the `spring binstub` command 5 | 6 | unless defined?(Spring) 7 | require "rubygems" 8 | require "bundler" 9 | 10 | if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m) 11 | ENV["GEM_PATH"] = ([Bundler.bundle_path.to_s] + Gem.path).join(File::PATH_SEPARATOR) 12 | ENV["GEM_HOME"] = "" 13 | Gem.paths = ENV 14 | 15 | gem "spring", match[1] 16 | require "spring/binstub" 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /config/initializers/wrap_parameters.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # This file contains settings for ActionController::ParamsWrapper which 4 | # is enabled by default. 5 | 6 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. 7 | ActiveSupport.on_load(:action_controller) do 8 | wrap_parameters format: [:json] if respond_to?(:wrap_parameters) 9 | end 10 | 11 | # To enable root element in JSON for ActiveRecord objects. 12 | # ActiveSupport.on_load(:active_record) do 13 | # self.include_root_in_json = true 14 | # end 15 | -------------------------------------------------------------------------------- /components/games/Rakefile: -------------------------------------------------------------------------------- 1 | begin 2 | require 'bundler/setup' 3 | rescue LoadError 4 | puts 'You must `gem install bundler` and `bundle install` to run rake tasks' 5 | end 6 | 7 | require 'rdoc/task' 8 | 9 | RDoc::Task.new(:rdoc) do |rdoc| 10 | rdoc.rdoc_dir = 'rdoc' 11 | rdoc.title = 'Games' 12 | rdoc.options << '--line-numbers' 13 | rdoc.rdoc_files.include('README.rdoc') 14 | rdoc.rdoc_files.include('lib/**/*.rb') 15 | end 16 | 17 | APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__) 18 | load 'rails/tasks/engine.rake' 19 | 20 | 21 | 22 | Bundler::GemHelper.install_tasks 23 | 24 | -------------------------------------------------------------------------------- /components/teams/Rakefile: -------------------------------------------------------------------------------- 1 | begin 2 | require 'bundler/setup' 3 | rescue LoadError 4 | puts 'You must `gem install bundler` and `bundle install` to run rake tasks' 5 | end 6 | 7 | require 'rdoc/task' 8 | 9 | RDoc::Task.new(:rdoc) do |rdoc| 10 | rdoc.rdoc_dir = 'rdoc' 11 | rdoc.title = 'Teams' 12 | rdoc.options << '--line-numbers' 13 | rdoc.rdoc_files.include('README.rdoc') 14 | rdoc.rdoc_files.include('lib/**/*.rb') 15 | end 16 | 17 | APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__) 18 | load 'rails/tasks/engine.rake' 19 | 20 | 21 | 22 | Bundler::GemHelper.install_tasks 23 | 24 | -------------------------------------------------------------------------------- /components/games_ui/Rakefile: -------------------------------------------------------------------------------- 1 | begin 2 | require 'bundler/setup' 3 | rescue LoadError 4 | puts 'You must `gem install bundler` and `bundle install` to run rake tasks' 5 | end 6 | 7 | require 'rdoc/task' 8 | 9 | RDoc::Task.new(:rdoc) do |rdoc| 10 | rdoc.rdoc_dir = 'rdoc' 11 | rdoc.title = 'GamesUi' 12 | rdoc.options << '--line-numbers' 13 | rdoc.rdoc_files.include('README.rdoc') 14 | rdoc.rdoc_files.include('lib/**/*.rb') 15 | end 16 | 17 | APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__) 18 | load 'rails/tasks/engine.rake' 19 | 20 | 21 | 22 | Bundler::GemHelper.install_tasks 23 | 24 | -------------------------------------------------------------------------------- /components/teams_ui/Rakefile: -------------------------------------------------------------------------------- 1 | begin 2 | require 'bundler/setup' 3 | rescue LoadError 4 | puts 'You must `gem install bundler` and `bundle install` to run rake tasks' 5 | end 6 | 7 | require 'rdoc/task' 8 | 9 | RDoc::Task.new(:rdoc) do |rdoc| 10 | rdoc.rdoc_dir = 'rdoc' 11 | rdoc.title = 'TeamsUi' 12 | rdoc.options << '--line-numbers' 13 | rdoc.rdoc_files.include('README.rdoc') 14 | rdoc.rdoc_files.include('lib/**/*.rb') 15 | end 16 | 17 | APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__) 18 | load 'rails/tasks/engine.rake' 19 | 20 | 21 | 22 | Bundler::GemHelper.install_tasks 23 | 24 | -------------------------------------------------------------------------------- /components/welcome_ui/welcome_ui.gemspec: -------------------------------------------------------------------------------- 1 | Gem::Specification.new do |s| 2 | s.name = "welcome_ui" 3 | s.version = "0.0.1" 4 | s.authors = ["The CBRA Book"] 5 | s.summary = "CBRA component" 6 | 7 | s.test_files = Dir["spec/**/*"] 8 | s.files = Dir["{app,config,db,lib}/**/*", "Rakefile", "README.rdoc"] 9 | 10 | s.add_dependency "rails", "4.1.9" 11 | s.add_dependency "slim-rails", "3.0.1" 12 | s.add_dependency "jquery-rails", "3.1.2" 13 | 14 | s.add_dependency "web_style" 15 | 16 | s.add_development_dependency "sqlite3" 17 | s.add_development_dependency "rspec-rails" 18 | end 19 | -------------------------------------------------------------------------------- /components/welcome_ui/Rakefile: -------------------------------------------------------------------------------- 1 | begin 2 | require 'bundler/setup' 3 | rescue LoadError 4 | puts 'You must `gem install bundler` and `bundle install` to run rake tasks' 5 | end 6 | 7 | require 'rdoc/task' 8 | 9 | RDoc::Task.new(:rdoc) do |rdoc| 10 | rdoc.rdoc_dir = 'rdoc' 11 | rdoc.title = 'WelcomeUi' 12 | rdoc.options << '--line-numbers' 13 | rdoc.rdoc_files.include('README.rdoc') 14 | rdoc.rdoc_files.include('lib/**/*.rb') 15 | end 16 | 17 | APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__) 18 | load 'rails/tasks/engine.rake' 19 | 20 | 21 | 22 | Bundler::GemHelper.install_tasks 23 | 24 | -------------------------------------------------------------------------------- /components/predictor_ui/Rakefile: -------------------------------------------------------------------------------- 1 | begin 2 | require 'bundler/setup' 3 | rescue LoadError 4 | puts 'You must `gem install bundler` and `bundle install` to run rake tasks' 5 | end 6 | 7 | require 'rdoc/task' 8 | 9 | RDoc::Task.new(:rdoc) do |rdoc| 10 | rdoc.rdoc_dir = 'rdoc' 11 | rdoc.title = 'PredictorUi' 12 | rdoc.options << '--line-numbers' 13 | rdoc.rdoc_files.include('README.rdoc') 14 | rdoc.rdoc_files.include('lib/**/*.rb') 15 | end 16 | 17 | APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__) 18 | load 'rails/tasks/engine.rake' 19 | 20 | 21 | 22 | Bundler::GemHelper.install_tasks 23 | 24 | -------------------------------------------------------------------------------- /components/games/spec/dummy/config/initializers/wrap_parameters.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # This file contains settings for ActionController::ParamsWrapper which 4 | # is enabled by default. 5 | 6 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. 7 | ActiveSupport.on_load(:action_controller) do 8 | wrap_parameters format: [:json] if respond_to?(:wrap_parameters) 9 | end 10 | 11 | # To enable root element in JSON for ActiveRecord objects. 12 | # ActiveSupport.on_load(:active_record) do 13 | # self.include_root_in_json = true 14 | # end 15 | -------------------------------------------------------------------------------- /components/games_ui/app/views/games_ui/games/show.html.slim: -------------------------------------------------------------------------------- 1 | p#notice = notice 2 | 3 | p 4 | strong Date: 5 | = @game.date 6 | p 7 | strong Location: 8 | = @game.location 9 | p 10 | strong First team: 11 | = @game.first_team.name 12 | p 13 | strong Second team: 14 | = @game.second_team.name 15 | p 16 | strong Winning team: 17 | = @game.winning_team 18 | p 19 | strong First team score: 20 | = @game.first_team_score 21 | p 22 | strong Second team score: 23 | = @game.second_team_score 24 | 25 | = link_to 'Edit', edit_game_path(@game), class: "button" 26 | '| 27 | = link_to 'Back', games_path, class: "button" 28 | -------------------------------------------------------------------------------- /components/games_ui/spec/dummy/config/initializers/wrap_parameters.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # This file contains settings for ActionController::ParamsWrapper which 4 | # is enabled by default. 5 | 6 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. 7 | ActiveSupport.on_load(:action_controller) do 8 | wrap_parameters format: [:json] if respond_to?(:wrap_parameters) 9 | end 10 | 11 | # To enable root element in JSON for ActiveRecord objects. 12 | # ActiveSupport.on_load(:active_record) do 13 | # self.include_root_in_json = true 14 | # end 15 | -------------------------------------------------------------------------------- /components/teams/spec/dummy/config/initializers/wrap_parameters.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # This file contains settings for ActionController::ParamsWrapper which 4 | # is enabled by default. 5 | 6 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. 7 | ActiveSupport.on_load(:action_controller) do 8 | wrap_parameters format: [:json] if respond_to?(:wrap_parameters) 9 | end 10 | 11 | # To enable root element in JSON for ActiveRecord objects. 12 | # ActiveSupport.on_load(:active_record) do 13 | # self.include_root_in_json = true 14 | # end 15 | -------------------------------------------------------------------------------- /components/teams_ui/spec/dummy/config/initializers/wrap_parameters.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # This file contains settings for ActionController::ParamsWrapper which 4 | # is enabled by default. 5 | 6 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. 7 | ActiveSupport.on_load(:action_controller) do 8 | wrap_parameters format: [:json] if respond_to?(:wrap_parameters) 9 | end 10 | 11 | # To enable root element in JSON for ActiveRecord objects. 12 | # ActiveSupport.on_load(:active_record) do 13 | # self.include_root_in_json = true 14 | # end 15 | -------------------------------------------------------------------------------- /components/games/spec/dummy/README.rdoc: -------------------------------------------------------------------------------- 1 | == README 2 | 3 | This README would normally document whatever steps are necessary to get the 4 | application up and running. 5 | 6 | Things you may want to cover: 7 | 8 | * Ruby version 9 | 10 | * System dependencies 11 | 12 | * Configuration 13 | 14 | * Database creation 15 | 16 | * Database initialization 17 | 18 | * How to run the test suite 19 | 20 | * Services (job queues, cache servers, search engines, etc.) 21 | 22 | * Deployment instructions 23 | 24 | * ... 25 | 26 | 27 | Please feel free to use a different markup language if you do not plan to run 28 | rake doc:game. 29 | -------------------------------------------------------------------------------- /components/games_ui/spec/dummy/README.rdoc: -------------------------------------------------------------------------------- 1 | == README 2 | 3 | This README would normally document whatever steps are necessary to get the 4 | application up and running. 5 | 6 | Things you may want to cover: 7 | 8 | * Ruby version 9 | 10 | * System dependencies 11 | 12 | * Configuration 13 | 14 | * Database creation 15 | 16 | * Database initialization 17 | 18 | * How to run the test suite 19 | 20 | * Services (job queues, cache servers, search engines, etc.) 21 | 22 | * Deployment instructions 23 | 24 | * ... 25 | 26 | 27 | Please feel free to use a different markup language if you do not plan to run 28 | rake doc:app. 29 | -------------------------------------------------------------------------------- /components/predictor_ui/spec/dummy/config/initializers/wrap_parameters.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # This file contains settings for ActionController::ParamsWrapper which 4 | # is enabled by default. 5 | 6 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. 7 | ActiveSupport.on_load(:action_controller) do 8 | wrap_parameters format: [:json] if respond_to?(:wrap_parameters) 9 | end 10 | 11 | # To enable root element in JSON for ActiveRecord objects. 12 | # ActiveSupport.on_load(:active_record) do 13 | # self.include_root_in_json = true 14 | # end 15 | -------------------------------------------------------------------------------- /components/teams/spec/dummy/README.rdoc: -------------------------------------------------------------------------------- 1 | == README 2 | 3 | This README would normally document whatever steps are necessary to get the 4 | application up and running. 5 | 6 | Things you may want to cover: 7 | 8 | * Ruby version 9 | 10 | * System dependencies 11 | 12 | * Configuration 13 | 14 | * Database creation 15 | 16 | * Database initialization 17 | 18 | * How to run the test suite 19 | 20 | * Services (job queues, cache servers, search engines, etc.) 21 | 22 | * Deployment instructions 23 | 24 | * ... 25 | 26 | 27 | Please feel free to use a different markup language if you do not plan to run 28 | rake doc:teams. 29 | -------------------------------------------------------------------------------- /components/teams_ui/spec/dummy/README.rdoc: -------------------------------------------------------------------------------- 1 | == README 2 | 3 | This README would normally document whatever steps are necessary to get the 4 | application up and running. 5 | 6 | Things you may want to cover: 7 | 8 | * Ruby version 9 | 10 | * System dependencies 11 | 12 | * Configuration 13 | 14 | * Database creation 15 | 16 | * Database initialization 17 | 18 | * How to run the test suite 19 | 20 | * Services (job queues, cache servers, search engines, etc.) 21 | 22 | * Deployment instructions 23 | 24 | * ... 25 | 26 | 27 | Please feel free to use a different markup language if you do not plan to run 28 | rake doc:app. 29 | -------------------------------------------------------------------------------- /components/welcome_ui/spec/dummy/README.rdoc: -------------------------------------------------------------------------------- 1 | == README 2 | 3 | This README would normally document whatever steps are necessary to get the 4 | application up and running. 5 | 6 | Things you may want to cover: 7 | 8 | * Ruby version 9 | 10 | * System dependencies 11 | 12 | * Configuration 13 | 14 | * Database creation 15 | 16 | * Database initialization 17 | 18 | * How to run the test suite 19 | 20 | * Services (job queues, cache servers, search engines, etc.) 21 | 22 | * Deployment instructions 23 | 24 | * ... 25 | 26 | 27 | Please feel free to use a different markup language if you do not plan to run 28 | rake doc:app. 29 | -------------------------------------------------------------------------------- /components/welcome_ui/spec/dummy/config/initializers/wrap_parameters.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # This file contains settings for ActionController::ParamsWrapper which 4 | # is enabled by default. 5 | 6 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. 7 | ActiveSupport.on_load(:action_controller) do 8 | wrap_parameters format: [:json] if respond_to?(:wrap_parameters) 9 | end 10 | 11 | # To enable root element in JSON for ActiveRecord objects. 12 | # ActiveSupport.on_load(:active_record) do 13 | # self.include_root_in_json = true 14 | # end 15 | -------------------------------------------------------------------------------- /components/predictor_ui/spec/dummy/README.rdoc: -------------------------------------------------------------------------------- 1 | == README 2 | 3 | This README would normally document whatever steps are necessary to get the 4 | application up and running. 5 | 6 | Things you may want to cover: 7 | 8 | * Ruby version 9 | 10 | * System dependencies 11 | 12 | * Configuration 13 | 14 | * Database creation 15 | 16 | * Database initialization 17 | 18 | * How to run the test suite 19 | 20 | * Services (job queues, cache servers, search engines, etc.) 21 | 22 | * Deployment instructions 23 | 24 | * ... 25 | 26 | 27 | Please feel free to use a different markup language if you do not plan to run 28 | rake doc:app. 29 | -------------------------------------------------------------------------------- /components/teams/teams.gemspec: -------------------------------------------------------------------------------- 1 | Gem::Specification.new do |s| 2 | s.name = "teams" 3 | s.version = "0.0.1" 4 | s.authors = ["The CBRA Book"] 5 | s.summary = "CBRA component teams" 6 | 7 | s.test_files = Dir["spec/**/*"] 8 | s.files = Dir["{app,config,db,lib}/**/*", "Rakefile", "README.rdoc"] 9 | 10 | s.add_dependency "activerecord", "4.1.9" 11 | 12 | s.add_development_dependency "sqlite3" 13 | s.add_development_dependency "rspec-rails" 14 | s.add_development_dependency "shoulda-matchers" 15 | s.add_development_dependency "database_cleaner" 16 | s.add_development_dependency "rails", "4.1.9" 17 | end 18 | -------------------------------------------------------------------------------- /components/games/games.gemspec: -------------------------------------------------------------------------------- 1 | Gem::Specification.new do |s| 2 | s.name = "games" 3 | s.version = "0.0.1" 4 | s.authors = ["The CBRA Book"] 5 | s.summary = "CBRA component" 6 | 7 | s.test_files = Dir["spec/**/*"] 8 | s.files = Dir["{app,config,db,lib}/**/*", "Rakefile", "README.rdoc"] 9 | 10 | s.add_dependency "activerecord", "4.1.9" 11 | 12 | s.add_dependency "teams" 13 | 14 | s.add_development_dependency "sqlite3" 15 | s.add_development_dependency "rspec-rails" 16 | s.add_development_dependency "shoulda-matchers" 17 | s.add_development_dependency "database_cleaner" 18 | s.add_development_dependency "rails" 19 | end 20 | -------------------------------------------------------------------------------- /config/database.yml: -------------------------------------------------------------------------------- 1 | # SQLite version 3.x 2 | # gem install sqlite3 3 | # 4 | # Ensure the SQLite 3 gem is defined in your Gemfile 5 | # gem 'sqlite3' 6 | # 7 | default: &default 8 | adapter: sqlite3 9 | pool: 5 10 | timeout: 5000 11 | 12 | development: 13 | <<: *default 14 | database: db/development.sqlite3 15 | 16 | # Warning: The database defined as "test" will be erased and 17 | # re-generated from your development database when you run "rake". 18 | # Do not set this db to the same as development or production. 19 | test: 20 | <<: *default 21 | database: db/test.sqlite3 22 | 23 | production: 24 | <<: *default 25 | database: db/production.sqlite3 26 | -------------------------------------------------------------------------------- /components/games/spec/dummy/config/database.yml: -------------------------------------------------------------------------------- 1 | # SQLite version 3.x 2 | # gem install sqlite3 3 | # 4 | # Ensure the SQLite 3 gem is defined in your Gemfile 5 | # gem 'sqlite3' 6 | # 7 | default: &default 8 | adapter: sqlite3 9 | pool: 5 10 | timeout: 5000 11 | 12 | development: 13 | <<: *default 14 | database: db/development.sqlite3 15 | 16 | # Warning: The database defined as "test" will be erased and 17 | # re-generated from your development database when you run "rake". 18 | # Do not set this db to the same as development or production. 19 | test: 20 | <<: *default 21 | database: db/test.sqlite3 22 | 23 | production: 24 | <<: *default 25 | database: db/production.sqlite3 26 | -------------------------------------------------------------------------------- /components/games_ui/spec/dummy/config/database.yml: -------------------------------------------------------------------------------- 1 | # SQLite version 3.x 2 | # gem install sqlite3 3 | # 4 | # Ensure the SQLite 3 gem is defined in your Gemfile 5 | # gem 'sqlite3' 6 | # 7 | default: &default 8 | adapter: sqlite3 9 | pool: 5 10 | timeout: 5000 11 | 12 | development: 13 | <<: *default 14 | database: db/development.sqlite3 15 | 16 | # Warning: The database defined as "test" will be erased and 17 | # re-generated from your development database when you run "rake". 18 | # Do not set this db to the same as development or production. 19 | test: 20 | <<: *default 21 | database: db/test.sqlite3 22 | 23 | production: 24 | <<: *default 25 | database: db/production.sqlite3 26 | -------------------------------------------------------------------------------- /components/teams/spec/dummy/config/database.yml: -------------------------------------------------------------------------------- 1 | # SQLite version 3.x 2 | # gem install sqlite3 3 | # 4 | # Ensure the SQLite 3 gem is defined in your Gemfile 5 | # gem 'sqlite3' 6 | # 7 | default: &default 8 | adapter: sqlite3 9 | pool: 5 10 | timeout: 5000 11 | 12 | development: 13 | <<: *default 14 | database: db/development.sqlite3 15 | 16 | # Warning: The database defined as "test" will be erased and 17 | # re-generated from your development database when you run "rake". 18 | # Do not set this db to the same as development or production. 19 | test: 20 | <<: *default 21 | database: db/test.sqlite3 22 | 23 | production: 24 | <<: *default 25 | database: db/production.sqlite3 26 | -------------------------------------------------------------------------------- /components/teams_ui/spec/dummy/config/database.yml: -------------------------------------------------------------------------------- 1 | # SQLite version 3.x 2 | # gem install sqlite3 3 | # 4 | # Ensure the SQLite 3 gem is defined in your Gemfile 5 | # gem 'sqlite3' 6 | # 7 | default: &default 8 | adapter: sqlite3 9 | pool: 5 10 | timeout: 5000 11 | 12 | development: 13 | <<: *default 14 | database: db/development.sqlite3 15 | 16 | # Warning: The database defined as "test" will be erased and 17 | # re-generated from your development database when you run "rake". 18 | # Do not set this db to the same as development or production. 19 | test: 20 | <<: *default 21 | database: db/test.sqlite3 22 | 23 | production: 24 | <<: *default 25 | database: db/production.sqlite3 26 | -------------------------------------------------------------------------------- /components/games/spec/dummy/app/assets/javascripts/application.js: -------------------------------------------------------------------------------- 1 | // This is a manifest file that'll be compiled into application.js, which will include all the files 2 | // listed below. 3 | // 4 | // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, 5 | // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. 6 | // 7 | // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the 8 | // compiled file. 9 | // 10 | // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details 11 | // about supported directives. 12 | // 13 | //= require_tree . 14 | -------------------------------------------------------------------------------- /components/games_ui/spec/dummy/app/assets/javascripts/application.js: -------------------------------------------------------------------------------- 1 | // This is a manifest file that'll be compiled into application.js, which will include all the files 2 | // listed below. 3 | // 4 | // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, 5 | // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. 6 | // 7 | // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the 8 | // compiled file. 9 | // 10 | // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details 11 | // about supported directives. 12 | // 13 | //= require_tree . 14 | -------------------------------------------------------------------------------- /components/predictor_ui/spec/dummy/config/database.yml: -------------------------------------------------------------------------------- 1 | # SQLite version 3.x 2 | # gem install sqlite3 3 | # 4 | # Ensure the SQLite 3 gem is defined in your Gemfile 5 | # gem 'sqlite3' 6 | # 7 | default: &default 8 | adapter: sqlite3 9 | pool: 5 10 | timeout: 5000 11 | 12 | development: 13 | <<: *default 14 | database: db/development.sqlite3 15 | 16 | # Warning: The database defined as "test" will be erased and 17 | # re-generated from your development database when you run "rake". 18 | # Do not set this db to the same as development or production. 19 | test: 20 | <<: *default 21 | database: db/test.sqlite3 22 | 23 | production: 24 | <<: *default 25 | database: db/production.sqlite3 26 | -------------------------------------------------------------------------------- /components/teams/spec/dummy/app/assets/javascripts/application.js: -------------------------------------------------------------------------------- 1 | // This is a manifest file that'll be compiled into application.js, which will include all the files 2 | // listed below. 3 | // 4 | // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, 5 | // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. 6 | // 7 | // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the 8 | // compiled file. 9 | // 10 | // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details 11 | // about supported directives. 12 | // 13 | //= require_tree . 14 | -------------------------------------------------------------------------------- /components/teams_ui/spec/dummy/app/assets/javascripts/application.js: -------------------------------------------------------------------------------- 1 | // This is a manifest file that'll be compiled into application.js, which will include all the files 2 | // listed below. 3 | // 4 | // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, 5 | // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. 6 | // 7 | // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the 8 | // compiled file. 9 | // 10 | // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details 11 | // about supported directives. 12 | // 13 | //= require_tree . 14 | -------------------------------------------------------------------------------- /components/welcome_ui/spec/dummy/config/database.yml: -------------------------------------------------------------------------------- 1 | # SQLite version 3.x 2 | # gem install sqlite3 3 | # 4 | # Ensure the SQLite 3 gem is defined in your Gemfile 5 | # gem 'sqlite3' 6 | # 7 | default: &default 8 | adapter: sqlite3 9 | pool: 5 10 | timeout: 5000 11 | 12 | development: 13 | <<: *default 14 | database: db/development.sqlite3 15 | 16 | # Warning: The database defined as "test" will be erased and 17 | # re-generated from your development database when you run "rake". 18 | # Do not set this db to the same as development or production. 19 | test: 20 | <<: *default 21 | database: db/test.sqlite3 22 | 23 | production: 24 | <<: *default 25 | database: db/production.sqlite3 26 | -------------------------------------------------------------------------------- /components/predictor_ui/spec/dummy/app/assets/javascripts/application.js: -------------------------------------------------------------------------------- 1 | // This is a manifest file that'll be compiled into application.js, which will include all the files 2 | // listed below. 3 | // 4 | // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, 5 | // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. 6 | // 7 | // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the 8 | // compiled file. 9 | // 10 | // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details 11 | // about supported directives. 12 | // 13 | //= require_tree . 14 | -------------------------------------------------------------------------------- /components/welcome_ui/spec/dummy/app/assets/javascripts/application.js: -------------------------------------------------------------------------------- 1 | // This is a manifest file that'll be compiled into application.js, which will include all the files 2 | // listed below. 3 | // 4 | // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, 5 | // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. 6 | // 7 | // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the 8 | // compiled file. 9 | // 10 | // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details 11 | // about supported directives. 12 | // 13 | //= require_tree . 14 | -------------------------------------------------------------------------------- /components/welcome_ui/spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | ENV["RAILS_ENV"] ||= 'test' 2 | 3 | require File.expand_path("../dummy/config/environment", __FILE__) 4 | 5 | require 'rspec/rails' 6 | 7 | Dir[WelcomeUi::Engine.root.join("spec/support/**/*.rb")].each {|f| require f} 8 | 9 | RSpec.configure do |config| 10 | config.expect_with :rspec do |expectations| 11 | expectations.include_chain_clauses_in_custom_matcher_descriptions = true 12 | end 13 | config.mock_with :rspec do |mocks| 14 | mocks.verify_partial_doubles = true 15 | end 16 | 17 | config.disable_monkey_patching! 18 | config.warnings = false 19 | config.profile_examples = nil 20 | config.order = :random 21 | Kernel.srand config.seed 22 | end 23 | -------------------------------------------------------------------------------- /config/initializers/inflections.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new inflection rules using the following format. Inflections 4 | # are locale specific, and you may define rules for as many different 5 | # locales as you wish. All of these examples are active by default: 6 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 7 | # inflect.plural /^(ox)$/i, '\1en' 8 | # inflect.singular /^(ox)en/i, '\1' 9 | # inflect.irregular 'person', 'people' 10 | # inflect.uncountable %w( fish sheep ) 11 | # end 12 | 13 | # These inflection rules are supported but not enabled by default: 14 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 15 | # inflect.acronym 'RESTful' 16 | # end 17 | -------------------------------------------------------------------------------- /config/locales/en.yml: -------------------------------------------------------------------------------- 1 | # Files in the config/locales directory are used for internationalization 2 | # and are automatically loaded by Rails. If you want to use locales other 3 | # than English, add the necessary files in this directory. 4 | # 5 | # To use the locales, use `I18n.t`: 6 | # 7 | # I18n.t 'hello' 8 | # 9 | # In views, this is aliased to just `t`: 10 | # 11 | # <%= t('hello') %> 12 | # 13 | # To use a different locale, set it with `I18n.locale`: 14 | # 15 | # I18n.locale = :es 16 | # 17 | # This would use the information in config/locales/es.yml. 18 | # 19 | # To learn more, please read the Rails Internationalization guide 20 | # available at http://guides.rubyonrails.org/i18n.html. 21 | 22 | en: 23 | hello: "Hello world" 24 | -------------------------------------------------------------------------------- /components/games/spec/dummy/config/initializers/inflections.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new inflection rules using the following format. Inflections 4 | # are locale specific, and you may define rules for as many different 5 | # locales as you wish. All of these examples are active by default: 6 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 7 | # inflect.plural /^(ox)$/i, '\1en' 8 | # inflect.singular /^(ox)en/i, '\1' 9 | # inflect.irregular 'person', 'people' 10 | # inflect.uncountable %w( fish sheep ) 11 | # end 12 | 13 | # These inflection rules are supported but not enabled by default: 14 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 15 | # inflect.acronym 'RESTful' 16 | # end 17 | -------------------------------------------------------------------------------- /components/games_ui/spec/dummy/config/initializers/inflections.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new inflection rules using the following format. Inflections 4 | # are locale specific, and you may define rules for as many different 5 | # locales as you wish. All of these examples are active by default: 6 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 7 | # inflect.plural /^(ox)$/i, '\1en' 8 | # inflect.singular /^(ox)en/i, '\1' 9 | # inflect.irregular 'person', 'people' 10 | # inflect.uncountable %w( fish sheep ) 11 | # end 12 | 13 | # These inflection rules are supported but not enabled by default: 14 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 15 | # inflect.acronym 'RESTful' 16 | # end 17 | -------------------------------------------------------------------------------- /components/teams/spec/dummy/config/initializers/inflections.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new inflection rules using the following format. Inflections 4 | # are locale specific, and you may define rules for as many different 5 | # locales as you wish. All of these examples are active by default: 6 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 7 | # inflect.plural /^(ox)$/i, '\1en' 8 | # inflect.singular /^(ox)en/i, '\1' 9 | # inflect.irregular 'person', 'people' 10 | # inflect.uncountable %w( fish sheep ) 11 | # end 12 | 13 | # These inflection rules are supported but not enabled by default: 14 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 15 | # inflect.acronym 'RESTful' 16 | # end 17 | -------------------------------------------------------------------------------- /components/teams_ui/spec/dummy/config/initializers/inflections.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new inflection rules using the following format. Inflections 4 | # are locale specific, and you may define rules for as many different 5 | # locales as you wish. All of these examples are active by default: 6 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 7 | # inflect.plural /^(ox)$/i, '\1en' 8 | # inflect.singular /^(ox)en/i, '\1' 9 | # inflect.irregular 'person', 'people' 10 | # inflect.uncountable %w( fish sheep ) 11 | # end 12 | 13 | # These inflection rules are supported but not enabled by default: 14 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 15 | # inflect.acronym 'RESTful' 16 | # end 17 | -------------------------------------------------------------------------------- /components/predictor_ui/spec/dummy/config/initializers/inflections.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new inflection rules using the following format. Inflections 4 | # are locale specific, and you may define rules for as many different 5 | # locales as you wish. All of these examples are active by default: 6 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 7 | # inflect.plural /^(ox)$/i, '\1en' 8 | # inflect.singular /^(ox)en/i, '\1' 9 | # inflect.irregular 'person', 'people' 10 | # inflect.uncountable %w( fish sheep ) 11 | # end 12 | 13 | # These inflection rules are supported but not enabled by default: 14 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 15 | # inflect.acronym 'RESTful' 16 | # end 17 | -------------------------------------------------------------------------------- /components/predictor_ui/spec/features/predictions_spec.rb: -------------------------------------------------------------------------------- 1 | RSpec.describe "the prediction process", :type => :feature do 2 | before :each do 3 | team1 = create_team name: "UofL" 4 | team2 = create_team name: "UK" 5 | 6 | create_game first_team: team1, second_team: team2, winning_team: 1 7 | create_game first_team: team2, second_team: team1, winning_team: 2 8 | create_game first_team: team2, second_team: team1, winning_team: 2 9 | end 10 | 11 | it "get a new prediction" do 12 | visit '/' 13 | 14 | click_link "Predictions" 15 | 16 | select "UofL", from: "First team" 17 | select "UK", from: "Second team" 18 | click_button 'What is it going to be' 19 | 20 | expect(page).to have_content 'the winner will be UofL' 21 | end 22 | end -------------------------------------------------------------------------------- /components/welcome_ui/spec/dummy/config/initializers/inflections.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new inflection rules using the following format. Inflections 4 | # are locale specific, and you may define rules for as many different 5 | # locales as you wish. All of these examples are active by default: 6 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 7 | # inflect.plural /^(ox)$/i, '\1en' 8 | # inflect.singular /^(ox)en/i, '\1' 9 | # inflect.irregular 'person', 'people' 10 | # inflect.uncountable %w( fish sheep ) 11 | # end 12 | 13 | # These inflection rules are supported but not enabled by default: 14 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 15 | # inflect.acronym 'RESTful' 16 | # end 17 | -------------------------------------------------------------------------------- /components/games/spec/dummy/config/locales/en.yml: -------------------------------------------------------------------------------- 1 | # Files in the config/locales directory are used for internationalization 2 | # and are automatically loaded by Rails. If you want to use locales other 3 | # than English, add the necessary files in this directory. 4 | # 5 | # To use the locales, use `I18n.t`: 6 | # 7 | # I18n.t 'hello' 8 | # 9 | # In views, this is aliased to just `t`: 10 | # 11 | # <%= t('hello') %> 12 | # 13 | # To use a different locale, set it with `I18n.locale`: 14 | # 15 | # I18n.locale = :es 16 | # 17 | # This would use the information in config/locales/es.yml. 18 | # 19 | # To learn more, please read the Rails Internationalization guide 20 | # available at http://guides.rubyonrails.org/i18n.html. 21 | 22 | en: 23 | hello: "Hello world" 24 | -------------------------------------------------------------------------------- /components/games_ui/spec/dummy/config/locales/en.yml: -------------------------------------------------------------------------------- 1 | # Files in the config/locales directory are used for internationalization 2 | # and are automatically loaded by Rails. If you want to use locales other 3 | # than English, add the necessary files in this directory. 4 | # 5 | # To use the locales, use `I18n.t`: 6 | # 7 | # I18n.t 'hello' 8 | # 9 | # In views, this is aliased to just `t`: 10 | # 11 | # <%= t('hello') %> 12 | # 13 | # To use a different locale, set it with `I18n.locale`: 14 | # 15 | # I18n.locale = :es 16 | # 17 | # This would use the information in config/locales/es.yml. 18 | # 19 | # To learn more, please read the Rails Internationalization guide 20 | # available at http://guides.rubyonrails.org/i18n.html. 21 | 22 | en: 23 | hello: "Hello world" 24 | -------------------------------------------------------------------------------- /components/teams/spec/dummy/config/locales/en.yml: -------------------------------------------------------------------------------- 1 | # Files in the config/locales directory are used for internationalization 2 | # and are automatically loaded by Rails. If you want to use locales other 3 | # than English, add the necessary files in this directory. 4 | # 5 | # To use the locales, use `I18n.t`: 6 | # 7 | # I18n.t 'hello' 8 | # 9 | # In views, this is aliased to just `t`: 10 | # 11 | # <%= t('hello') %> 12 | # 13 | # To use a different locale, set it with `I18n.locale`: 14 | # 15 | # I18n.locale = :es 16 | # 17 | # This would use the information in config/locales/es.yml. 18 | # 19 | # To learn more, please read the Rails Internationalization guide 20 | # available at http://guides.rubyonrails.org/i18n.html. 21 | 22 | en: 23 | hello: "Hello world" 24 | -------------------------------------------------------------------------------- /components/teams_ui/spec/dummy/config/locales/en.yml: -------------------------------------------------------------------------------- 1 | # Files in the config/locales directory are used for internationalization 2 | # and are automatically loaded by Rails. If you want to use locales other 3 | # than English, add the necessary files in this directory. 4 | # 5 | # To use the locales, use `I18n.t`: 6 | # 7 | # I18n.t 'hello' 8 | # 9 | # In views, this is aliased to just `t`: 10 | # 11 | # <%= t('hello') %> 12 | # 13 | # To use a different locale, set it with `I18n.locale`: 14 | # 15 | # I18n.locale = :es 16 | # 17 | # This would use the information in config/locales/es.yml. 18 | # 19 | # To learn more, please read the Rails Internationalization guide 20 | # available at http://guides.rubyonrails.org/i18n.html. 21 | 22 | en: 23 | hello: "Hello world" 24 | -------------------------------------------------------------------------------- /components/predictor_ui/spec/dummy/config/locales/en.yml: -------------------------------------------------------------------------------- 1 | # Files in the config/locales directory are used for internationalization 2 | # and are automatically loaded by Rails. If you want to use locales other 3 | # than English, add the necessary files in this directory. 4 | # 5 | # To use the locales, use `I18n.t`: 6 | # 7 | # I18n.t 'hello' 8 | # 9 | # In views, this is aliased to just `t`: 10 | # 11 | # <%= t('hello') %> 12 | # 13 | # To use a different locale, set it with `I18n.locale`: 14 | # 15 | # I18n.locale = :es 16 | # 17 | # This would use the information in config/locales/es.yml. 18 | # 19 | # To learn more, please read the Rails Internationalization guide 20 | # available at http://guides.rubyonrails.org/i18n.html. 21 | 22 | en: 23 | hello: "Hello world" 24 | -------------------------------------------------------------------------------- /components/welcome_ui/spec/dummy/config/locales/en.yml: -------------------------------------------------------------------------------- 1 | # Files in the config/locales directory are used for internationalization 2 | # and are automatically loaded by Rails. If you want to use locales other 3 | # than English, add the necessary files in this directory. 4 | # 5 | # To use the locales, use `I18n.t`: 6 | # 7 | # I18n.t 'hello' 8 | # 9 | # In views, this is aliased to just `t`: 10 | # 11 | # <%= t('hello') %> 12 | # 13 | # To use a different locale, set it with `I18n.locale`: 14 | # 15 | # I18n.locale = :es 16 | # 17 | # This would use the information in config/locales/es.yml. 18 | # 19 | # To learn more, please read the Rails Internationalization guide 20 | # available at http://guides.rubyonrails.org/i18n.html. 21 | 22 | en: 23 | hello: "Hello world" 24 | -------------------------------------------------------------------------------- /spec/features/app_spec.rb: -------------------------------------------------------------------------------- 1 | RSpec.describe "Engine 'App'", :type => :feature do 2 | it "hooks up to /" do 3 | visit "/" 4 | within "main h1" do 5 | expect(page).to have_content 'Sportsball' 6 | end 7 | end 8 | 9 | it "has teams" do 10 | visit "/" 11 | click_link "Teams" 12 | within "main h1" do 13 | expect(page).to have_content 'Teams' 14 | end 15 | end 16 | 17 | it "has games" do 18 | visit "/" 19 | click_link "Games" 20 | within "main h1" do 21 | expect(page).to have_content 'Games' 22 | end 23 | end 24 | 25 | it "can predict" do 26 | create_team name: "UofL" 27 | create_team name: "UK" 28 | 29 | visit "/" 30 | click_link "Predictions" 31 | click_button "What is it going to be" 32 | end 33 | end -------------------------------------------------------------------------------- /components/games_ui/web_ui.gemspec: -------------------------------------------------------------------------------- 1 | Gem::Specification.new do |s| 2 | s.name = "games_ui" 3 | s.version = "0.0.1" 4 | s.authors = ["The CBRA Book"] 5 | s.summary = "CBRA component" 6 | 7 | s.test_files = Dir["spec/**/*"] 8 | s.files = Dir["{app,config,db,lib}/**/*", "Rakefile", "README.rdoc"] 9 | 10 | s.add_dependency "rails", "4.1.9" 11 | s.add_dependency "slim-rails", "3.0.1" 12 | s.add_dependency "jquery-rails", "3.1.2" 13 | 14 | s.add_dependency "games" 15 | s.add_dependency "web_style" 16 | 17 | s.add_development_dependency "sqlite3" 18 | s.add_development_dependency "rspec-rails" 19 | s.add_development_dependency "shoulda-matchers" 20 | s.add_development_dependency "database_cleaner" 21 | s.add_development_dependency "capybara" 22 | end 23 | -------------------------------------------------------------------------------- /components/teams_ui/teams_ui.gemspec: -------------------------------------------------------------------------------- 1 | Gem::Specification.new do |s| 2 | s.name = "teams_ui" 3 | s.version = "0.0.1" 4 | s.authors = ["The CBRA Book"] 5 | s.summary = "CBRA component" 6 | 7 | s.test_files = Dir["spec/**/*"] 8 | s.files = Dir["{app,config,db,lib}/**/*", "Rakefile", "README.rdoc"] 9 | 10 | s.add_dependency "rails", "4.1.9" 11 | s.add_dependency "slim-rails", "3.0.1" 12 | s.add_dependency "jquery-rails", "3.1.2" 13 | 14 | s.add_dependency "games" 15 | s.add_dependency "web_style" 16 | 17 | s.add_development_dependency "sqlite3" 18 | s.add_development_dependency "rspec-rails" 19 | s.add_development_dependency "shoulda-matchers" 20 | s.add_development_dependency "database_cleaner" 21 | s.add_development_dependency "capybara" 22 | end 23 | -------------------------------------------------------------------------------- /components/games/spec/dummy/app/assets/stylesheets/application.css: -------------------------------------------------------------------------------- 1 | /* 2 | * This is a manifest file that'll be compiled into application.css, which will include all the files 3 | * listed below. 4 | * 5 | * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, 6 | * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. 7 | * 8 | * You're free to add application-wide styles to this file and they'll appear at the bottom of the 9 | * compiled file so the styles you add here take precedence over styles defined in any styles 10 | * defined in the other CSS/SCSS files in this directory. It is generally better to create a new 11 | * file per style scope. 12 | * 13 | *= require_tree . 14 | *= require_self 15 | */ 16 | -------------------------------------------------------------------------------- /components/games_ui/spec/dummy/app/assets/stylesheets/application.css: -------------------------------------------------------------------------------- 1 | /* 2 | * This is a manifest file that'll be compiled into application.css, which will include all the files 3 | * listed below. 4 | * 5 | * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, 6 | * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. 7 | * 8 | * You're free to add application-wide styles to this file and they'll appear at the bottom of the 9 | * compiled file so the styles you add here take precedence over styles defined in any styles 10 | * defined in the other CSS/SCSS files in this directory. It is generally better to create a new 11 | * file per style scope. 12 | * 13 | *= require_tree . 14 | *= require_self 15 | */ 16 | -------------------------------------------------------------------------------- /components/teams/spec/dummy/app/assets/stylesheets/application.css: -------------------------------------------------------------------------------- 1 | /* 2 | * This is a manifest file that'll be compiled into application.css, which will include all the files 3 | * listed below. 4 | * 5 | * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, 6 | * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. 7 | * 8 | * You're free to add application-wide styles to this file and they'll appear at the bottom of the 9 | * compiled file so the styles you add here take precedence over styles defined in any styles 10 | * defined in the other CSS/SCSS files in this directory. It is generally better to create a new 11 | * file per style scope. 12 | * 13 | *= require_tree . 14 | *= require_self 15 | */ 16 | -------------------------------------------------------------------------------- /components/teams_ui/spec/dummy/app/assets/stylesheets/application.css: -------------------------------------------------------------------------------- 1 | /* 2 | * This is a manifest file that'll be compiled into application.css, which will include all the files 3 | * listed below. 4 | * 5 | * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, 6 | * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. 7 | * 8 | * You're free to add application-wide styles to this file and they'll appear at the bottom of the 9 | * compiled file so the styles you add here take precedence over styles defined in any styles 10 | * defined in the other CSS/SCSS files in this directory. It is generally better to create a new 11 | * file per style scope. 12 | * 13 | *= require_tree . 14 | *= require_self 15 | */ 16 | -------------------------------------------------------------------------------- /components/predictor_ui/spec/dummy/app/assets/stylesheets/application.css: -------------------------------------------------------------------------------- 1 | /* 2 | * This is a manifest file that'll be compiled into application.css, which will include all the files 3 | * listed below. 4 | * 5 | * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, 6 | * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. 7 | * 8 | * You're free to add application-wide styles to this file and they'll appear at the bottom of the 9 | * compiled file so the styles you add here take precedence over styles defined in any styles 10 | * defined in the other CSS/SCSS files in this directory. It is generally better to create a new 11 | * file per style scope. 12 | * 13 | *= require_tree . 14 | *= require_self 15 | */ 16 | -------------------------------------------------------------------------------- /components/welcome_ui/spec/dummy/app/assets/stylesheets/application.css: -------------------------------------------------------------------------------- 1 | /* 2 | * This is a manifest file that'll be compiled into application.css, which will include all the files 3 | * listed below. 4 | * 5 | * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, 6 | * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. 7 | * 8 | * You're free to add application-wide styles to this file and they'll appear at the bottom of the 9 | * compiled file so the styles you add here take precedence over styles defined in any styles 10 | * defined in the other CSS/SCSS files in this directory. It is generally better to create a new 11 | * file per style scope. 12 | * 13 | *= require_tree . 14 | *= require_self 15 | */ 16 | -------------------------------------------------------------------------------- /spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | ENV["RAILS_ENV"] ||= 'test' 2 | 3 | require_relative "../config/environment" 4 | 5 | require 'rspec/rails' 6 | require 'capybara/rails' 7 | require 'capybara/rspec' 8 | 9 | require 'teams/test_helpers' 10 | 11 | Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f} 12 | 13 | RSpec.configure do |config| 14 | config.expect_with :rspec do |expectations| 15 | expectations.include_chain_clauses_in_custom_matcher_descriptions = true 16 | end 17 | config.mock_with :rspec do |mocks| 18 | mocks.verify_partial_doubles = true 19 | end 20 | 21 | config.disable_monkey_patching! 22 | config.warnings = false 23 | config.profile_examples = nil 24 | config.order = :random 25 | Kernel.srand config.seed 26 | 27 | config.include Teams::ObjectCreationMethods 28 | end 29 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | ruby '2.2.2' 3 | 4 | path "components" do 5 | gem "welcome_ui" 6 | gem "teams_ui" 7 | gem "games_ui" 8 | gem "predictor_ui" 9 | end 10 | 11 | #Ensuring correct version of transitive dependency 12 | gem "trueskill", git: "https://github.com/benjaminleesmith/trueskill", ref: "e404f45af5b3fb86982881ce064a9c764cc6a901" 13 | 14 | gem 'rails', '4.1.9' 15 | gem 'sass-rails', '~> 4.0.3' 16 | gem 'uglifier', '>= 1.3.0' 17 | gem 'coffee-rails', '~> 4.0.0' 18 | gem 'jquery-rails' 19 | gem 'turbolinks' 20 | gem 'jbuilder', '~> 2.0' 21 | gem 'sdoc', '~> 0.4.0', group: :doc 22 | 23 | group :development, :test do 24 | gem 'sqlite3' 25 | gem 'spring' 26 | gem 'rspec-rails' 27 | gem 'capybara' 28 | end 29 | 30 | group :production do 31 | gem 'pg' 32 | gem 'rails_12factor' 33 | end 34 | -------------------------------------------------------------------------------- /components/teams/spec/support/object_creation_methods.rb: -------------------------------------------------------------------------------- 1 | module Teams 2 | module ObjectCreationMethods 3 | def new_team(overrides = {}) 4 | defaults = { 5 | name: "Some name #{counter}" 6 | } 7 | Teams::Team.new { |team| apply(team, defaults, overrides) } 8 | end 9 | 10 | def create_team(overrides = {}) 11 | new_team(overrides).tap(&:save!) 12 | end 13 | 14 | private 15 | 16 | def counter 17 | @counter ||= 0 18 | @counter += 1 19 | end 20 | 21 | def apply(object, defaults, overrides) 22 | options = defaults.merge(overrides) 23 | options.each do |method, value_or_proc| 24 | object.send( 25 | "#{method}=", 26 | value_or_proc.is_a?(Proc) ? value_or_proc.call : value_or_proc) 27 | end 28 | end 29 | end 30 | end -------------------------------------------------------------------------------- /components/predictor_ui/predictor_ui.gemspec: -------------------------------------------------------------------------------- 1 | Gem::Specification.new do |s| 2 | s.name = "predictor_ui" 3 | s.version = "0.0.1" 4 | s.authors = ["The CBRA Book"] 5 | s.summary = "CBRA component" 6 | 7 | s.test_files = Dir["spec/**/*"] 8 | s.files = Dir["{app,config,db,lib}/**/*", "Rakefile", "README.rdoc"] 9 | 10 | s.add_dependency "rails", "4.1.9" 11 | s.add_dependency "slim-rails", "3.0.1" 12 | s.add_dependency "jquery-rails", "3.1.2" 13 | 14 | s.add_dependency "predictor" 15 | s.add_dependency "teams" 16 | s.add_dependency "games" 17 | s.add_dependency "web_style" 18 | 19 | s.add_development_dependency "sqlite3" 20 | s.add_development_dependency "rspec-rails" 21 | s.add_development_dependency "shoulda-matchers" 22 | s.add_development_dependency "database_cleaner" 23 | s.add_development_dependency "capybara" 24 | end 25 | -------------------------------------------------------------------------------- /components/welcome_ui/spec/dummy/db/schema.rb: -------------------------------------------------------------------------------- 1 | # encoding: UTF-8 2 | # This file is auto-generated from the current state of the database. Instead 3 | # of editing this file, please use the migrations feature of Active Record to 4 | # incrementally modify your database, and then regenerate this schema definition. 5 | # 6 | # Note that this schema.rb definition is the authoritative source for your 7 | # database schema. If you need to create the application database on another 8 | # system, you should be using db:schema:load, not running all the migrations 9 | # from scratch. The latter is a flawed and unsustainable approach (the more migrations 10 | # you'll amass, the slower it'll run and the greater likelihood for issues). 11 | # 12 | # It's strongly recommended that you check this file into your version control system. 13 | 14 | ActiveRecord::Schema.define(version: 0) do 15 | 16 | end 17 | -------------------------------------------------------------------------------- /components/games_ui/spec/views/games_ui/games/edit.html.slim_spec.rb: -------------------------------------------------------------------------------- 1 | RSpec.describe "games_ui/games/edit", :type => :view do 2 | before(:each) do 3 | @game = assign(:game, create_game) 4 | end 5 | 6 | it "renders the edit game form" do 7 | render 8 | 9 | assert_select "form[action=?][method=?]", games_ui.game_path(@game), "post" do 10 | 11 | assert_select "input#game_location[name=?]", "game[location]" 12 | 13 | assert_select "input#game_first_team_id[name=?]", "game[first_team_id]" 14 | 15 | assert_select "input#game_second_team_id[name=?]", "game[second_team_id]" 16 | 17 | assert_select "input#game_winning_team[name=?]", "game[winning_team]" 18 | 19 | assert_select "input#game_first_team_score[name=?]", "game[first_team_score]" 20 | 21 | assert_select "input#game_second_team_score[name=?]", "game[second_team_score]" 22 | end 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /components/predictor/Gemfile.lock: -------------------------------------------------------------------------------- 1 | GIT 2 | remote: https://github.com/benjaminleesmith/trueskill 3 | revision: e404f45af5b3fb86982881ce064a9c764cc6a901 4 | ref: e404f45af5b3fb86982881ce064a9c764cc6a901 5 | specs: 6 | trueskill (1.0.0) 7 | 8 | PATH 9 | remote: . 10 | specs: 11 | predictor (0.0.1) 12 | trueskill 13 | 14 | GEM 15 | remote: https://rubygems.org/ 16 | specs: 17 | diff-lcs (1.2.5) 18 | rspec (3.1.0) 19 | rspec-core (~> 3.1.0) 20 | rspec-expectations (~> 3.1.0) 21 | rspec-mocks (~> 3.1.0) 22 | rspec-core (3.1.7) 23 | rspec-support (~> 3.1.0) 24 | rspec-expectations (3.1.2) 25 | diff-lcs (>= 1.2.0, < 2.0) 26 | rspec-support (~> 3.1.0) 27 | rspec-mocks (3.1.3) 28 | rspec-support (~> 3.1.0) 29 | rspec-support (3.1.2) 30 | 31 | PLATFORMS 32 | ruby 33 | 34 | DEPENDENCIES 35 | predictor! 36 | rspec 37 | trueskill! 38 | -------------------------------------------------------------------------------- /components/predictor/predictor.gemspec: -------------------------------------------------------------------------------- 1 | Gem::Specification.new do |spec| 2 | spec.name = "predictor" 3 | spec.version = "0.0.1" 4 | spec.authors = ["Stephan Hagemann"] 5 | spec.email = ["stephan.hagemann@gmail.com"] 6 | 7 | if spec.respond_to?(:metadata) 8 | spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com' to prevent pushes to rubygems.org, or delete to allow pushes to any server." 9 | end 10 | 11 | spec.summary = %q{Predictor} 12 | spec.description = %q{Predictor Description} 13 | 14 | spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } 15 | spec.bindir = "exe" 16 | spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } 17 | spec.require_paths = ["lib"] 18 | 19 | spec.add_dependency "trueskill" 20 | 21 | spec.add_development_dependency "rspec" 22 | end 23 | -------------------------------------------------------------------------------- /components/predictor_ui/spec/controllers/app/predictions_controller_spec.rb: -------------------------------------------------------------------------------- 1 | RSpec.describe PredictorUi::PredictionsController, :type => :controller do 2 | routes { PredictorUi::Engine.routes } 3 | 4 | before do 5 | @team1 = create_team 6 | @team2 = create_team 7 | end 8 | 9 | describe "GET new" do 10 | it "assigns all teams as @teams" do 11 | get :new, {}, {} 12 | expect(assigns(:teams)).to eq([@team1, @team2]) 13 | end 14 | end 15 | 16 | describe "POST create" do 17 | it "assigns a prediction as @prediction" do 18 | post :create, 19 | {first_team: {id: @team1.id}, second_team: {id: @team2.id}}, 20 | {} 21 | 22 | prediction = assigns(:prediction) 23 | expect(prediction).to be_a(Predictor::Prediction) 24 | expect(prediction.first_team).to eq(@team1) 25 | expect(prediction.second_team).to eq(@team2) 26 | end 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /components/games_ui/app/views/games_ui/games/index.html.slim: -------------------------------------------------------------------------------- 1 | h1 Games 2 | 3 | table 4 | thead 5 | tr 6 | th Date 7 | th Location 8 | th First team 9 | th Second team 10 | th 11 | th 12 | th 13 | 14 | tbody 15 | - @games.each do |game| 16 | tr 17 | td = game.date 18 | td = game.location 19 | - if game.winning_team == 1 20 | td 21 | strong = game.first_team.name 22 | td = game.second_team.name 23 | - else 24 | td = game.first_team.name 25 | td 26 | strong = game.second_team.name 27 | td = link_to 'Show', game, class: "button tiny" 28 | td = link_to 'Edit', edit_game_path(game), class: "button tiny" 29 | td = link_to 'Destroy', game, data: {:confirm => 'Are you sure?'}, :method => :delete, class: "button tiny alert" 30 | 31 | br 32 | 33 | = link_to 'New Game', new_game_path, class: "button" 34 | -------------------------------------------------------------------------------- /components/games_ui/app/views/games_ui/games/_form.html.slim: -------------------------------------------------------------------------------- 1 | = form_for @game do |f| 2 | - if @game.errors.any? 3 | #error_explanation 4 | h2 = "#{pluralize(@game.errors.count, "error")} prohibited this game from being saved:" 5 | ul 6 | - @game.errors.full_messages.each do |message| 7 | li = message 8 | 9 | .field 10 | = f.label :date 11 | = f.datetime_select :date 12 | .field 13 | = f.label :location 14 | = f.text_field :location 15 | .field 16 | = f.label :first_team_id 17 | = f.number_field :first_team_id 18 | .field 19 | = f.label :second_team_id 20 | = f.number_field :second_team_id 21 | .field 22 | = f.label :winning_team 23 | = f.number_field :winning_team 24 | .field 25 | = f.label :first_team_score 26 | = f.number_field :first_team_score 27 | .field 28 | = f.label :second_team_score 29 | = f.number_field :second_team_score 30 | .actions = f.submit class: "button" 31 | -------------------------------------------------------------------------------- /components/games/spec/support/object_creation_methods.rb: -------------------------------------------------------------------------------- 1 | module Games::ObjectCreationMethods 2 | def new_game(overrides = {}) 3 | defaults = { 4 | first_team: -> { new_team }, 5 | second_team: -> { new_team }, 6 | winning_team: 2, 7 | first_team_score: 2, 8 | second_team_score: 3, 9 | location: "Somewhere", 10 | date: Date.today 11 | } 12 | 13 | Games::Game.new { |game| apply(game, defaults, overrides) } 14 | end 15 | 16 | def create_game(overrides = {}) 17 | new_game(overrides).tap(&:save!) 18 | end 19 | 20 | private 21 | 22 | def counter 23 | @counter ||= 0 24 | @counter += 1 25 | end 26 | 27 | def apply(object, defaults, overrides) 28 | options = defaults.merge(overrides) 29 | options.each do |method, value_or_proc| 30 | object.send( 31 | "#{method}=", 32 | value_or_proc.is_a?(Proc) ? value_or_proc.call : value_or_proc) 33 | end 34 | end 35 | end -------------------------------------------------------------------------------- /components/games/spec/dummy/config/application.rb: -------------------------------------------------------------------------------- 1 | require File.expand_path('../boot', __FILE__) 2 | 3 | require 'rails/all' 4 | 5 | Bundler.require(*Rails.groups) 6 | require "games" 7 | 8 | module Dummy 9 | class Application < Rails::Application 10 | # Settings in config/environments/* take precedence over those specified here. 11 | # Application configuration should go into files in config/initializers 12 | # -- all .rb files in that directory are automatically loaded. 13 | 14 | # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. 15 | # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. 16 | # config.time_zone = 'Central Time (US & Canada)' 17 | 18 | # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. 19 | # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] 20 | # config.i18n.default_locale = :de 21 | end 22 | end 23 | 24 | -------------------------------------------------------------------------------- /components/teams/spec/dummy/config/application.rb: -------------------------------------------------------------------------------- 1 | require File.expand_path('../boot', __FILE__) 2 | 3 | require 'rails/all' 4 | 5 | Bundler.require(*Rails.groups) 6 | require "teams" 7 | 8 | module Dummy 9 | class Application < Rails::Application 10 | # Settings in config/environments/* take precedence over those specified here. 11 | # Application configuration should go into files in config/initializers 12 | # -- all .rb files in that directory are automatically loaded. 13 | 14 | # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. 15 | # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. 16 | # config.time_zone = 'Central Time (US & Canada)' 17 | 18 | # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. 19 | # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] 20 | # config.i18n.default_locale = :de 21 | end 22 | end 23 | 24 | -------------------------------------------------------------------------------- /components/games_ui/spec/dummy/config/application.rb: -------------------------------------------------------------------------------- 1 | require File.expand_path('../boot', __FILE__) 2 | 3 | require 'rails/all' 4 | 5 | Bundler.require(*Rails.groups) 6 | require "games_ui" 7 | 8 | module Dummy 9 | class Application < Rails::Application 10 | # Settings in config/environments/* take precedence over those specified here. 11 | # Application configuration should go into files in config/initializers 12 | # -- all .rb files in that directory are automatically loaded. 13 | 14 | # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. 15 | # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. 16 | # config.time_zone = 'Central Time (US & Canada)' 17 | 18 | # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. 19 | # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] 20 | # config.i18n.default_locale = :de 21 | end 22 | end 23 | 24 | -------------------------------------------------------------------------------- /components/teams_ui/spec/dummy/config/application.rb: -------------------------------------------------------------------------------- 1 | require File.expand_path('../boot', __FILE__) 2 | 3 | require 'rails/all' 4 | 5 | Bundler.require(*Rails.groups) 6 | require "teams_ui" 7 | 8 | module Dummy 9 | class Application < Rails::Application 10 | # Settings in config/environments/* take precedence over those specified here. 11 | # Application configuration should go into files in config/initializers 12 | # -- all .rb files in that directory are automatically loaded. 13 | 14 | # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. 15 | # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. 16 | # config.time_zone = 'Central Time (US & Canada)' 17 | 18 | # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. 19 | # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] 20 | # config.i18n.default_locale = :de 21 | end 22 | end 23 | 24 | -------------------------------------------------------------------------------- /components/predictor_ui/spec/dummy/config/application.rb: -------------------------------------------------------------------------------- 1 | require File.expand_path('../boot', __FILE__) 2 | 3 | require 'rails/all' 4 | 5 | Bundler.require(*Rails.groups) 6 | require "predictor_ui" 7 | 8 | module Dummy 9 | class Application < Rails::Application 10 | # Settings in config/environments/* take precedence over those specified here. 11 | # Application configuration should go into files in config/initializers 12 | # -- all .rb files in that directory are automatically loaded. 13 | 14 | # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. 15 | # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. 16 | # config.time_zone = 'Central Time (US & Canada)' 17 | 18 | # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. 19 | # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] 20 | # config.i18n.default_locale = :de 21 | end 22 | end 23 | 24 | -------------------------------------------------------------------------------- /components/welcome_ui/spec/dummy/config/application.rb: -------------------------------------------------------------------------------- 1 | require File.expand_path('../boot', __FILE__) 2 | 3 | require 'rails/all' 4 | 5 | Bundler.require(*Rails.groups) 6 | require "welcome_ui" 7 | 8 | module Dummy 9 | class Application < Rails::Application 10 | # Settings in config/environments/* take precedence over those specified here. 11 | # Application configuration should go into files in config/initializers 12 | # -- all .rb files in that directory are automatically loaded. 13 | 14 | # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. 15 | # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. 16 | # config.time_zone = 'Central Time (US & Canada)' 17 | 18 | # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. 19 | # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] 20 | # config.i18n.default_locale = :de 21 | end 22 | end 23 | 24 | -------------------------------------------------------------------------------- /components/teams_ui/spec/routing/teams_ui/teams_routing_spec.rb: -------------------------------------------------------------------------------- 1 | RSpec.describe TeamsUi::TeamsController, :type => :routing do 2 | routes { TeamsUi::Engine.routes } 3 | 4 | it "routes to #index" do 5 | expect(:get => "/teams").to route_to("teams_ui/teams#index") 6 | end 7 | 8 | it "routes to #new" do 9 | expect(:get => "/teams/new").to route_to("teams_ui/teams#new") 10 | end 11 | 12 | it "routes to #show" do 13 | expect(:get => "/teams/1").to route_to("teams_ui/teams#show", :id => "1") 14 | end 15 | 16 | it "routes to #edit" do 17 | expect(:get => "/teams/1/edit").to route_to("teams_ui/teams#edit", :id => "1") 18 | end 19 | 20 | it "routes to #create" do 21 | expect(:post => "/teams").to route_to("teams_ui/teams#create") 22 | end 23 | 24 | it "routes to #update" do 25 | expect(:put => "/teams/1").to route_to("teams_ui/teams#update", :id => "1") 26 | end 27 | 28 | it "routes to #destroy" do 29 | expect(:delete => "/teams/1").to route_to("teams_ui/teams#destroy", :id => "1") 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /components/teams/spec/dummy/db/schema.rb: -------------------------------------------------------------------------------- 1 | # encoding: UTF-8 2 | # This file is auto-generated from the current state of the database. Instead 3 | # of editing this file, please use the migrations feature of Active Record to 4 | # incrementally modify your database, and then regenerate this schema definition. 5 | # 6 | # Note that this schema.rb definition is the authoritative source for your 7 | # database schema. If you need to create the application database on another 8 | # system, you should be using db:schema:load, not running all the migrations 9 | # from scratch. The latter is a flawed and unsustainable approach (the more migrations 10 | # you'll amass, the slower it'll run and the greater likelihood for issues). 11 | # 12 | # It's strongly recommended that you check this file into your version control system. 13 | 14 | ActiveRecord::Schema.define(version: 20150409014709) do 15 | 16 | create_table "teams_teams", force: true do |t| 17 | t.string "name" 18 | t.datetime "created_at" 19 | t.datetime "updated_at" 20 | end 21 | 22 | end 23 | -------------------------------------------------------------------------------- /config/secrets.yml: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Your secret key is used for verifying the integrity of signed cookies. 4 | # If you change this key, all old signed cookies will become invalid! 5 | 6 | # Make sure the secret is at least 30 characters and all random, 7 | # no regular words or you'll be exposed to dictionary attacks. 8 | # You can use `rake secret` to generate a secure secret key. 9 | 10 | # Make sure the secrets in this file are kept private 11 | # if you're sharing your code publicly. 12 | 13 | development: 14 | secret_key_base: 0ac90238095859b9c305f25166b675f0be320a51d82a4d1ae7114aad656b193b85abacadbc424ccb35e1da6208d13d613f9ae0d67842390c8696402da0cb870b 15 | 16 | test: 17 | secret_key_base: bff65dba5d46cc53dee83df2266d3c152c5ba531f2fa746905099c2bed9afb97fa9be2df4c667eef36a3228a36cc6067ad61454063bf6be9135d4ac60b7a1daa 18 | 19 | # Do not keep production secrets in the repository, 20 | # instead read values from the environment. 21 | production: 22 | secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> 23 | -------------------------------------------------------------------------------- /config/application.rb: -------------------------------------------------------------------------------- 1 | require File.expand_path('../boot', __FILE__) 2 | 3 | require 'rails/all' 4 | 5 | # Require the gems listed in Gemfile, including any gems 6 | # you've limited to :test, :development, or :production. 7 | Bundler.require(*Rails.groups) 8 | 9 | module Sportsball 10 | class Application < Rails::Application 11 | # Settings in config/environments/* take precedence over those specified here. 12 | # Application configuration should go into files in config/initializers 13 | # -- all .rb files in that directory are automatically loaded. 14 | 15 | # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. 16 | # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. 17 | # config.time_zone = 'Central Time (US & Canada)' 18 | 19 | # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. 20 | # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] 21 | # config.i18n.default_locale = :de 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /components/games/spec/dummy/config/secrets.yml: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Your secret key is used for verifying the integrity of signed cookies. 4 | # If you change this key, all old signed cookies will become invalid! 5 | 6 | # Make sure the secret is at least 30 characters and all random, 7 | # no regular words or you'll be exposed to dictionary attacks. 8 | # You can use `rake secret` to generate a secure secret key. 9 | 10 | # Make sure the secrets in this file are kept private 11 | # if you're sharing your code publicly. 12 | 13 | development: 14 | secret_key_base: 7c6de58d99d6ec08e718362f2d4155ecb7d3494dae9614865d28e0e363c9f9309a3b5c3b01b610b236d6fd97be06583b1a7dbea2bb5d66aaf057d65ace6787ef 15 | 16 | test: 17 | secret_key_base: 36731ecce1863e6f9466e2cf0b34f5cba51de15ca766120ba0f84004cfc09626eb552303576177a0541edf8833e9ccef9e01f40bdde91aebcd8e7a8184d78ac5 18 | 19 | # Do not keep production secrets in the repository, 20 | # instead read values from the environment. 21 | production: 22 | secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> 23 | -------------------------------------------------------------------------------- /components/teams/spec/dummy/config/secrets.yml: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Your secret key is used for verifying the integrity of signed cookies. 4 | # If you change this key, all old signed cookies will become invalid! 5 | 6 | # Make sure the secret is at least 30 characters and all random, 7 | # no regular words or you'll be exposed to dictionary attacks. 8 | # You can use `rake secret` to generate a secure secret key. 9 | 10 | # Make sure the secrets in this file are kept private 11 | # if you're sharing your code publicly. 12 | 13 | development: 14 | secret_key_base: 7c6de58d99d6ec08e718362f2d4155ecb7d3494dae9614865d28e0e363c9f9309a3b5c3b01b610b236d6fd97be06583b1a7dbea2bb5d66aaf057d65ace6787ef 15 | 16 | test: 17 | secret_key_base: 36731ecce1863e6f9466e2cf0b34f5cba51de15ca766120ba0f84004cfc09626eb552303576177a0541edf8833e9ccef9e01f40bdde91aebcd8e7a8184d78ac5 18 | 19 | # Do not keep production secrets in the repository, 20 | # instead read values from the environment. 21 | production: 22 | secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> 23 | -------------------------------------------------------------------------------- /components/games_ui/spec/dummy/config/secrets.yml: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Your secret key is used for verifying the integrity of signed cookies. 4 | # If you change this key, all old signed cookies will become invalid! 5 | 6 | # Make sure the secret is at least 30 characters and all random, 7 | # no regular words or you'll be exposed to dictionary attacks. 8 | # You can use `rake secret` to generate a secure secret key. 9 | 10 | # Make sure the secrets in this file are kept private 11 | # if you're sharing your code publicly. 12 | 13 | development: 14 | secret_key_base: 7c6de58d99d6ec08e718362f2d4155ecb7d3494dae9614865d28e0e363c9f9309a3b5c3b01b610b236d6fd97be06583b1a7dbea2bb5d66aaf057d65ace6787ef 15 | 16 | test: 17 | secret_key_base: 36731ecce1863e6f9466e2cf0b34f5cba51de15ca766120ba0f84004cfc09626eb552303576177a0541edf8833e9ccef9e01f40bdde91aebcd8e7a8184d78ac5 18 | 19 | # Do not keep production secrets in the repository, 20 | # instead read values from the environment. 21 | production: 22 | secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> 23 | -------------------------------------------------------------------------------- /components/games_ui/spec/routing/games_ui/games_routing_spec.rb: -------------------------------------------------------------------------------- 1 | RSpec.describe GamesUi::GamesController, :type => :routing do 2 | routes { GamesUi::Engine.routes } 3 | 4 | it "routes to #index" do 5 | expect(:get => "/games").to route_to("games_ui/games#index") 6 | end 7 | 8 | it "routes to #new" do 9 | expect(:get => "/games/new").to route_to("games_ui/games#new") 10 | end 11 | 12 | it "routes to #show" do 13 | expect(:get => "/games/1").to route_to("games_ui/games#show", :id => "1") 14 | end 15 | 16 | it "routes to #edit" do 17 | expect(:get => "/games/1/edit").to route_to("games_ui/games#edit", :id => "1") 18 | end 19 | 20 | it "routes to #create" do 21 | expect(:post => "/games").to route_to("games_ui/games#create") 22 | end 23 | 24 | it "routes to #update" do 25 | expect(:put => "/games/1").to route_to("games_ui/games#update", :id => "1") 26 | end 27 | 28 | it "routes to #destroy" do 29 | expect(:delete => "/games/1").to route_to("games_ui/games#destroy", :id => "1") 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /components/predictor_ui/spec/dummy/config/secrets.yml: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Your secret key is used for verifying the integrity of signed cookies. 4 | # If you change this key, all old signed cookies will become invalid! 5 | 6 | # Make sure the secret is at least 30 characters and all random, 7 | # no regular words or you'll be exposed to dictionary attacks. 8 | # You can use `rake secret` to generate a secure secret key. 9 | 10 | # Make sure the secrets in this file are kept private 11 | # if you're sharing your code publicly. 12 | 13 | development: 14 | secret_key_base: 7c6de58d99d6ec08e718362f2d4155ecb7d3494dae9614865d28e0e363c9f9309a3b5c3b01b610b236d6fd97be06583b1a7dbea2bb5d66aaf057d65ace6787ef 15 | 16 | test: 17 | secret_key_base: 36731ecce1863e6f9466e2cf0b34f5cba51de15ca766120ba0f84004cfc09626eb552303576177a0541edf8833e9ccef9e01f40bdde91aebcd8e7a8184d78ac5 18 | 19 | # Do not keep production secrets in the repository, 20 | # instead read values from the environment. 21 | production: 22 | secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> 23 | -------------------------------------------------------------------------------- /components/teams_ui/spec/dummy/config/secrets.yml: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Your secret key is used for verifying the integrity of signed cookies. 4 | # If you change this key, all old signed cookies will become invalid! 5 | 6 | # Make sure the secret is at least 30 characters and all random, 7 | # no regular words or you'll be exposed to dictionary attacks. 8 | # You can use `rake secret` to generate a secure secret key. 9 | 10 | # Make sure the secrets in this file are kept private 11 | # if you're sharing your code publicly. 12 | 13 | development: 14 | secret_key_base: 7c6de58d99d6ec08e718362f2d4155ecb7d3494dae9614865d28e0e363c9f9309a3b5c3b01b610b236d6fd97be06583b1a7dbea2bb5d66aaf057d65ace6787ef 15 | 16 | test: 17 | secret_key_base: 36731ecce1863e6f9466e2cf0b34f5cba51de15ca766120ba0f84004cfc09626eb552303576177a0541edf8833e9ccef9e01f40bdde91aebcd8e7a8184d78ac5 18 | 19 | # Do not keep production secrets in the repository, 20 | # instead read values from the environment. 21 | production: 22 | secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> 23 | -------------------------------------------------------------------------------- /components/welcome_ui/spec/dummy/config/secrets.yml: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Your secret key is used for verifying the integrity of signed cookies. 4 | # If you change this key, all old signed cookies will become invalid! 5 | 6 | # Make sure the secret is at least 30 characters and all random, 7 | # no regular words or you'll be exposed to dictionary attacks. 8 | # You can use `rake secret` to generate a secure secret key. 9 | 10 | # Make sure the secrets in this file are kept private 11 | # if you're sharing your code publicly. 12 | 13 | development: 14 | secret_key_base: 7c6de58d99d6ec08e718362f2d4155ecb7d3494dae9614865d28e0e363c9f9309a3b5c3b01b610b236d6fd97be06583b1a7dbea2bb5d66aaf057d65ace6787ef 15 | 16 | test: 17 | secret_key_base: 36731ecce1863e6f9466e2cf0b34f5cba51de15ca766120ba0f84004cfc09626eb552303576177a0541edf8833e9ccef9e01f40bdde91aebcd8e7a8184d78ac5 18 | 19 | # Do not keep production secrets in the repository, 20 | # instead read values from the environment. 21 | production: 22 | secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> 23 | -------------------------------------------------------------------------------- /components/teams/spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | ENV["RAILS_ENV"] ||= 'test' 2 | 3 | require File.expand_path("../dummy/config/environment", __FILE__) 4 | 5 | require 'rspec/rails' 6 | require 'shoulda/matchers' 7 | require 'database_cleaner' 8 | 9 | Dir[Teams::Engine.root.join("spec/support/**/*.rb")].each {|f| require f} 10 | 11 | RSpec.configure do |config| 12 | config.expect_with :rspec do |expectations| 13 | expectations.include_chain_clauses_in_custom_matcher_descriptions = true 14 | end 15 | config.mock_with :rspec do |mocks| 16 | mocks.verify_partial_doubles = true 17 | end 18 | 19 | config.disable_monkey_patching! 20 | config.warnings = false 21 | config.profile_examples = nil 22 | config.order = :random 23 | Kernel.srand config.seed 24 | 25 | config.before(:suite) do 26 | DatabaseCleaner.strategy = :transaction 27 | DatabaseCleaner.clean_with(:truncation) 28 | end 29 | 30 | config.around(:each) do |example| 31 | DatabaseCleaner.cleaning do 32 | example.run 33 | end 34 | end 35 | 36 | config.include Teams::ObjectCreationMethods 37 | end 38 | -------------------------------------------------------------------------------- /components/games_ui/spec/views/games_ui/games/new.html.slim_spec.rb: -------------------------------------------------------------------------------- 1 | RSpec.describe "games_ui/games/new", :type => :view do 2 | before(:each) do 3 | assign(:game, Games::Game.new( 4 | :location => "MyString", 5 | :first_team_id => 1, 6 | :second_team_id => 1, 7 | :winning_team => 1, 8 | :first_team_score => 1, 9 | :second_team_score => 1 10 | )) 11 | end 12 | 13 | it "renders new game form" do 14 | render 15 | 16 | assert_select "form[action=?][method=?]", games_ui.games_path, "post" do 17 | 18 | assert_select "input#game_location[name=?]", "game[location]" 19 | 20 | assert_select "input#game_first_team_id[name=?]", "game[first_team_id]" 21 | 22 | assert_select "input#game_second_team_id[name=?]", "game[second_team_id]" 23 | 24 | assert_select "input#game_winning_team[name=?]", "game[winning_team]" 25 | 26 | assert_select "input#game_first_team_score[name=?]", "game[first_team_score]" 27 | 28 | assert_select "input#game_second_team_score[name=?]", "game[second_team_score]" 29 | end 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /components/web_style/app/views/layouts/web_style/application.html.slim: -------------------------------------------------------------------------------- 1 | | 2 | html 3 | head 4 | meta charset="utf-8" 5 | meta name="viewport" content="width=device-width, initial-scale=1.0" 6 | 7 | title Sportsball App 8 | 9 | = javascript_include_tag "web_style/application" 10 | = stylesheet_link_tag "web_style/application", media: "all" 11 | 12 | = csrf_meta_tags 13 | 14 | header 15 | .contain-to-grid.sticky 16 | nav.top-bar data-topbar="" role="navigation" 17 | ul.title-area 18 | li.name 19 | h1 20 | = link_to main_app.root_path do 21 | = image_tag "web_style/logo.png", width: "25px" 22 | | Predictor 23 | 24 | li.toggle-topbar.menu-icon 25 | a href="#" 26 | span Menu 27 | 28 | section.top-bar-section 29 | ul.left 30 | - Rails.application.config.main_nav.each do |item| 31 | li =link_to item[:name], item[:link].call 32 | 33 | main 34 | .row 35 | .small-12.columns 36 | = yield 37 | -------------------------------------------------------------------------------- /components/games/spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | ENV["RAILS_ENV"] ||= 'test' 2 | 3 | require File.expand_path("../dummy/config/environment", __FILE__) 4 | 5 | require 'rspec/rails' 6 | require 'shoulda/matchers' 7 | require 'database_cleaner' 8 | 9 | require 'teams/test_helpers' 10 | 11 | Dir[Games::Engine.root.join("spec/support/**/*.rb")].each {|f| require f} 12 | 13 | RSpec.configure do |config| 14 | config.expect_with :rspec do |expectations| 15 | expectations.include_chain_clauses_in_custom_matcher_descriptions = true 16 | end 17 | config.mock_with :rspec do |mocks| 18 | mocks.verify_partial_doubles = true 19 | end 20 | 21 | config.disable_monkey_patching! 22 | config.warnings = false 23 | config.profile_examples = nil 24 | config.order = :random 25 | Kernel.srand config.seed 26 | 27 | config.before(:suite) do 28 | DatabaseCleaner.strategy = :transaction 29 | DatabaseCleaner.clean_with(:truncation) 30 | end 31 | 32 | config.around(:each) do |example| 33 | DatabaseCleaner.cleaning do 34 | example.run 35 | end 36 | end 37 | 38 | config.include Games::ObjectCreationMethods 39 | config.include Teams::ObjectCreationMethods 40 | end 41 | -------------------------------------------------------------------------------- /components/teams_ui/app/controllers/teams_ui/teams_controller.rb: -------------------------------------------------------------------------------- 1 | module TeamsUi 2 | class TeamsController < ApplicationController 3 | before_action :set_team, only: [:show, :edit, :update, :destroy] 4 | 5 | def index 6 | @teams = Teams::Team.all 7 | end 8 | 9 | def new 10 | @team = Teams::Team.new 11 | end 12 | 13 | def edit 14 | end 15 | 16 | def create 17 | @team = Teams::Team.new(team_params) 18 | 19 | if @team.save 20 | redirect_to teams_url, notice: 'Team was successfully created.' 21 | else 22 | render :new 23 | end 24 | end 25 | 26 | def update 27 | if @team.update(team_params) 28 | redirect_to teams_url, notice: 'Team was successfully updated.' 29 | else 30 | render :edit 31 | end 32 | end 33 | 34 | def destroy 35 | @team.destroy 36 | redirect_to teams_url, notice: 'Team was successfully destroyed.' 37 | end 38 | 39 | private 40 | def set_team 41 | @team = Teams::Team.find(params[:id]) 42 | end 43 | 44 | def team_params 45 | params.require(:team).permit(:name) 46 | end 47 | end 48 | end 49 | -------------------------------------------------------------------------------- /components/games_ui/spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | ENV["RAILS_ENV"] ||= 'test' 2 | 3 | require File.expand_path("../dummy/config/environment", __FILE__) 4 | 5 | require 'rspec/rails' 6 | require 'shoulda/matchers' 7 | require 'database_cleaner' 8 | require 'capybara/rails' 9 | require 'capybara/rspec' 10 | 11 | require 'teams/test_helpers' 12 | require 'games/test_helpers' 13 | 14 | Dir[GamesUi::Engine.root.join("spec/support/**/*.rb")].each {|f| require f} 15 | 16 | RSpec.configure do |config| 17 | config.expect_with :rspec do |expectations| 18 | expectations.include_chain_clauses_in_custom_matcher_descriptions = true 19 | end 20 | config.mock_with :rspec do |mocks| 21 | mocks.verify_partial_doubles = true 22 | end 23 | 24 | config.disable_monkey_patching! 25 | config.warnings = false 26 | config.profile_examples = nil 27 | config.order = :random 28 | Kernel.srand config.seed 29 | 30 | config.before(:suite) do 31 | DatabaseCleaner.strategy = :transaction 32 | DatabaseCleaner.clean_with(:truncation) 33 | end 34 | 35 | config.around(:each) do |example| 36 | DatabaseCleaner.cleaning do 37 | example.run 38 | end 39 | end 40 | 41 | config.include Games::ObjectCreationMethods 42 | config.include Teams::ObjectCreationMethods 43 | end 44 | -------------------------------------------------------------------------------- /components/teams_ui/spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | ENV["RAILS_ENV"] ||= 'test' 2 | 3 | require File.expand_path("../dummy/config/environment", __FILE__) 4 | 5 | require 'rspec/rails' 6 | require 'shoulda/matchers' 7 | require 'database_cleaner' 8 | require 'capybara/rails' 9 | require 'capybara/rspec' 10 | 11 | require 'teams/test_helpers' 12 | require 'games/test_helpers' 13 | 14 | Dir[TeamsUi::Engine.root.join("spec/support/**/*.rb")].each {|f| require f} 15 | 16 | RSpec.configure do |config| 17 | config.expect_with :rspec do |expectations| 18 | expectations.include_chain_clauses_in_custom_matcher_descriptions = true 19 | end 20 | config.mock_with :rspec do |mocks| 21 | mocks.verify_partial_doubles = true 22 | end 23 | 24 | config.disable_monkey_patching! 25 | config.warnings = false 26 | config.profile_examples = nil 27 | config.order = :random 28 | Kernel.srand config.seed 29 | 30 | config.before(:suite) do 31 | DatabaseCleaner.strategy = :transaction 32 | DatabaseCleaner.clean_with(:truncation) 33 | end 34 | 35 | config.around(:each) do |example| 36 | DatabaseCleaner.cleaning do 37 | example.run 38 | end 39 | end 40 | 41 | config.include Games::ObjectCreationMethods 42 | config.include Teams::ObjectCreationMethods 43 | end 44 | -------------------------------------------------------------------------------- /components/predictor_ui/spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | ENV["RAILS_ENV"] ||= 'test' 2 | 3 | require File.expand_path("../dummy/config/environment", __FILE__) 4 | 5 | require 'rspec/rails' 6 | require 'shoulda/matchers' 7 | require 'database_cleaner' 8 | require 'capybara/rails' 9 | require 'capybara/rspec' 10 | 11 | require 'teams/test_helpers' 12 | require 'games/test_helpers' 13 | 14 | Dir[PredictorUi::Engine.root.join("spec/support/**/*.rb")].each {|f| require f} 15 | 16 | RSpec.configure do |config| 17 | config.expect_with :rspec do |expectations| 18 | expectations.include_chain_clauses_in_custom_matcher_descriptions = true 19 | end 20 | config.mock_with :rspec do |mocks| 21 | mocks.verify_partial_doubles = true 22 | end 23 | 24 | config.disable_monkey_patching! 25 | config.warnings = false 26 | config.profile_examples = nil 27 | config.order = :random 28 | Kernel.srand config.seed 29 | 30 | config.before(:suite) do 31 | DatabaseCleaner.strategy = :transaction 32 | DatabaseCleaner.clean_with(:truncation) 33 | end 34 | 35 | config.around(:each) do |example| 36 | DatabaseCleaner.cleaning do 37 | example.run 38 | end 39 | end 40 | 41 | config.include Games::ObjectCreationMethods 42 | config.include Teams::ObjectCreationMethods 43 | end 44 | -------------------------------------------------------------------------------- /components/games_ui/app/controllers/games_ui/games_controller.rb: -------------------------------------------------------------------------------- 1 | module GamesUi 2 | class GamesController < ApplicationController 3 | before_action :set_game, only: [:show, :edit, :update, :destroy] 4 | 5 | def index 6 | @games = Games::Game.all 7 | end 8 | 9 | def show 10 | end 11 | 12 | def new 13 | @game = Games::Game.new 14 | end 15 | 16 | def edit 17 | end 18 | 19 | def create 20 | @game = Games::Game.new(game_params) 21 | 22 | if @game.save 23 | redirect_to @game, notice: 'Game was successfully created.' 24 | else 25 | render :new 26 | end 27 | end 28 | 29 | def update 30 | if @game.update(game_params) 31 | redirect_to @game, notice: 'Game was successfully updated.' 32 | else 33 | render :edit 34 | end 35 | end 36 | 37 | def destroy 38 | @game.destroy 39 | redirect_to games_url, notice: 'Game was successfully destroyed.' 40 | end 41 | 42 | private 43 | def set_game 44 | @game = Games::Game.find(params[:id]) 45 | end 46 | 47 | def game_params 48 | params.require(:game).permit(:date, :location, :first_team_id, :second_team_id, :winning_team, :first_team_score, :second_team_score) 49 | end 50 | end 51 | end 52 | -------------------------------------------------------------------------------- /components/predictor/lib/predictor/predictor.rb: -------------------------------------------------------------------------------- 1 | module Predictor 2 | class Predictor 3 | def initialize(teams) 4 | @teams_lookup = teams.inject({}) do |memo, team| 5 | memo[team.id] = { 6 | team: team, 7 | rating: [Saulabs::TrueSkill::Rating.new(1500.0, 1000.0, 1.0)] 8 | } 9 | memo 10 | end 11 | end 12 | 13 | def learn(games) 14 | games.each do |game| 15 | first_team_rating = @teams_lookup[game.first_team_id][:rating] 16 | second_team_rating = @teams_lookup[game.second_team_id][:rating] 17 | game_result = game.winning_team == 1 ? 18 | [first_team_rating, second_team_rating] : 19 | [second_team_rating, first_team_rating] 20 | Saulabs::TrueSkill::FactorGraph.new(game_result, [1, 2]).update_skills 21 | end 22 | end 23 | 24 | def predict(first_team, second_team) 25 | team1 = @teams_lookup[first_team.id][:team] 26 | team2 = @teams_lookup[second_team.id][:team] 27 | winner = higher_mean_team(first_team, second_team) ? team1 : team2 28 | ::Predictor::Prediction.new(team1, team2, winner) 29 | end 30 | 31 | def higher_mean_team(first_team, second_team) 32 | @teams_lookup[first_team.id][:rating].first.mean > 33 | @teams_lookup[second_team.id][:rating].first.mean 34 | end 35 | end 36 | end -------------------------------------------------------------------------------- /db/schema.rb: -------------------------------------------------------------------------------- 1 | # encoding: UTF-8 2 | # This file is auto-generated from the current state of the database. Instead 3 | # of editing this file, please use the migrations feature of Active Record to 4 | # incrementally modify your database, and then regenerate this schema definition. 5 | # 6 | # Note that this schema.rb definition is the authoritative source for your 7 | # database schema. If you need to create the application database on another 8 | # system, you should be using db:schema:load, not running all the migrations 9 | # from scratch. The latter is a flawed and unsustainable approach (the more migrations 10 | # you'll amass, the slower it'll run and the greater likelihood for issues). 11 | # 12 | # It's strongly recommended that you check this file into your version control system. 13 | 14 | ActiveRecord::Schema.define(version: 20150409032329) do 15 | 16 | create_table "games_games", force: true do |t| 17 | t.datetime "date" 18 | t.string "location" 19 | t.integer "first_team_id" 20 | t.integer "second_team_id" 21 | t.integer "winning_team" 22 | t.integer "first_team_score" 23 | t.integer "second_team_score" 24 | t.datetime "created_at" 25 | t.datetime "updated_at" 26 | end 27 | 28 | create_table "teams_teams", force: true do |t| 29 | t.string "name" 30 | t.datetime "created_at" 31 | t.datetime "updated_at" 32 | end 33 | 34 | end 35 | -------------------------------------------------------------------------------- /components/games/spec/dummy/db/schema.rb: -------------------------------------------------------------------------------- 1 | # encoding: UTF-8 2 | # This file is auto-generated from the current state of the database. Instead 3 | # of editing this file, please use the migrations feature of Active Record to 4 | # incrementally modify your database, and then regenerate this schema definition. 5 | # 6 | # Note that this schema.rb definition is the authoritative source for your 7 | # database schema. If you need to create the application database on another 8 | # system, you should be using db:schema:load, not running all the migrations 9 | # from scratch. The latter is a flawed and unsustainable approach (the more migrations 10 | # you'll amass, the slower it'll run and the greater likelihood for issues). 11 | # 12 | # It's strongly recommended that you check this file into your version control system. 13 | 14 | ActiveRecord::Schema.define(version: 20150409032329) do 15 | 16 | create_table "games_games", force: true do |t| 17 | t.datetime "date" 18 | t.string "location" 19 | t.integer "first_team_id" 20 | t.integer "second_team_id" 21 | t.integer "winning_team" 22 | t.integer "first_team_score" 23 | t.integer "second_team_score" 24 | t.datetime "created_at" 25 | t.datetime "updated_at" 26 | end 27 | 28 | create_table "teams_teams", force: true do |t| 29 | t.string "name" 30 | t.datetime "created_at" 31 | t.datetime "updated_at" 32 | end 33 | 34 | end 35 | -------------------------------------------------------------------------------- /components/games_ui/spec/dummy/db/schema.rb: -------------------------------------------------------------------------------- 1 | # encoding: UTF-8 2 | # This file is auto-generated from the current state of the database. Instead 3 | # of editing this file, please use the migrations feature of Active Record to 4 | # incrementally modify your database, and then regenerate this schema definition. 5 | # 6 | # Note that this schema.rb definition is the authoritative source for your 7 | # database schema. If you need to create the application database on another 8 | # system, you should be using db:schema:load, not running all the migrations 9 | # from scratch. The latter is a flawed and unsustainable approach (the more migrations 10 | # you'll amass, the slower it'll run and the greater likelihood for issues). 11 | # 12 | # It's strongly recommended that you check this file into your version control system. 13 | 14 | ActiveRecord::Schema.define(version: 20150409032329) do 15 | 16 | create_table "games_games", force: true do |t| 17 | t.datetime "date" 18 | t.string "location" 19 | t.integer "first_team_id" 20 | t.integer "second_team_id" 21 | t.integer "winning_team" 22 | t.integer "first_team_score" 23 | t.integer "second_team_score" 24 | t.datetime "created_at" 25 | t.datetime "updated_at" 26 | end 27 | 28 | create_table "teams_teams", force: true do |t| 29 | t.string "name" 30 | t.datetime "created_at" 31 | t.datetime "updated_at" 32 | end 33 | 34 | end 35 | -------------------------------------------------------------------------------- /components/teams_ui/spec/dummy/db/schema.rb: -------------------------------------------------------------------------------- 1 | # encoding: UTF-8 2 | # This file is auto-generated from the current state of the database. Instead 3 | # of editing this file, please use the migrations feature of Active Record to 4 | # incrementally modify your database, and then regenerate this schema definition. 5 | # 6 | # Note that this schema.rb definition is the authoritative source for your 7 | # database schema. If you need to create the application database on another 8 | # system, you should be using db:schema:load, not running all the migrations 9 | # from scratch. The latter is a flawed and unsustainable approach (the more migrations 10 | # you'll amass, the slower it'll run and the greater likelihood for issues). 11 | # 12 | # It's strongly recommended that you check this file into your version control system. 13 | 14 | ActiveRecord::Schema.define(version: 20150409032329) do 15 | 16 | create_table "games_games", force: true do |t| 17 | t.datetime "date" 18 | t.string "location" 19 | t.integer "first_team_id" 20 | t.integer "second_team_id" 21 | t.integer "winning_team" 22 | t.integer "first_team_score" 23 | t.integer "second_team_score" 24 | t.datetime "created_at" 25 | t.datetime "updated_at" 26 | end 27 | 28 | create_table "teams_teams", force: true do |t| 29 | t.string "name" 30 | t.datetime "created_at" 31 | t.datetime "updated_at" 32 | end 33 | 34 | end 35 | -------------------------------------------------------------------------------- /components/predictor_ui/spec/dummy/db/schema.rb: -------------------------------------------------------------------------------- 1 | # encoding: UTF-8 2 | # This file is auto-generated from the current state of the database. Instead 3 | # of editing this file, please use the migrations feature of Active Record to 4 | # incrementally modify your database, and then regenerate this schema definition. 5 | # 6 | # Note that this schema.rb definition is the authoritative source for your 7 | # database schema. If you need to create the application database on another 8 | # system, you should be using db:schema:load, not running all the migrations 9 | # from scratch. The latter is a flawed and unsustainable approach (the more migrations 10 | # you'll amass, the slower it'll run and the greater likelihood for issues). 11 | # 12 | # It's strongly recommended that you check this file into your version control system. 13 | 14 | ActiveRecord::Schema.define(version: 20150409032329) do 15 | 16 | create_table "games_games", force: true do |t| 17 | t.datetime "date" 18 | t.string "location" 19 | t.integer "first_team_id" 20 | t.integer "second_team_id" 21 | t.integer "winning_team" 22 | t.integer "first_team_score" 23 | t.integer "second_team_score" 24 | t.datetime "created_at" 25 | t.datetime "updated_at" 26 | end 27 | 28 | create_table "teams_teams", force: true do |t| 29 | t.string "name" 30 | t.datetime "created_at" 31 | t.datetime "updated_at" 32 | end 33 | 34 | end 35 | -------------------------------------------------------------------------------- /components/web_style/vendor/assets/javascripts/web_style/jquery.cookie.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery Cookie Plugin v1.4.1 3 | * https://github.com/carhartl/jquery-cookie 4 | * 5 | * Copyright 2013 Klaus Hartl 6 | * Released under the MIT license 7 | */ 8 | !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}(function(a){function b(a){return h.raw?a:encodeURIComponent(a)}function c(a){return h.raw?a:decodeURIComponent(a)}function d(a){return b(h.json?JSON.stringify(a):String(a))}function e(a){0===a.indexOf('"')&&(a=a.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return a=decodeURIComponent(a.replace(g," ")),h.json?JSON.parse(a):a}catch(b){}}function f(b,c){var d=h.raw?b:e(b);return a.isFunction(c)?c(d):d}var g=/\+/g,h=a.cookie=function(e,g,i){if(void 0!==g&&!a.isFunction(g)){if(i=a.extend({},h.defaults,i),"number"==typeof i.expires){var j=i.expires,k=i.expires=new Date;k.setTime(+k+864e5*j)}return document.cookie=[b(e),"=",d(g),i.expires?"; expires="+i.expires.toUTCString():"",i.path?"; path="+i.path:"",i.domain?"; domain="+i.domain:"",i.secure?"; secure":""].join("")}for(var l=e?void 0:{},m=document.cookie?document.cookie.split("; "):[],n=0,o=m.length;o>n;n++){var p=m[n].split("="),q=c(p.shift()),r=p.join("=");if(e&&e===q){l=f(r,g);break}e||void 0===(r=f(r))||(l[q]=r)}return l};h.defaults={},a.removeCookie=function(b,c){return void 0===a.cookie(b)?!1:(a.cookie(b,"",a.extend({},c,{expires:-1})),!a.cookie(b))}}); 9 | -------------------------------------------------------------------------------- /Gemfile.bac: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | 4 | # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 5 | gem 'rails', '4.1.9' 6 | # Use sqlite3 as the database for Active Record 7 | gem 'sqlite3' 8 | # Use SCSS for stylesheets 9 | gem 'sass-rails', '~> 4.0.3' 10 | # Use Uglifier as compressor for JavaScript assets 11 | gem 'uglifier', '>= 1.3.0' 12 | # Use CoffeeScript for .js.coffee assets and views 13 | gem 'coffee-rails', '~> 4.0.0' 14 | # See https://github.com/sstephenson/execjs#readme for more supported runtimes 15 | # gem 'therubyracer', platforms: :ruby 16 | 17 | # Use jquery as the JavaScript library 18 | gem 'jquery-rails' 19 | # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks 20 | gem 'turbolinks' 21 | # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder 22 | gem 'jbuilder', '~> 2.0' 23 | # bundle exec rake doc:rails generates the API under doc/api. 24 | gem 'sdoc', '~> 0.4.0', group: :doc 25 | 26 | # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring 27 | gem 'spring', group: :development 28 | 29 | # Use ActiveModel has_secure_password 30 | # gem 'bcrypt', '~> 3.1.7' 31 | 32 | # Use unicorn as the app server 33 | # gem 'unicorn' 34 | 35 | # Use Capistrano for deployment 36 | # gem 'capistrano-rails', group: :development 37 | 38 | # Use debugger 39 | # gem 'debugger', group: [:development, :test] 40 | 41 | -------------------------------------------------------------------------------- /components/predictor/README.md: -------------------------------------------------------------------------------- 1 | # Predictor 2 | 3 | Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/predictor`. To experiment with that code, run `bin/console` for an interactive prompt. 4 | 5 | TODO: Delete this and the text above, and describe your gem 6 | 7 | ## Installation 8 | 9 | Add this line to your application's Gemfile: 10 | 11 | ```ruby 12 | gem 'predictor' 13 | ``` 14 | 15 | And then execute: 16 | 17 | $ bundle 18 | 19 | Or install it yourself as: 20 | 21 | $ gem install predictor 22 | 23 | ## Usage 24 | 25 | TODO: Write usage instructions here 26 | 27 | ## Development 28 | 29 | After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment. 30 | 31 | To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org). 32 | 33 | ## Contributing 34 | 35 | 1. Fork it ( https://github.com/[my-github-username]/predictor/fork ) 36 | 2. Create your feature branch (`git checkout -b my-new-feature`) 37 | 3. Commit your changes (`git commit -am 'Add some feature'`) 38 | 4. Push to the branch (`git push origin my-new-feature`) 39 | 5. Create a new Pull Request 40 | -------------------------------------------------------------------------------- /db/seeds.rb: -------------------------------------------------------------------------------- 1 | # This file should contain all the record creation needed to seed the database with its default values. 2 | # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). 3 | # 4 | # Examples: 5 | # 6 | # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }]) 7 | # Mayor.create(name: 'Emanuel', city: cities.first) 8 | 9 | 10 | team1 = App::Team.create!(name: "UofL") 11 | team2 = App::Team.create!(name: "UK") 12 | team3 = App::Team.create!(name: "UT") 13 | team4 = App::Team.create!(name: "Duke") 14 | 15 | App::Game.create!(date: 9.days.ago, location: "Lville", first_team_id: team1.id, second_team_id: team2.id, winning_team: 1, first_team_score: 1, second_team_score: 2) 16 | App::Game.create!(date: 8.days.ago, location: "Lville", first_team_id: team1.id, second_team_id: team3.id, winning_team: 1, first_team_score: 1, second_team_score: 2) 17 | App::Game.create!(date: 7.days.ago, location: "Lville", first_team_id: team1.id, second_team_id: team4.id, winning_team: 1, first_team_score: 2, second_team_score: 1) 18 | App::Game.create!(date: 6.days.ago, location: "Lville", first_team_id: team2.id, second_team_id: team3.id, winning_team: 1, first_team_score: 1, second_team_score: 2) 19 | App::Game.create!(date: 5.days.ago, location: "Lville", first_team_id: team2.id, second_team_id: team4.id, winning_team: 1, first_team_score: 1, second_team_score: 2) 20 | App::Game.create!(date: 4.days.ago, location: "Lville", first_team_id: team3.id, second_team_id: team4.id, winning_team: 1, first_team_score: 1, second_team_score: 2) 21 | -------------------------------------------------------------------------------- /config/environments/development.rb: -------------------------------------------------------------------------------- 1 | Rails.application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb. 3 | 4 | # In the development environment your application's code is reloaded on 5 | # every request. This slows down response time but is perfect for development 6 | # since you don't have to restart the web server when you make code changes. 7 | config.cache_classes = false 8 | 9 | # Do not eager load code on boot. 10 | config.eager_load = false 11 | 12 | # Show full error reports and disable caching. 13 | config.consider_all_requests_local = true 14 | config.action_controller.perform_caching = false 15 | 16 | # Don't care if the mailer can't send. 17 | config.action_mailer.raise_delivery_errors = false 18 | 19 | # Print deprecation notices to the Rails logger. 20 | config.active_support.deprecation = :log 21 | 22 | # Raise an error on page load if there are pending migrations. 23 | config.active_record.migration_error = :page_load 24 | 25 | # Debug mode disables concatenation and preprocessing of assets. 26 | # This option may cause significant delays in view rendering with a large 27 | # number of complex assets. 28 | config.assets.debug = true 29 | 30 | # Adds additional error checking when serving assets at runtime. 31 | # Checks for improperly declared sprockets dependencies. 32 | # Raises helpful error messages. 33 | config.assets.raise_runtime_errors = true 34 | 35 | # Raises error for missing translations 36 | # config.action_view.raise_on_missing_translations = true 37 | end 38 | -------------------------------------------------------------------------------- /components/games/spec/dummy/config/environments/development.rb: -------------------------------------------------------------------------------- 1 | Rails.application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb. 3 | 4 | # In the development environment your application's code is reloaded on 5 | # every request. This slows down response time but is perfect for development 6 | # since you don't have to restart the web server when you make code changes. 7 | config.cache_classes = false 8 | 9 | # Do not eager load code on boot. 10 | config.eager_load = false 11 | 12 | # Show full error reports and disable caching. 13 | config.consider_all_requests_local = true 14 | config.action_controller.perform_caching = false 15 | 16 | # Don't care if the mailer can't send. 17 | config.action_mailer.raise_delivery_errors = false 18 | 19 | # Print deprecation notices to the Rails logger. 20 | config.active_support.deprecation = :log 21 | 22 | # Raise an error on page load if there are pending migrations. 23 | config.active_record.migration_error = :page_load 24 | 25 | # Debug mode disables concatenation and preprocessing of assets. 26 | # This option may cause significant delays in view rendering with a large 27 | # number of complex assets. 28 | config.assets.debug = true 29 | 30 | # Adds additional error checking when serving assets at runtime. 31 | # Checks for improperly declared sprockets dependencies. 32 | # Raises helpful error messages. 33 | config.assets.raise_runtime_errors = true 34 | 35 | # Raises error for missing translations 36 | # config.action_view.raise_on_missing_translations = true 37 | end 38 | -------------------------------------------------------------------------------- /components/games_ui/spec/dummy/config/environments/development.rb: -------------------------------------------------------------------------------- 1 | Rails.application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb. 3 | 4 | # In the development environment your application's code is reloaded on 5 | # every request. This slows down response time but is perfect for development 6 | # since you don't have to restart the web server when you make code changes. 7 | config.cache_classes = false 8 | 9 | # Do not eager load code on boot. 10 | config.eager_load = false 11 | 12 | # Show full error reports and disable caching. 13 | config.consider_all_requests_local = true 14 | config.action_controller.perform_caching = false 15 | 16 | # Don't care if the mailer can't send. 17 | config.action_mailer.raise_delivery_errors = false 18 | 19 | # Print deprecation notices to the Rails logger. 20 | config.active_support.deprecation = :log 21 | 22 | # Raise an error on page load if there are pending migrations. 23 | config.active_record.migration_error = :page_load 24 | 25 | # Debug mode disables concatenation and preprocessing of assets. 26 | # This option may cause significant delays in view rendering with a large 27 | # number of complex assets. 28 | config.assets.debug = true 29 | 30 | # Adds additional error checking when serving assets at runtime. 31 | # Checks for improperly declared sprockets dependencies. 32 | # Raises helpful error messages. 33 | config.assets.raise_runtime_errors = true 34 | 35 | # Raises error for missing translations 36 | # config.action_view.raise_on_missing_translations = true 37 | end 38 | -------------------------------------------------------------------------------- /components/teams/spec/dummy/config/environments/development.rb: -------------------------------------------------------------------------------- 1 | Rails.application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb. 3 | 4 | # In the development environment your application's code is reloaded on 5 | # every request. This slows down response time but is perfect for development 6 | # since you don't have to restart the web server when you make code changes. 7 | config.cache_classes = false 8 | 9 | # Do not eager load code on boot. 10 | config.eager_load = false 11 | 12 | # Show full error reports and disable caching. 13 | config.consider_all_requests_local = true 14 | config.action_controller.perform_caching = false 15 | 16 | # Don't care if the mailer can't send. 17 | config.action_mailer.raise_delivery_errors = false 18 | 19 | # Print deprecation notices to the Rails logger. 20 | config.active_support.deprecation = :log 21 | 22 | # Raise an error on page load if there are pending migrations. 23 | config.active_record.migration_error = :page_load 24 | 25 | # Debug mode disables concatenation and preprocessing of assets. 26 | # This option may cause significant delays in view rendering with a large 27 | # number of complex assets. 28 | config.assets.debug = true 29 | 30 | # Adds additional error checking when serving assets at runtime. 31 | # Checks for improperly declared sprockets dependencies. 32 | # Raises helpful error messages. 33 | config.assets.raise_runtime_errors = true 34 | 35 | # Raises error for missing translations 36 | # config.action_view.raise_on_missing_translations = true 37 | end 38 | -------------------------------------------------------------------------------- /components/teams_ui/spec/dummy/config/environments/development.rb: -------------------------------------------------------------------------------- 1 | Rails.application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb. 3 | 4 | # In the development environment your application's code is reloaded on 5 | # every request. This slows down response time but is perfect for development 6 | # since you don't have to restart the web server when you make code changes. 7 | config.cache_classes = false 8 | 9 | # Do not eager load code on boot. 10 | config.eager_load = false 11 | 12 | # Show full error reports and disable caching. 13 | config.consider_all_requests_local = true 14 | config.action_controller.perform_caching = false 15 | 16 | # Don't care if the mailer can't send. 17 | config.action_mailer.raise_delivery_errors = false 18 | 19 | # Print deprecation notices to the Rails logger. 20 | config.active_support.deprecation = :log 21 | 22 | # Raise an error on page load if there are pending migrations. 23 | config.active_record.migration_error = :page_load 24 | 25 | # Debug mode disables concatenation and preprocessing of assets. 26 | # This option may cause significant delays in view rendering with a large 27 | # number of complex assets. 28 | config.assets.debug = true 29 | 30 | # Adds additional error checking when serving assets at runtime. 31 | # Checks for improperly declared sprockets dependencies. 32 | # Raises helpful error messages. 33 | config.assets.raise_runtime_errors = true 34 | 35 | # Raises error for missing translations 36 | # config.action_view.raise_on_missing_translations = true 37 | end 38 | -------------------------------------------------------------------------------- /components/predictor_ui/spec/dummy/config/environments/development.rb: -------------------------------------------------------------------------------- 1 | Rails.application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb. 3 | 4 | # In the development environment your application's code is reloaded on 5 | # every request. This slows down response time but is perfect for development 6 | # since you don't have to restart the web server when you make code changes. 7 | config.cache_classes = false 8 | 9 | # Do not eager load code on boot. 10 | config.eager_load = false 11 | 12 | # Show full error reports and disable caching. 13 | config.consider_all_requests_local = true 14 | config.action_controller.perform_caching = false 15 | 16 | # Don't care if the mailer can't send. 17 | config.action_mailer.raise_delivery_errors = false 18 | 19 | # Print deprecation notices to the Rails logger. 20 | config.active_support.deprecation = :log 21 | 22 | # Raise an error on page load if there are pending migrations. 23 | config.active_record.migration_error = :page_load 24 | 25 | # Debug mode disables concatenation and preprocessing of assets. 26 | # This option may cause significant delays in view rendering with a large 27 | # number of complex assets. 28 | config.assets.debug = true 29 | 30 | # Adds additional error checking when serving assets at runtime. 31 | # Checks for improperly declared sprockets dependencies. 32 | # Raises helpful error messages. 33 | config.assets.raise_runtime_errors = true 34 | 35 | # Raises error for missing translations 36 | # config.action_view.raise_on_missing_translations = true 37 | end 38 | -------------------------------------------------------------------------------- /components/welcome_ui/spec/dummy/config/environments/development.rb: -------------------------------------------------------------------------------- 1 | Rails.application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb. 3 | 4 | # In the development environment your application's code is reloaded on 5 | # every request. This slows down response time but is perfect for development 6 | # since you don't have to restart the web server when you make code changes. 7 | config.cache_classes = false 8 | 9 | # Do not eager load code on boot. 10 | config.eager_load = false 11 | 12 | # Show full error reports and disable caching. 13 | config.consider_all_requests_local = true 14 | config.action_controller.perform_caching = false 15 | 16 | # Don't care if the mailer can't send. 17 | config.action_mailer.raise_delivery_errors = false 18 | 19 | # Print deprecation notices to the Rails logger. 20 | config.active_support.deprecation = :log 21 | 22 | # Raise an error on page load if there are pending migrations. 23 | config.active_record.migration_error = :page_load 24 | 25 | # Debug mode disables concatenation and preprocessing of assets. 26 | # This option may cause significant delays in view rendering with a large 27 | # number of complex assets. 28 | config.assets.debug = true 29 | 30 | # Adds additional error checking when serving assets at runtime. 31 | # Checks for improperly declared sprockets dependencies. 32 | # Raises helpful error messages. 33 | config.assets.raise_runtime_errors = true 34 | 35 | # Raises error for missing translations 36 | # config.action_view.raise_on_missing_translations = true 37 | end 38 | -------------------------------------------------------------------------------- /public/500.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | We're sorry, but something went wrong (500) 5 | 6 | 55 | 56 | 57 | 58 | 59 |

60 |
61 |

We're sorry, but something went wrong.

62 |
63 |

If you are the application owner check the logs for more information.

64 |
65 | 66 | 67 | --------------------------------------------------------------------------------