opensprints-core 0.6.1 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.1
1
+ 0.6.2
@@ -8,6 +8,10 @@ class RaceParticipation < Sequel::Model
8
8
 
9
9
  attr_accessor :ticks
10
10
 
11
+ def finished?
12
+ !!finish_time
13
+ end
14
+
11
15
  def percent_complete
12
16
  [1.0, self.distance / $RACE_DISTANCE].min
13
17
  end
@@ -18,6 +18,12 @@ describe 'A race participation' do
18
18
  @r.distance.should==(21.0)
19
19
  end
20
20
 
21
+ it "is finished if it has a finish_time" do
22
+ @r.finished?.should==false
23
+ @r.finish_time = 1
24
+ @r.finished?.should==true
25
+ end
26
+
21
27
  describe 'percent complete' do
22
28
  it 'should be the ratio of race distance to distance' do
23
29
  $RACE_DISTANCE = 84.0
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 6
8
- - 1
9
- version: 0.6.1
8
+ - 2
9
+ version: 0.6.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Evan Farrar
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-09-06 00:00:00 -05:00
17
+ date: 2010-09-22 00:00:00 -05:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency