tournament 2.6.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.bnsignore +10 -0
- data/History.txt +3 -0
- data/README.txt +2 -2
- data/Rakefile +26 -27
- data/lib/tournament.rb +1 -1
- data/lib/tournament/pool.rb +2 -1
- data/webgui/app/controllers/{application.rb → application_controller.rb} +0 -0
- data/webgui/app/models/pool.rb +2 -2
- data/webgui/app/views/admin/pool.html.erb +1 -1
- data/webgui/app/views/entry/index.html.erb +6 -0
- data/webgui/app/views/pool/index.html.erb +8 -1
- data/webgui/app/views/reports/_leader.html.erb +7 -0
- data/webgui/app/views/reports/show.html.erb +2 -0
- data/webgui/config/boot.rb +2 -1
- data/webgui/config/environment.rb +1 -1
- data/webgui/public/images/2010FinalFour.jpg +0 -0
- data/webgui/public/stylesheets/bracket.css +1 -1
- data/webgui/vendor/plugins/restful_authentication/lib/authentication/by_cookie_token.rb +1 -1
- metadata +57 -38
data/.bnsignore
ADDED
data/History.txt
CHANGED
data/README.txt
CHANGED
@@ -23,8 +23,8 @@ basketball tournament pool.
|
|
23
23
|
== COMMAND LINE SYNOPSIS:
|
24
24
|
|
25
25
|
The tournament command line program is installed as 'pool'. The library
|
26
|
-
has the
|
27
|
-
this library for the
|
26
|
+
has the 2010 NCAA tournament pre-configured. If you were to use
|
27
|
+
this library for the 2011 NCAA tournament, code changes would be
|
28
28
|
necessary. FIXME: (add ability to read teams from a simple configuration
|
29
29
|
file). For usage, just execute
|
30
30
|
|
data/Rakefile
CHANGED
@@ -1,37 +1,36 @@
|
|
1
|
-
# Look in the tasks/setup.rb file for the various options that can be
|
2
|
-
# configured in this Rakefile. The .rake files in the tasks directory
|
3
|
-
# are where the options are used.
|
4
1
|
|
5
|
-
|
2
|
+
begin
|
3
|
+
require 'bones'
|
4
|
+
rescue LoadError
|
5
|
+
abort '### Please install the "bones" gem ###'
|
6
|
+
end
|
6
7
|
|
7
8
|
ensure_in_path 'lib'
|
8
9
|
require 'tournament'
|
9
10
|
|
10
|
-
task :default => '
|
11
|
+
task :default => 'test:run'
|
11
12
|
|
12
|
-
|
13
|
-
depend_on '
|
14
|
-
depend_on '
|
15
|
-
depend_on '
|
13
|
+
Bones {
|
14
|
+
depend_on 'main'
|
15
|
+
depend_on 'rake'
|
16
|
+
depend_on 'rails'
|
16
17
|
|
18
|
+
name 'tournament'
|
19
|
+
authors 'Douglas A. Seifert'
|
20
|
+
email 'doug+rubyforge@dseifert.net'
|
21
|
+
url 'http://www.dseifert.net/code/tournament'
|
22
|
+
rubyforge.name 'tournament'
|
23
|
+
version Tournament::VERSION
|
24
|
+
group_id = 5863
|
17
25
|
|
18
|
-
|
19
|
-
PROJ.authors = 'Douglas A. Seifert'
|
20
|
-
PROJ.email = 'doug+rubyforge@dseifert.net'
|
21
|
-
PROJ.url = 'http://www.dseifert.net/code/tournament'
|
22
|
-
PROJ.rubyforge.name = 'tournament'
|
23
|
-
PROJ.version = '2.6.0'
|
24
|
-
PROJ.group_id = 5863
|
26
|
+
#spec.opts << '--color'
|
25
27
|
|
26
|
-
|
28
|
+
exclude %w(tmp$ bak$ ~$ CVS \.svn ^pkg ^doc bin/fake bin/gui_v2.rb ^tags$)
|
27
29
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
"webgui\/public\/robots.txt"
|
36
|
-
]
|
37
|
-
# EOF
|
30
|
+
rdoc.opts ["--line-numbers", "--force-update", "-W", "http://tournament.rubyforge.org/svn/trunk/%s"]
|
31
|
+
rdoc.exclude [
|
32
|
+
"webgui\/vendor\/plugins\/restful_authentication\/notes\/.+\.txt",
|
33
|
+
"webgui\/db\/migrate\/teams.txt",
|
34
|
+
"webgui\/public\/robots.txt"
|
35
|
+
]
|
36
|
+
}
|
data/lib/tournament.rb
CHANGED
data/lib/tournament/pool.rb
CHANGED
@@ -443,7 +443,8 @@ class Tournament::Pool
|
|
443
443
|
out << " Region | Seed | Team " << "\n"
|
444
444
|
current_idx = -1
|
445
445
|
@regions.each_with_index do |region, idx|
|
446
|
-
|
446
|
+
next unless region
|
447
|
+
(region[:teams] || []).each do |team|
|
447
448
|
region_name = ''
|
448
449
|
if idx != current_idx
|
449
450
|
region_name = region[:name]
|
File without changes
|
data/webgui/app/models/pool.rb
CHANGED
@@ -9,7 +9,7 @@ class Pool < ActiveRecord::Base
|
|
9
9
|
has_many :user_entries, :class_name => 'Entry', :conditions => ['user_id != ?', '#{user_id}']
|
10
10
|
has_many :users, :through => :user_entries
|
11
11
|
has_many :pending_entries, :class_name => 'Entry', :conditions => ['completed = ? and user_id != ?', false, '#{user_id}']
|
12
|
-
has_one :tournament_entry, :class_name => 'Entry', :conditions =>
|
12
|
+
has_one :tournament_entry, :class_name => 'Entry', :conditions => ['user_id = \'#{user_id}\'']
|
13
13
|
has_many :seedings
|
14
14
|
has_many :teams, :through => :seedings
|
15
15
|
has_many :regions, :order => 'position'
|
@@ -142,6 +142,6 @@ class Pool < ActiveRecord::Base
|
|
142
142
|
end
|
143
143
|
|
144
144
|
def self.active_pools
|
145
|
-
Pool.find(:all, :conditions => ['active = ?', true])
|
145
|
+
Pool.find(:all, :conditions => ['active = ?', true]).reverse
|
146
146
|
end
|
147
147
|
end
|
@@ -11,6 +11,12 @@ You have no entries.
|
|
11
11
|
<% end %>
|
12
12
|
</ul>
|
13
13
|
<% end %>
|
14
|
+
<% if @pool.accepting_entries? -%>
|
14
15
|
<p>
|
15
16
|
<%= link_to 'Create a new entry', :action => 'new', :id => @pool.id %>
|
16
17
|
</p>
|
18
|
+
<% elsif !@pool.ready? -%>
|
19
|
+
<i>This pool is not yet ready. The pool starts in <%= distance_of_time_in_words(@pool.starts_at, Time.now) %>. After it starts, you can make entries.</i>
|
20
|
+
<% else -%>
|
21
|
+
<i>This pool is not accepting any more entries.</i>
|
22
|
+
<% end -%>
|
@@ -6,19 +6,24 @@
|
|
6
6
|
<span class="poollisthead"><%= pool.name %></span>
|
7
7
|
<small>
|
8
8
|
<% if current_user && pool.user_id == current_user.id %>
|
9
|
+
<% if pool.tournament_entry -%>
|
9
10
|
<%= link_to '[Tourny Bracket]', :controller => 'admin', :action => 'bracket', :id => pool.tournament_entry.id %>
|
11
|
+
<% end -%>
|
10
12
|
<%= link_to '[Recap]', :controller => 'admin', :action => 'recap', :id => pool.id%>
|
11
13
|
<%= link_to '[Edit]', :controller => 'admin', :action => 'pool', :id => pool.id %>
|
12
14
|
<%= link_to '[Entries]', :controller => 'admin', :action => 'entries', :id => pool.id %>
|
13
15
|
<% else %>
|
16
|
+
<% if pool.tournament_entry -%>
|
14
17
|
<%= link_to '[Tourny Bracket]', :controller => 'entry', :action => 'show', :id => pool.tournament_entry.id %>
|
15
18
|
<% end %>
|
19
|
+
<% end %>
|
16
20
|
<%= link_to '[Leader Board]', :controller => 'reports', :action => 'show', :id => pool.id, :report => 'leader' %>
|
17
21
|
<%= link_to '[Reports]', :controller => 'reports', :action => 'show', :id => pool.id %>
|
18
22
|
</small>
|
19
23
|
<div class="poollistinfo">
|
20
24
|
<div class="poollistinfodetail">
|
21
|
-
<% if pool.starts_at < Time.zone.now %>Started<%else%>Starts<%end%>: <%= pool.starts_at.
|
25
|
+
<% if pool.starts_at < Time.zone.now %>Started<%else%>Starts<%end%>: <%= distance_of_time_in_words(pool.starts_at, Time.now)%>
|
26
|
+
<% if pool.starts_at < Time.zone.now %>ago.<%else%>from now.<%end%>
|
22
27
|
Pending Entries: <%= pool.pending_entries.size%>
|
23
28
|
Total Entries: <%= pool.user_entries.size%>
|
24
29
|
</div>
|
@@ -28,6 +33,7 @@ Last Update: <%=pool.updated_at.to_formatted_s(:long)%>
|
|
28
33
|
<div class="poollistinfodetail">
|
29
34
|
Entry Fee: $<%=pool.fee%>
|
30
35
|
</div>
|
36
|
+
<% if pool.user_entries.size > 0 -%>
|
31
37
|
<div class="poollistinfodetail">
|
32
38
|
Payouts:
|
33
39
|
<% take = pool.user_entries.size * pool.fee.to_f -
|
@@ -36,6 +42,7 @@ Payouts:
|
|
36
42
|
<%=p.rank != 'L' ? p.rank.to_i.ordinal : 'Last'%>: $<%=p.kind == '$' ? p.payout : p.payout.to_f / 100.0 * take%>
|
37
43
|
<% end -%>
|
38
44
|
</div>
|
45
|
+
<% end -%>
|
39
46
|
<div class="poollistinfodetail">
|
40
47
|
Scoring: <%=pool.pool.scoring_strategy.description%>
|
41
48
|
</div>
|
@@ -2,6 +2,7 @@
|
|
2
2
|
<ul>
|
3
3
|
<li><%= link_to 'Region', :report => 'region'%></li>
|
4
4
|
<li><%= link_to 'Entries', :report => 'entry'%></li>
|
5
|
+
<% if @pool.ready? -%>
|
5
6
|
<li><%= link_to 'Score', :report => 'score'%></li>
|
6
7
|
<li><%= link_to 'Leader', :report => 'leader'%></li>
|
7
8
|
<% if @pool.pool.tournament_entry.picks.teams_left <= 16 %>
|
@@ -10,6 +11,7 @@
|
|
10
11
|
<% if @pool.pool.tournament_entry.picks.teams_left <= 4 %>
|
11
12
|
<li><%= link_to 'Final Four', :report => 'final_four'%></li>
|
12
13
|
<% end %>
|
14
|
+
<% end %>
|
13
15
|
</ul>
|
14
16
|
<div id="report">
|
15
17
|
<% if params[:report] -%>
|
data/webgui/config/boot.rb
CHANGED
@@ -44,6 +44,7 @@ module Rails
|
|
44
44
|
def load_initializer
|
45
45
|
require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
|
46
46
|
Rails::Initializer.run(:install_gem_spec_stubs)
|
47
|
+
Rails::GemDependency.add_frozen_gem_path
|
47
48
|
end
|
48
49
|
end
|
49
50
|
|
@@ -81,8 +82,8 @@ module Rails
|
|
81
82
|
end
|
82
83
|
|
83
84
|
def load_rubygems
|
85
|
+
min_version = '1.3.2'
|
84
86
|
require 'rubygems'
|
85
|
-
min_version = '1.3.1'
|
86
87
|
unless rubygems_version >= min_version
|
87
88
|
$stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.)
|
88
89
|
exit 1
|
@@ -5,7 +5,7 @@
|
|
5
5
|
# ENV['RAILS_ENV'] ||= 'production'
|
6
6
|
|
7
7
|
# Specifies gem version of Rails to use when vendor/rails is not present
|
8
|
-
RAILS_GEM_VERSION = '2.
|
8
|
+
RAILS_GEM_VERSION = '2.3.5' unless defined? RAILS_GEM_VERSION
|
9
9
|
|
10
10
|
# Bootstrap the Rails environment, frameworks, and default configuration
|
11
11
|
require File.join(File.dirname(__FILE__), 'boot')
|
Binary file
|
@@ -4,7 +4,7 @@ TABLE.bracket
|
|
4
4
|
BORDER-TOP: black 1px solid;
|
5
5
|
BORDER-LEFT: black 1px solid;
|
6
6
|
BORDER-BOTTOM: black 1px solid;
|
7
|
-
background: white url(../images/
|
7
|
+
background: white url(../images/2010FinalFour.jpg) center no-repeat;
|
8
8
|
}
|
9
9
|
|
10
10
|
TABLE.bracket TH.header
|
metadata
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tournament
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 3
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
version: 3.0.0
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
7
12
|
- Douglas A. Seifert
|
@@ -9,60 +14,68 @@ autorequire:
|
|
9
14
|
bindir: bin
|
10
15
|
cert_chain: []
|
11
16
|
|
12
|
-
date:
|
17
|
+
date: 2010-03-06 00:00:00 -08:00
|
13
18
|
default_executable:
|
14
19
|
dependencies:
|
15
20
|
- !ruby/object:Gem::Dependency
|
16
21
|
name: main
|
17
|
-
|
18
|
-
|
19
|
-
version_requirements: !ruby/object:Gem::Requirement
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
20
24
|
requirements:
|
21
25
|
- - ">="
|
22
26
|
- !ruby/object:Gem::Version
|
23
|
-
|
24
|
-
|
27
|
+
segments:
|
28
|
+
- 4
|
29
|
+
- 2
|
30
|
+
- 0
|
31
|
+
version: 4.2.0
|
32
|
+
type: :runtime
|
33
|
+
version_requirements: *id001
|
25
34
|
- !ruby/object:Gem::Dependency
|
26
35
|
name: rake
|
27
|
-
|
28
|
-
|
29
|
-
version_requirements: !ruby/object:Gem::Requirement
|
36
|
+
prerelease: false
|
37
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
30
38
|
requirements:
|
31
39
|
- - ">="
|
32
40
|
- !ruby/object:Gem::Version
|
33
|
-
|
34
|
-
|
35
|
-
-
|
36
|
-
|
41
|
+
segments:
|
42
|
+
- 0
|
43
|
+
- 8
|
44
|
+
- 7
|
45
|
+
version: 0.8.7
|
37
46
|
type: :runtime
|
38
|
-
|
39
|
-
version_requirements: !ruby/object:Gem::Requirement
|
40
|
-
requirements:
|
41
|
-
- - "="
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
version: 2.2.2
|
44
|
-
version:
|
47
|
+
version_requirements: *id002
|
45
48
|
- !ruby/object:Gem::Dependency
|
46
|
-
name:
|
47
|
-
|
48
|
-
|
49
|
-
version_requirements: !ruby/object:Gem::Requirement
|
49
|
+
name: rails
|
50
|
+
prerelease: false
|
51
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
50
52
|
requirements:
|
51
53
|
- - ">="
|
52
54
|
- !ruby/object:Gem::Version
|
53
|
-
|
54
|
-
|
55
|
+
segments:
|
56
|
+
- 2
|
57
|
+
- 3
|
58
|
+
- 5
|
59
|
+
version: 2.3.5
|
60
|
+
type: :runtime
|
61
|
+
version_requirements: *id003
|
55
62
|
- !ruby/object:Gem::Dependency
|
56
63
|
name: bones
|
57
|
-
|
58
|
-
|
59
|
-
version_requirements: !ruby/object:Gem::Requirement
|
64
|
+
prerelease: false
|
65
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
60
66
|
requirements:
|
61
67
|
- - ">="
|
62
68
|
- !ruby/object:Gem::Version
|
63
|
-
|
64
|
-
|
65
|
-
|
69
|
+
segments:
|
70
|
+
- 3
|
71
|
+
- 3
|
72
|
+
- 0
|
73
|
+
version: 3.3.0
|
74
|
+
type: :development
|
75
|
+
version_requirements: *id004
|
76
|
+
description: |-
|
77
|
+
Small library, command line program and Rails web GUI for managing a NCAA
|
78
|
+
basketball tournament pool.
|
66
79
|
email: doug+rubyforge@dseifert.net
|
67
80
|
executables:
|
68
81
|
- benchmark_pool
|
@@ -78,6 +91,7 @@ extra_rdoc_files:
|
|
78
91
|
- bin/picker
|
79
92
|
- bin/pool
|
80
93
|
files:
|
94
|
+
- .bnsignore
|
81
95
|
- History.txt
|
82
96
|
- README.txt
|
83
97
|
- Rakefile
|
@@ -101,7 +115,7 @@ files:
|
|
101
115
|
- webgui/README
|
102
116
|
- webgui/Rakefile
|
103
117
|
- webgui/app/controllers/admin_controller.rb
|
104
|
-
- webgui/app/controllers/
|
118
|
+
- webgui/app/controllers/application_controller.rb
|
105
119
|
- webgui/app/controllers/entry_controller.rb
|
106
120
|
- webgui/app/controllers/pool_controller.rb
|
107
121
|
- webgui/app/controllers/reports_controller.rb
|
@@ -204,6 +218,7 @@ files:
|
|
204
218
|
- webgui/public/dispatch.rb
|
205
219
|
- webgui/public/favicon.ico
|
206
220
|
- webgui/public/images/2009FinalFour.png
|
221
|
+
- webgui/public/images/2010FinalFour.jpg
|
207
222
|
- webgui/public/images/rails.png
|
208
223
|
- webgui/public/javascripts/application.js
|
209
224
|
- webgui/public/javascripts/bracket.js
|
@@ -339,6 +354,8 @@ files:
|
|
339
354
|
- webgui/vendor/plugins/restful_authentication/tasks/auth.rake
|
340
355
|
has_rdoc: true
|
341
356
|
homepage: http://www.dseifert.net/code/tournament
|
357
|
+
licenses: []
|
358
|
+
|
342
359
|
post_install_message:
|
343
360
|
rdoc_options:
|
344
361
|
- --line-numbers
|
@@ -353,20 +370,22 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
353
370
|
requirements:
|
354
371
|
- - ">="
|
355
372
|
- !ruby/object:Gem::Version
|
373
|
+
segments:
|
374
|
+
- 0
|
356
375
|
version: "0"
|
357
|
-
version:
|
358
376
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
359
377
|
requirements:
|
360
378
|
- - ">="
|
361
379
|
- !ruby/object:Gem::Version
|
380
|
+
segments:
|
381
|
+
- 0
|
362
382
|
version: "0"
|
363
|
-
version:
|
364
383
|
requirements: []
|
365
384
|
|
366
385
|
rubyforge_project: tournament
|
367
|
-
rubygems_version: 1.3.
|
386
|
+
rubygems_version: 1.3.6
|
368
387
|
signing_key:
|
369
|
-
specification_version:
|
388
|
+
specification_version: 3
|
370
389
|
summary: Small library, command line program and Rails web GUI for managing a NCAA basketball tournament pool
|
371
390
|
test_files:
|
372
391
|
- test/test_tournament.rb
|