Skip to content

Commit

Permalink
Merge upstream/master
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonah Hirsch committed Jul 21, 2017
1 parent 114c0fa commit d6f1ea0
Show file tree
Hide file tree
Showing 52 changed files with 559 additions and 288 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@
elovation_development
.idea/*
/config/database.yml
/coverage
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: ruby
rvm:
- 2.1.4
- 2.4.0
addons:
code_climate:
repo_token: 1d94bf5c84636551042e34827bbd457cf0dee1e203b3dfec8fea0003d1d4f340
Expand All @@ -9,3 +9,5 @@ install: bundle install --verbose
before_script:
- cp config/database.yml.example config/database.yml
- bundle exec rake db:do
after_success:
- bundle exec codeclimate-test-reporter
5 changes: 3 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ source 'https://rubygems.org'

ruby '2.4.1'

gem 'rails', '~> 5.0'
gem 'rails', '~> 5.1'

gem 'pg'

Expand All @@ -20,7 +20,6 @@ gem 'terminal-table'
gem 'rails-assets-spectrum', source: 'https://rails-assets.org'

group :production do
gem 'rails_12factor'
gem 'unicorn'
end

Expand All @@ -29,6 +28,7 @@ group :development do
gem 'binding_of_caller'
gem 'dotenv-rails'
gem 'pry-byebug'
gem 'listen'
end

group :development, :test do
Expand All @@ -48,4 +48,5 @@ group :test do
gem 'rspec-rails', '~> 3.5'
gem 'timecop'
gem 'codeclimate-test-reporter', require: nil
gem 'rails-controller-testing'
end
122 changes: 65 additions & 57 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,44 +8,44 @@ GEM
remote: https://rubygems.org/
remote: https://rails-assets.org/
specs:
actioncable (5.0.2)
actionpack (= 5.0.2)
nio4r (>= 1.2, < 3.0)
actioncable (5.1.0)
actionpack (= 5.1.0)
nio4r (~> 2.0)
websocket-driver (~> 0.6.1)
actionmailer (5.0.2)
actionpack (= 5.0.2)
actionview (= 5.0.2)
activejob (= 5.0.2)
actionmailer (5.1.0)
actionpack (= 5.1.0)
actionview (= 5.1.0)
activejob (= 5.1.0)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (5.0.2)
actionview (= 5.0.2)
activesupport (= 5.0.2)
actionpack (5.1.0)
actionview (= 5.1.0)
activesupport (= 5.1.0)
rack (~> 2.0)
rack-test (~> 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (5.0.2)
activesupport (= 5.0.2)
actionview (5.1.0)
activesupport (= 5.1.0)
builder (~> 3.1)
erubis (~> 2.7.0)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
activejob (5.0.2)
activesupport (= 5.0.2)
activejob (5.1.0)
activesupport (= 5.1.0)
globalid (>= 0.3.6)
activemodel (5.0.2)
activesupport (= 5.0.2)
activerecord (5.0.2)
activemodel (= 5.0.2)
activesupport (= 5.0.2)
arel (~> 7.0)
activesupport (5.0.2)
activemodel (5.1.0)
activesupport (= 5.1.0)
activerecord (5.1.0)
activemodel (= 5.1.0)
activesupport (= 5.1.0)
arel (~> 8.0)
activesupport (5.1.0)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (~> 0.7)
minitest (~> 5.1)
tzinfo (~> 1.1)
arel (7.1.4)
arel (8.0.0)
better_errors (2.1.1)
coderay (>= 1.0.0)
erubis (>= 2.6.6)
Expand All @@ -58,25 +58,26 @@ GEM
codeclimate-test-reporter (1.0.8)
simplecov (<= 0.13)
coderay (1.1.1)
coffee-rails (4.1.1)
coffee-rails (4.2.1)
coffee-script (>= 2.2.0)
railties (>= 4.0.0, < 5.1.x)
railties (>= 4.0.0, < 5.2.x)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.10.0)
coffee-script-source (1.12.2)
concurrent-ruby (1.0.5)
coolline (0.5.0)
unicode_utils (~> 1.4)
debug_inspector (0.0.2)
diff-lcs (1.3)
docile (1.1.5)
dotenv (2.2.0)
dotenv-rails (2.2.0)
dotenv (= 2.2.0)
railties (>= 3.2, < 5.1)
dotenv (2.2.1)
dotenv-rails (2.2.1)
dotenv (= 2.2.1)
railties (>= 3.2, < 5.2)
dynamic_form (1.1.4)
elo (0.1.0)
erubi (1.6.0)
erubis (2.7.0)
execjs (2.7.0)
factory_girl (4.8.0)
Expand All @@ -86,24 +87,28 @@ GEM
railties (>= 3.0.0)
faker (1.7.3)
i18n (~> 0.5)
faraday (0.12.1)
faraday (0.12.2)
multipart-post (>= 1.2, < 3)
faraday_middleware (0.11.0.1)
faraday (>= 0.7.4, < 1.0)
ffi (1.9.14)
gli (2.16.0)
globalid (0.4.0)
activesupport (>= 4.2.0)
hashie (3.5.5)
hashie (3.5.6)
i18n (0.8.1)
jquery-rails (4.3.1)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
json (2.1.0)
kgio (2.11.0)
listen (3.0.8)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
loofah (2.0.3)
nokogiri (>= 1.5.9)
mail (2.6.4)
mail (2.6.5)
mime-types (>= 1.16, < 4)
metaclass (0.0.4)
method_source (0.8.2)
Expand Down Expand Up @@ -136,39 +141,41 @@ GEM
rack (2.0.1)
rack-test (0.6.3)
rack (>= 1.0)
rails (5.0.2)
actioncable (= 5.0.2)
actionmailer (= 5.0.2)
actionpack (= 5.0.2)
actionview (= 5.0.2)
activejob (= 5.0.2)
activemodel (= 5.0.2)
activerecord (= 5.0.2)
activesupport (= 5.0.2)
rails (5.1.0)
actioncable (= 5.1.0)
actionmailer (= 5.1.0)
actionpack (= 5.1.0)
actionview (= 5.1.0)
activejob (= 5.1.0)
activemodel (= 5.1.0)
activerecord (= 5.1.0)
activesupport (= 5.1.0)
bundler (>= 1.3.0, < 2.0)
railties (= 5.0.2)
railties (= 5.1.0)
sprockets-rails (>= 2.0.0)
rails-assets-jquery (3.2.1)
rails-assets-spectrum (1.8.0)
rails-assets-jquery (>= 1.7.2)
rails-controller-testing (1.0.1)
actionpack (~> 5.x)
actionview (~> 5.x)
activesupport (~> 5.x)
rails-dom-testing (2.0.2)
activesupport (>= 4.2.0, < 6.0)
nokogiri (~> 1.6)
rails-html-sanitizer (1.0.3)
loofah (~> 2.0)
rails_12factor (0.0.3)
rails_serve_static_assets
rails_stdout_logging
rails_serve_static_assets (0.0.5)
rails_stdout_logging (0.0.5)
railties (5.0.2)
actionpack (= 5.0.2)
activesupport (= 5.0.2)
railties (5.1.0)
actionpack (= 5.1.0)
activesupport (= 5.1.0)
method_source
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
raindrops (0.18.0)
rake (12.0.0)
rb-fsevent (0.9.8)
rb-inotify (0.9.7)
ffi (>= 0.5.0)
rspec-core (3.5.4)
rspec-support (~> 3.5.0)
rspec-expectations (3.5.0)
Expand Down Expand Up @@ -198,7 +205,7 @@ GEM
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.0)
slack-ruby-client (0.8.0)
slack-ruby-client (0.8.1)
activesupport
faraday (>= 0.9)
faraday_middleware
Expand All @@ -218,8 +225,8 @@ GEM
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
terminal-table (1.7.3)
unicode-display_width (~> 1.1.1)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
thor (0.19.4)
thread_safe (0.3.6)
tilt (2.0.7)
Expand All @@ -228,7 +235,7 @@ GEM
thread_safe (~> 0.1)
uglifier (3.2.0)
execjs (>= 0.3.0, < 3)
unicode-display_width (1.1.3)
unicode-display_width (1.3.0)
unicode_utils (1.4.0)
unicorn (5.3.0)
kgio (~> 2.6)
Expand All @@ -252,16 +259,17 @@ DEPENDENCIES
factory_girl_rails
faker
jquery-rails
listen
mocha
pg
pry
pry-byebug
pry-coolline
pry-rails
pry-stack_explorer
rails (~> 5.0)
rails (~> 5.1)
rails-assets-spectrum!
rails_12factor
rails-controller-testing
rspec-rails (~> 3.5)
sass-rails (~> 5.0)
slack-ruby-client
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/results_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def destroy

response = ResultService.destroy(result)

redirect_to :back
redirect_to request.referer
end

def new
Expand Down
2 changes: 1 addition & 1 deletion app/models/player.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def as_json
end

def recent_results
results.order("created_at DESC").limit(5)
results.order("results.created_at DESC").limit(5)
end

def rewind_rating!(game)
Expand Down
2 changes: 1 addition & 1 deletion app/models/team.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class Team < ActiveRecord::Base
FIRST_PLACE_RANK = 1

has_and_belongs_to_many :players
belongs_to :result
belongs_to :result, optional: true

validates :rank, presence: true

Expand Down
2 changes: 1 addition & 1 deletion bin/rails
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env ruby
APP_PATH = File.expand_path('../../config/application', __FILE__)
APP_PATH = File.expand_path('../config/application', __dir__)
require_relative '../config/boot'
require 'rails/commands'
38 changes: 38 additions & 0 deletions bin/setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/env ruby
require 'pathname'
require 'fileutils'
include FileUtils

# path to your application root.
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)

def system!(*args)
system(*args) || abort("\n== Command #{args} failed ==")
end

chdir APP_ROOT do
# This script is a starting point to setup your application.
# Add necessary setup steps to this file.

puts '== Installing dependencies =='
system! 'gem install bundler --conservative'
system('bundle check') || system!('bundle install')

# Install JavaScript dependencies if using Yarn
# system('bin/yarn')


# puts "\n== Copying sample files =="
# unless File.exist?('config/database.yml')
# cp 'config/database.yml.sample', 'config/database.yml'
# end

puts "\n== Preparing database =="
system! 'bin/rails db:setup'

puts "\n== Removing old logs and tempfiles =="
system! 'bin/rails log:clear tmp:clear'

puts "\n== Restarting application server =="
system! 'bin/rails restart'
end
29 changes: 29 additions & 0 deletions bin/update
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env ruby
require 'pathname'
require 'fileutils'
include FileUtils

# path to your application root.
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)

def system!(*args)
system(*args) || abort("\n== Command #{args} failed ==")
end

chdir APP_ROOT do
# This script is a way to update your development environment automatically.
# Add necessary update steps to this file.

puts '== Installing dependencies =='
system! 'gem install bundler --conservative'
system('bundle check') || system!('bundle install')

puts "\n== Updating database =="
system! 'bin/rails db:migrate'

puts "\n== Removing old logs and tempfiles =="
system! 'bin/rails log:clear tmp:clear'

puts "\n== Restarting application server =="
system! 'bin/rails restart'
end
Loading

0 comments on commit d6f1ea0

Please sign in to comment.