runby_pace 0.6.91 → 0.6.94
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.
- checksums.yaml +8 -8
- data/lib/runby_pace/{pace_data.rb → pace_calculator.rb} +1 -1
- data/lib/runby_pace/run_type.rb +1 -1
- data/lib/runby_pace/run_types/distance_run.rb +6 -6
- data/lib/runby_pace/run_types/easy_run.rb +6 -6
- data/lib/runby_pace/run_types/fast_tempo_run.rb +2 -2
- data/lib/runby_pace/run_types/find_divisor.rb +3 -3
- data/lib/runby_pace/run_types/long_run.rb +6 -6
- data/lib/runby_pace/run_types/slow_tempo_run.rb +2 -2
- data/lib/runby_pace/run_types/tempo_run.rb +6 -6
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZmNhZWE5YjE0YmI5MzQxZGUxNDBjZjk0MWRiNzRkYmViYTY1ZTJkMg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YmUzY2JjOWQ4YWRlZTlhYWRiMjZiMDU0YTFjNDVmNWExYmQwOTE5MQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YWY1NTBhOGU1M2FiOTA0ZTliM2E5YjUwM2MxZWQwNjgzMGNmYjBjNWM5YzIw
|
10
|
+
Mjc3NTFiOGM3YzVjYzMzOTg5NmZjNjZmODUxYzIwYWU1NmZkYTkxYTcyNGU1
|
11
|
+
NWVjMzg3NGZjNGJmMGMxMzMxYjlkYzYwMWRhNjkwZWYxMzVkM2Q=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MDQ4ZmYwYTU2ZTI3ZGE3YzkxZjlhZGIwNjY5ZGRjNDU4M2FmMWVhNzFhYmI4
|
14
|
+
YTA0ZTc0ODYwZTBhMDFiMWY0ZjkwZjI1Y2IzMmE3Mzg4NmMxZTU3M2Q4ZDBk
|
15
|
+
ZjQ3ZTE0NGNiODM4ZDlhM2VkMTIxYmY0NTg2ZjNkZDgzNzA0Y2U=
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Runby
|
2
2
|
# Encapsulates the algorithms used to calculate target paces.
|
3
|
-
class
|
3
|
+
class PaceCalculator
|
4
4
|
# The number of data points plotted on our line of 5K times.
|
5
5
|
# We take 5K times from 14:00 to 42:00 with a sample rate
|
6
6
|
# of 30 seconds, and out pops 57.
|
data/lib/runby_pace/run_type.rb
CHANGED
@@ -3,20 +3,20 @@ module Runby
|
|
3
3
|
# Defines the venerable "distance run", the backbone of any distance running program.
|
4
4
|
# Most of your runs should be at this pace. Harder than an "easy run" but still conversational.
|
5
5
|
class DistanceRun < RunType
|
6
|
-
attr_reader :
|
6
|
+
attr_reader :slow_pace_calculator, :fast_pace_calculator
|
7
7
|
|
8
8
|
def description
|
9
9
|
'Distance Run'
|
10
10
|
end
|
11
11
|
|
12
12
|
def initialize
|
13
|
-
@
|
14
|
-
@
|
13
|
+
@fast_pace_calculator = PaceCalculator.new(GoldenPaces.fast[:'14:00'], GoldenPaces.fast[:'42:00'], 3.675)
|
14
|
+
@slow_pace_calculator = PaceCalculator.new(GoldenPaces.slow[:'14:00'], GoldenPaces.slow[:'42:00'], 2.175)
|
15
15
|
end
|
16
16
|
|
17
|
-
def
|
18
|
-
fast = @
|
19
|
-
slow = @
|
17
|
+
def lookup_pace(five_k_time, distance_units = :km)
|
18
|
+
fast = @fast_pace_calculator.calc(five_k_time, distance_units)
|
19
|
+
slow = @slow_pace_calculator.calc(five_k_time, distance_units)
|
20
20
|
PaceRange.new(fast, slow)
|
21
21
|
end
|
22
22
|
|
@@ -2,20 +2,20 @@ module Runby
|
|
2
2
|
module RunTypes
|
3
3
|
# An easy run is basically a jog. It should be conversational.
|
4
4
|
class EasyRun < RunType
|
5
|
-
attr_reader :
|
5
|
+
attr_reader :slow_pace_calculator, :fast_pace_calculator
|
6
6
|
|
7
7
|
def description
|
8
8
|
'Easy Run'
|
9
9
|
end
|
10
10
|
|
11
11
|
def initialize
|
12
|
-
@
|
13
|
-
@
|
12
|
+
@fast_pace_calculator = PaceCalculator.new(GoldenPaces.fast[:'14:00'], GoldenPaces.fast[:'42:00'], 1.99)
|
13
|
+
@slow_pace_calculator = PaceCalculator.new(GoldenPaces.slow[:'14:00'], GoldenPaces.slow[:'42:00'], 1.35)
|
14
14
|
end
|
15
15
|
|
16
|
-
def
|
17
|
-
fast = @
|
18
|
-
slow = @
|
16
|
+
def lookup_pace(five_k_time, distance_units = :km)
|
17
|
+
fast = @fast_pace_calculator.calc(five_k_time, distance_units)
|
18
|
+
slow = @slow_pace_calculator.calc(five_k_time, distance_units)
|
19
19
|
PaceRange.new(fast, slow)
|
20
20
|
end
|
21
21
|
|
@@ -9,8 +9,8 @@ module Runby
|
|
9
9
|
'Fast Tempo Run'
|
10
10
|
end
|
11
11
|
|
12
|
-
def
|
13
|
-
fast = @
|
12
|
+
def lookup_pace(five_k_time, distance_units = :km)
|
13
|
+
fast = @fast_pace_calculator.calc(five_k_time, distance_units)
|
14
14
|
PaceRange.new(fast, fast)
|
15
15
|
end
|
16
16
|
end
|
@@ -3,8 +3,8 @@ module Runby
|
|
3
3
|
module RunTypes
|
4
4
|
# Currently, to find the radius of the curve in the pace table data for a given run time,
|
5
5
|
# we start with a radius equal to that of the midpoint of the X axis for the data when
|
6
|
-
# plotted on a graph. Then we use a radius divisor for the
|
7
|
-
# dial in the height of the curve. (See Runby::
|
6
|
+
# plotted on a graph. Then we use a radius divisor for the PaceCalculator for each run type to
|
7
|
+
# dial in the height of the curve. (See Runby::PaceCalculator)
|
8
8
|
# This method, #find_divisor, accepts a hash of "golden paces" for a run type along with
|
9
9
|
# the number of seconds of allowable deviation from the golden pace. Then it proceeds
|
10
10
|
# to brute force the divisor.
|
@@ -21,7 +21,7 @@ module Runby
|
|
21
21
|
|
22
22
|
golden_paces.each do |five_k, golden_pace|
|
23
23
|
five_k_time = Runby::RunbyTime.new(five_k.to_s)
|
24
|
-
pace_data = Runby::
|
24
|
+
pace_data = Runby::PaceCalculator.new(first_pace, last_pace, candidate_divisor)
|
25
25
|
calculated_pace = pace_data.calc(five_k_time)
|
26
26
|
unless calculated_pace.time.almost_equals?(golden_pace, allowable_deviation)
|
27
27
|
viable_divisor = nil
|
@@ -3,20 +3,20 @@ module Runby
|
|
3
3
|
# Arguably one of the most important run types, the "long run" is harder than an "easy run", but easier than
|
4
4
|
# a "distance run". It should remain conversational.
|
5
5
|
class LongRun < RunType
|
6
|
-
attr_reader :
|
6
|
+
attr_reader :slow_pace_calculator, :fast_pace_calculator
|
7
7
|
|
8
8
|
def description
|
9
9
|
'Long Run'
|
10
10
|
end
|
11
11
|
|
12
12
|
def initialize
|
13
|
-
@
|
14
|
-
@
|
13
|
+
@fast_pace_calculator = PaceCalculator.new(GoldenPaces.fast[:'14:00'], GoldenPaces.fast[:'42:00'], 2.125)
|
14
|
+
@slow_pace_calculator = PaceCalculator.new(GoldenPaces.slow[:'14:00'], GoldenPaces.slow[:'42:00'], 1.55)
|
15
15
|
end
|
16
16
|
|
17
|
-
def
|
18
|
-
fast = @
|
19
|
-
slow = @
|
17
|
+
def lookup_pace(five_k_time, distance_units = :km)
|
18
|
+
fast = @fast_pace_calculator.calc(five_k_time, distance_units)
|
19
|
+
slow = @slow_pace_calculator.calc(five_k_time, distance_units)
|
20
20
|
PaceRange.new(fast, slow)
|
21
21
|
end
|
22
22
|
|
@@ -8,8 +8,8 @@ module Runby
|
|
8
8
|
'Slow Tempo Run'
|
9
9
|
end
|
10
10
|
|
11
|
-
def
|
12
|
-
slow = @
|
11
|
+
def lookup_pace(five_k_time, distance_units = :km)
|
12
|
+
slow = @slow_pace_calculator.calc(five_k_time, distance_units)
|
13
13
|
PaceRange.new(slow, slow)
|
14
14
|
end
|
15
15
|
end
|
@@ -2,20 +2,20 @@ module Runby
|
|
2
2
|
module RunTypes
|
3
3
|
# Combines the fast and slow tempo runs into one convenient range of paces
|
4
4
|
class TempoRun < RunType
|
5
|
-
attr_reader :
|
5
|
+
attr_reader :slow_pace_calculator, :fast_pace_calculator
|
6
6
|
|
7
7
|
def description
|
8
8
|
'Tempo Run'
|
9
9
|
end
|
10
10
|
|
11
11
|
def initialize
|
12
|
-
@
|
13
|
-
@
|
12
|
+
@fast_pace_calculator = PaceCalculator.new(GoldenPaces.fast[:'14:00'], GoldenPaces.fast[:'42:00'], 4.025)
|
13
|
+
@slow_pace_calculator = PaceCalculator.new(GoldenPaces.slow[:'14:00'], GoldenPaces.slow[:'42:00'], 3.725)
|
14
14
|
end
|
15
15
|
|
16
|
-
def
|
17
|
-
fast = @
|
18
|
-
slow = @
|
16
|
+
def lookup_pace(five_k_time, distance_units = :km)
|
17
|
+
fast = @fast_pace_calculator.calc(five_k_time, distance_units)
|
18
|
+
slow = @slow_pace_calculator.calc(five_k_time, distance_units)
|
19
19
|
PaceRange.new(fast, slow)
|
20
20
|
end
|
21
21
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: runby_pace
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.94
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ty Walls
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -76,7 +76,7 @@ files:
|
|
76
76
|
- lib/runby_pace/distance.rb
|
77
77
|
- lib/runby_pace/distance_unit.rb
|
78
78
|
- lib/runby_pace/pace.rb
|
79
|
-
- lib/runby_pace/
|
79
|
+
- lib/runby_pace/pace_calculator.rb
|
80
80
|
- lib/runby_pace/pace_range.rb
|
81
81
|
- lib/runby_pace/run_math.rb
|
82
82
|
- lib/runby_pace/run_type.rb
|
@@ -99,7 +99,7 @@ homepage: https://github.com/tygerbytes/runby-pace
|
|
99
99
|
licenses:
|
100
100
|
- MIT
|
101
101
|
metadata:
|
102
|
-
commit-hash:
|
102
|
+
commit-hash: 4801763d3e46a9ae2f309aa80b8c1d9d7a074e15
|
103
103
|
post_install_message:
|
104
104
|
rdoc_options: []
|
105
105
|
require_paths:
|