diff options
author | Luke Shumaker <shumakl@purdue.edu> | 2014-04-30 10:52:56 -0400 |
---|---|---|
committer | Luke Shumaker <shumakl@purdue.edu> | 2014-04-30 10:52:56 -0400 |
commit | f1b2a1f25b839237ff1791ffc4586bc466409874 (patch) | |
tree | 5770fc3ed0e3145d6617db44cb29ecd96b82dc44 | |
parent | 55f6da9556391a9676a425256a9ae1048c300e17 (diff) |
remove debug code
-rw-r--r-- | app/controllers/brackets_controller.rb | 4 | ||||
-rw-r--r-- | app/controllers/pms_controller.rb | 2 | ||||
-rw-r--r-- | app/models/bracket.rb | 4 | ||||
-rw-r--r-- | app/models/match.rb | 5 | ||||
-rw-r--r-- | lib/sampling/manual.rb | 7 | ||||
-rw-r--r-- | lib/scheduling/elimination.rb | 10 |
6 files changed, 0 insertions, 32 deletions
diff --git a/app/controllers/brackets_controller.rb b/app/controllers/brackets_controller.rb index c5dd887..85b4f94 100644 --- a/app/controllers/brackets_controller.rb +++ b/app/controllers/brackets_controller.rb @@ -95,10 +95,6 @@ class BracketsController < ApplicationController end def prediction_params - require 'pp' - puts "<params"+"<"*80 - pp params - puts ">"*80 params.require(:bracket).require(:matches) end end diff --git a/app/controllers/pms_controller.rb b/app/controllers/pms_controller.rb index 3368663..be4d443 100644 --- a/app/controllers/pms_controller.rb +++ b/app/controllers/pms_controller.rb @@ -24,8 +24,6 @@ class PmsController < ApplicationController def create @pm = Pm.new(pm_params) @pm.author = current_user - #require 'pp' - #pp @pm.message @pm.recipient = User.find_by_user_name(pm_params['recipient_id']) @pm.conversation = @pm.author.send_message(@pm.recipient, @pm.message, @pm.subject).conversation diff --git a/app/models/bracket.rb b/app/models/bracket.rb index 5aac704..5de3751 100644 --- a/app/models/bracket.rb +++ b/app/models/bracket.rb @@ -15,10 +15,6 @@ class Bracket < ActiveRecord::Base def predict_winners(predictions) - require 'pp' - puts("<"*80) - pp predictions - puts(">"*80) (0..bracket_matches.count-1).each do |i| bracket_matches.order(:match_id)[i].update(predicted_winner: Team.find(predictions[(i+1).to_s])); end diff --git a/app/models/match.rb b/app/models/match.rb index e8174ce..ed21f78 100644 --- a/app/models/match.rb +++ b/app/models/match.rb @@ -48,11 +48,6 @@ class Match < ActiveRecord::Base # Delagates PUT/PATCH HTTP params to the appropriate sampling # methods. def handle_sampling(user, params) - require 'pp' - puts('>'*80) - pp user - pp params - puts('<'*80) method_classes.each do |klass| klass.new(self).handle_user_interaction(user, params) end diff --git a/lib/sampling/manual.rb b/lib/sampling/manual.rb index a9f9de4..853516c 100644 --- a/lib/sampling/manual.rb +++ b/lib/sampling/manual.rb @@ -44,17 +44,10 @@ module Sampling def handle_user_interaction(user, params) # => Save sampling_params as statistics - require 'pp' - puts('>'*80) - pp @match - puts('>'*80) if (@match.tournament_stage.tournament.hosts.include? user) manual_params = params.require(:manual) winner = Team.find(manual_params[:winner]) @match.users.each do |user| - puts('>'*80) - pp "MAKING statistics BIIIIIIIITCH" - puts('>'*80) Statistic.create(match: @match, user: user, name: "win", value: winner.users.include?(user)) @match.stats_from(self.class).reject{|s|s=="win"}.each do |stat| diff --git a/lib/scheduling/elimination.rb b/lib/scheduling/elimination.rb index 622199c..a2ff989 100644 --- a/lib/scheduling/elimination.rb +++ b/lib/scheduling/elimination.rb @@ -37,7 +37,6 @@ module Scheduling end def finish_match(match) - require 'pp' logBase = match.tournament_stage.tournament.min_teams_per_match matches = match.tournament_stage.matches_ordered cur_match_num = matches.invert[match] @@ -45,10 +44,7 @@ module Scheduling match.winner.matches.push(matches[(cur_match_num+logBase-2)/logBase]) end if matches[(cur_match_num+logBase-2)/logBase].teams.count == match.tournament_stage.tournament.min_teams_per_match - puts(">"*80) - pp matches[(cur_match_num+logBase-2)/logBase].status matches[(cur_match_num+logBase-2)/logBase].update(status: 1) - puts(">"*80) end end @@ -81,20 +77,14 @@ module Scheduling pBase = 1 (1..matches.count).each do |i| matchDepth = Math.log(i*(logBase-1), logBase).floor+1 - puts matchDepth if matchDepth > Math.log(base*(logBase-1), logBase).floor+1 pBase = base base = i end - puts base rh = 100 / (logBase**(depth-1)+1) - 100/height; - puts rh rw = 100/(depth+1) - 5 - puts rw rx = 50/(depth+1) + 100/(depth+1)*(depth-matchDepth) - puts rx ry = 100/(logBase**(matchDepth-1)+1) * (i-base+1) - rh/2 - puts ry str += "\t<a id=\"svg-match-#{i}\" xlink:href=\"#{match_path(matches[i])}\"><g>\n" str += "\t\t<rect height=\"#{rh}%\" width=\"#{rw}%\" x=\"#{rx}%\" y=\"#{ry}%\" fill=\"url(#gradMatch)\" rx=\"5px\" stroke-width=\"2\"" |