triathlon 0.0.5 → 0.0.6
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/lib/splits.rb +5 -1
- data/lib/triathlon.rb +1 -1
- data/test/unit/test_splits.rb +5 -0
- metadata +4 -4
data/lib/splits.rb
CHANGED
@@ -12,7 +12,11 @@ class SplitPresenter
|
|
12
12
|
|
13
13
|
minutes = (@total_seconds / 60.0).truncate
|
14
14
|
seconds = (@total_seconds - (minutes * 60.0)).round
|
15
|
-
|
15
|
+
seconds_string = seconds.to_s
|
16
|
+
if seconds < 10
|
17
|
+
seconds_string = "0#{seconds_string}"
|
18
|
+
end
|
19
|
+
return "#{minutes}:#{seconds_string}"
|
16
20
|
end
|
17
21
|
|
18
22
|
end
|
data/lib/triathlon.rb
CHANGED
data/test/unit/test_splits.rb
CHANGED
@@ -30,4 +30,9 @@ class TestSplits < Test::Unit::TestCase
|
|
30
30
|
splits = Splits.new("7:15")
|
31
31
|
assert_equal splits.pace.to_s, "7:15"
|
32
32
|
end
|
33
|
+
|
34
|
+
should 'present time with seconds less than ten correctly' do
|
35
|
+
splits = Splits.new("6:16")
|
36
|
+
assert_equal splits.get_eight_hundred.to_s, "3:08"
|
37
|
+
end
|
33
38
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: triathlon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 6
|
10
|
+
version: 0.0.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Waylon Calabrese
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-08-
|
18
|
+
date: 2010-08-31 00:00:00 -05:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|