tournament 2.6.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,10 @@
1
+ *.log
2
+ .svn
3
+ webgui/config/environments/development.rb
4
+ webgui/config/initializers/site_keys.rb
5
+ webgui/db/*.sql
6
+ webgui/db/*.yml
7
+ webgui/db/*.sqlite3
8
+ .*.swp
9
+ *.archive
10
+ tasks/*
@@ -1,3 +1,6 @@
1
+ == 3.0.0 / 2009-03-06
2
+ * NCAA 2010 Tournament initial release.
3
+
1
4
  == 2.6.0 / 2009-03-29
2
5
  * Pretty HTML Final Four report.
3
6
 
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 2009 NCAA tournament pre-configured. If you were to use
27
- this library for the 2010 NCAA tournament, code changes would be
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
- load 'tasks/setup.rb'
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 => 'spec:run'
11
+ task :default => 'test:run'
11
12
 
12
- depend_on 'main'
13
- depend_on 'rake'
14
- depend_on 'rails', '=2.2.2'
15
- depend_on 'sqlite3-ruby'
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
- PROJ.name = 'tournament'
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
- PROJ.spec.opts << '--color'
28
+ exclude %w(tmp$ bak$ ~$ CVS \.svn ^pkg ^doc bin/fake bin/gui_v2.rb ^tags$)
27
29
 
28
- PROJ.exclude = %w(tmp$ bak$ ~$ CVS \.svn ^pkg ^doc bin/fake bin/gui_v2.rb)
29
- PROJ.exclude << '^tags$'
30
-
31
- PROJ.rdoc.opts = ["--line-numbers", "--force-update", "-W", "http://tournament.rubyforge.org/svn/trunk/%s"]
32
- PROJ.rdoc.exclude = [
33
- "webgui\/vendor\/plugins\/restful_authentication\/notes\/.+\.txt",
34
- "webgui\/db\/migrate\/teams.txt",
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
+ }
@@ -7,7 +7,7 @@ unless defined? Tournament
7
7
  module Tournament
8
8
 
9
9
  # :stopdoc:
10
- VERSION = '1.0.0'
10
+ VERSION = '3.0.0'
11
11
  LIBPATH = ::File.expand_path(::File.dirname(__FILE__)) + ::File::SEPARATOR
12
12
  PATH = ::File.dirname(LIBPATH) + ::File::SEPARATOR
13
13
  # :startdoc:
@@ -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
- region[:teams].each do |team|
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]
@@ -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 => {:user_id => '#{user_id}'}
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
@@ -9,7 +9,7 @@
9
9
  </tr>
10
10
  <tr>
11
11
  <td><%=f.label 'starts_at'%></td>
12
- <td><%=f.date_select 'starts_at'%></td>
12
+ <td><%=f.datetime_select 'starts_at'%></td>
13
13
  </tr>
14
14
  <tr>
15
15
  <td><%=f.label 'active'%></td>
@@ -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.to_formatted_s(:long)%>
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%>&nbsp;&nbsp;
37
43
  <% end -%>
38
44
  </div>
45
+ <% end -%>
39
46
  <div class="poollistinfodetail">
40
47
  Scoring: <%=pool.pool.scoring_strategy.description%>
41
48
  </div>
@@ -1,3 +1,4 @@
1
+ <% if pool.entries.size > 0 -%>
1
2
  <% if show_header %>
2
3
  <h1>Leader Report</h1>
3
4
  <ul>
@@ -79,3 +80,9 @@ end
79
80
  %>
80
81
  </tbody>
81
82
  </table>
83
+ <% else -%>
84
+ <h1>Leader Report</h1>
85
+ <p>
86
+ <i>There are no entries in the pool.</i>
87
+ </p>
88
+ <% end -%>
@@ -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] -%>
@@ -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.2.2' unless defined? RAILS_GEM_VERSION
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')
@@ -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/2009FinalFour.png) center no-repeat;
7
+ background: white url(../images/2010FinalFour.jpg) center no-repeat;
8
8
  }
9
9
 
10
10
  TABLE.bracket TH.header
@@ -1,4 +1,4 @@
1
- # -*- coding: mule-utf-8 -*-
1
+ # -*- coding: utf-8 -*-
2
2
  module Authentication
3
3
  module ByCookieToken
4
4
  # Stuff directives into including module
metadata CHANGED
@@ -1,7 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tournament
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.0
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: 2009-03-29 00:00:00 -07:00
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
- type: :runtime
18
- version_requirement:
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
- version: 2.8.3
24
- version:
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
- type: :runtime
28
- version_requirement:
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
- version: 0.8.3
34
- version:
35
- - !ruby/object:Gem::Dependency
36
- name: rails
41
+ segments:
42
+ - 0
43
+ - 8
44
+ - 7
45
+ version: 0.8.7
37
46
  type: :runtime
38
- version_requirement:
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: sqlite3-ruby
47
- type: :runtime
48
- version_requirement:
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
- version: 1.2.4
54
- version:
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
- type: :development
58
- version_requirement:
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
- version: 2.4.2
64
- version:
65
- description: Small library, command line program and Rails web GUI for managing a NCAA basketball tournament pool.
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/application.rb
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.1
386
+ rubygems_version: 1.3.6
368
387
  signing_key:
369
- specification_version: 2
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