concept2-data-parser 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/concept2/data/parser.rb +9 -4
- data/lib/concept2/data/parser/version.rb +2 -1
- data/test/concept2_data_parser_test.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a29779059a390831997f8bf586fb6f006b18321b
|
4
|
+
data.tar.gz: 363f5ffc5f8c110ef061836206ed7c14eab0923e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d740829466bb91eb29da27bd65a463e175f77be432720906a6fabadb83244e2814631a105bcb66dd780405cb8ba5ea6ccb6c37f255dae82007d0230e35058f7b
|
7
|
+
data.tar.gz: 3873ec8c7b5680b59f0dd348ab35ab2e3220dc1156cc934a773f69d24cf98d436899e356530744dcf121cc2d3611798aec4c80f891cebf4b15fd5498c0161e1f
|
data/README.md
CHANGED
data/lib/concept2/data/parser.rb
CHANGED
@@ -58,8 +58,8 @@ module Concept2
|
|
58
58
|
|
59
59
|
def compile_totals!
|
60
60
|
@rowers.each do |rower|
|
61
|
-
rower[:overall_time] = ChronicDuration.output(
|
62
|
-
rower[:data].last[0].round(1), format: :chrono)
|
61
|
+
rower[:overall_time] = normalize_duration(ChronicDuration.output(
|
62
|
+
rower[:data].last[0].round(1), format: :chrono))
|
63
63
|
rower[:overall_stroke_rate] = average_stroke_rate(
|
64
64
|
rower[:data].map {|n| n[2] })
|
65
65
|
rower[:overall_split] = split_time(rower[:data].last[0], 6000.0)
|
@@ -96,10 +96,15 @@ module Concept2
|
|
96
96
|
end
|
97
97
|
|
98
98
|
def split_time(secs, distance=500.0)
|
99
|
-
ChronicDuration.output(
|
100
|
-
((secs * 500.0) / distance).round(1), format: :chrono)
|
99
|
+
normalize_duration(ChronicDuration.output(
|
100
|
+
((secs * 500.0) / distance).round(1), format: :chrono))
|
101
101
|
end
|
102
102
|
|
103
|
+
# Adds a decimal place so that spreadsheets distinguish hours/minutes
|
104
|
+
def normalize_duration(duration)
|
105
|
+
duration = "#{duration}.0" unless duration =~ /\..+$/
|
106
|
+
duration
|
107
|
+
end
|
103
108
|
|
104
109
|
end
|
105
110
|
end
|
@@ -27,7 +27,7 @@ class Concept2DataParserTest < Minitest::Test
|
|
27
27
|
end
|
28
28
|
|
29
29
|
it "compiles the overall time" do
|
30
|
-
assert_equal ["26:17.5", "26:15", "27:00.9", "25:52"],
|
30
|
+
assert_equal ["26:17.5", "26:15.0", "27:00.9", "25:52.0"],
|
31
31
|
@parser.rowers.map {|r| r[:overall_time] }
|
32
32
|
end
|
33
33
|
|
@@ -47,7 +47,7 @@ class Concept2DataParserTest < Minitest::Test
|
|
47
47
|
end
|
48
48
|
|
49
49
|
it "compiles 500m splits" do
|
50
|
-
assert_equal ["2:03.5", "2:12.5", "2:14", "2:15", "2:15", "2:14.5", "2:13", "2:14", "2:10", "2:10.4", "2:10.5", "2:04.6"],
|
50
|
+
assert_equal ["2:03.5", "2:12.5", "2:14.0", "2:15.0", "2:15.0", "2:14.5", "2:13.0", "2:14.0", "2:10.0", "2:10.4", "2:10.5", "2:04.6"],
|
51
51
|
@parser.rowers[0][:splits]
|
52
52
|
end
|
53
53
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: concept2-data-parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henry Poydar
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chronic_duration
|