go-rank 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,8 @@
1
+ == 0.0.4 2008-12-31
2
+
3
+ * 1 minor enhancement:
4
+ * better check for valid ranks in GoRank.new
5
+
1
6
  == 0.0.3 2008-12-30
2
7
 
3
8
  * 1 bug fix
data/lib/gorank/gorank.rb CHANGED
@@ -46,6 +46,8 @@ class GoRank
46
46
  raise ArgumentError,"must be :kyu, :dan" unless [:kyu,:dan].include?(kd)
47
47
  @num = num
48
48
  @kd = kd
49
+ raise ArgumentError if @kd == :kyu and (@num < 1 or @num > 30) or
50
+ @kd == :dan and (@num < 1 or @num > 7)
49
51
  end
50
52
 
51
53
  # human representation of a rank.
@@ -2,7 +2,7 @@ module Gorank #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- TINY = 3
5
+ TINY = 4
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
data/test/test_gorank.rb CHANGED
@@ -130,4 +130,19 @@ p myrank
130
130
  [30, :kyu],
131
131
  ], GoRank.ranks
132
132
  end
133
+
134
+ def test_valid_invalid_ranks
135
+ assert_nothing_raised {
136
+ rank = GoRank.new 7, :dan
137
+ rank = GoRank.new 1, :dan
138
+ rank = GoRank.new 1, :kyu
139
+ rank = GoRank.new 30, :kyu
140
+ }
141
+ assert_raise(ArgumentError) {
142
+ rank = GoRank.new 8, :dan
143
+ rank = GoRank.new 0, :dan
144
+ rank = GoRank.new 0, :kyu
145
+ rank = GoRank.new 31, :kyu
146
+ }
147
+ end
133
148
  end
data/website/index.html CHANGED
@@ -33,55 +33,26 @@
33
33
  <h1>gorank</h1>
34
34
  <div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/gorank"; return false'>
35
35
  <p>Get Version</p>
36
- <a href="http://rubyforge.org/projects/gorank" class="numbers">0.0.2</a>
36
+ <a href="http://rubyforge.org/projects/gorank" class="numbers">0.0.4</a>
37
37
  </div>
38
- <h1>&#x2192; &#8216;gorank&#8217;</h1>
39
-
40
-
41
- <h2>What</h2>
42
-
43
-
44
- <h2>Installing</h2>
45
-
46
-
38
+ <h2>What</h2>
39
+ <p>Go-Rank is a class for handling ranks in the game of <a href="http://en.wikipedia.org/wiki/Go_(game">Go</a>)</p>
40
+ <h2>Installing</h2>
47
41
  <pre syntax="ruby">sudo gem install gorank</pre>
48
-
49
- <h2>The basics</h2>
50
-
51
-
52
- <h2>Demonstration of usage</h2>
53
-
54
-
55
- <h2>Forum</h2>
56
-
57
-
58
- <p><a href="http://groups.google.com/group/gorank">http://groups.google.com/group/gorank</a></p>
59
-
60
-
61
- <p><span class="caps">TODO</span> &#8211; create Google Group &#8211; gorank</p>
62
-
63
-
64
- <h2>How to submit patches</h2>
65
-
66
-
67
- <p>Read the <a href="http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/">8 steps for fixing other people&#8217;s code</a> and for section <a href="http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/#8b-google-groups">8b: Submit patch to Google Groups</a>, use the Google Group above.</p>
68
-
69
-
70
- <p>The trunk repository is <code>svn://rubyforge.org/var/svn/gorank/trunk</code> for anonymous access.</p>
71
-
72
-
73
- <h2>License</h2>
74
-
75
-
76
- <p>This code is free to use under the terms of the <span class="caps">MIT</span> license.</p>
77
-
78
-
79
- <h2>Contact</h2>
80
-
81
-
82
- <p>Comments are welcome. Send an email to <a href="mailto:thopre@gmail.com">Thomas Preymesser</a>.</p>
42
+ <h2>The basics</h2>
43
+ <h2>Demonstration of usage</h2>
44
+ <p>See the rdoc documentation of this gem.</p>
45
+ <h2>Forum</h2>
46
+ <p><a href="http://groups.google.com/group/gorank">http://groups.google.com/group/gorank</a></p>
47
+ <h2>How to submit patches</h2>
48
+ <p>Read the <a href="http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/">8 steps for fixing other people&#8217;s code</a> and for section <a href="http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/#8b-google-groups">8b: Submit patch to Google Groups</a>, use the Google Group above.</p>
49
+ <p>The trunk repository is <code>svn://rubyforge.org/var/svn/gorank/trunk</code> for anonymous access.</p>
50
+ <h2>License</h2>
51
+ <p>This code is free to use under the terms of the <span class="caps">MIT</span> license.</p>
52
+ <h2>Contact</h2>
53
+ <p>Comments are welcome. Send an email to <a href="mailto:thopre@gmail.com">Thomas Preymesser</a>.</p>
83
54
  <p class="coda">
84
- <a href="mailto:drnicwilliams@gmail.com">Dr Nic</a>, 8th July 2007<br>
55
+ <a href="mailto:thopre@gmail.com">Thomas Preymesser</a>, 31st December 2008<br>
85
56
  Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
86
57
  </p>
87
58
  </div>
data/website/index.txt CHANGED
@@ -1,10 +1,8 @@
1
1
  h1. gorank
2
2
 
3
- h1. &#x2192; 'gorank'
4
-
5
-
6
3
  h2. What
7
4
 
5
+ Go-Rank is a class for handling ranks in the game of "Go":http://en.wikipedia.org/wiki/Go_(game)
8
6
 
9
7
  h2. Installing
10
8
 
@@ -15,14 +13,12 @@ h2. The basics
15
13
 
16
14
  h2. Demonstration of usage
17
15
 
18
-
16
+ See the rdoc documentation of this gem.
19
17
 
20
18
  h2. Forum
21
19
 
22
20
  "http://groups.google.com/group/gorank":http://groups.google.com/group/gorank
23
21
 
24
- TODO - create Google Group - gorank
25
-
26
22
  h2. How to submit patches
27
23
 
28
24
  Read the "8 steps for fixing other people's code":http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/ and for section "8b: Submit patch to Google Groups":http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/#8b-google-groups, use the Google Group above.
@@ -37,7 +37,7 @@
37
37
  </div>
38
38
  <%= body %>
39
39
  <p class="coda">
40
- <a href="mailto:drnicwilliams@gmail.com">Dr Nic</a>, <%= modified.pretty %><br>
40
+ <a href="mailto:thopre@gmail.com">Thomas Preymesser</a>, <%= modified.pretty %><br>
41
41
  Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
42
42
  </p>
43
43
  </div>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: go-rank
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas Preymesser
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-12-30 00:00:00 +01:00
12
+ date: 2008-12-31 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency