runby_pace 0.4.82 → 0.4.83
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/runby_time.rb +4 -14
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YWU4NjlkZGFkZWI4N2Q5YzRkYzQwNjE4YWEzM2Q5N2VkMjUzZTc0MQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
M2QzNzY2OTVhODYzNDMxNzFlN2M1ZDI2OWQxYjcxOWE1MjYyYThkNQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MmVhOWVlYWY0OGM0MmY1MmVhZjdjNDc3Njg4MDBmMDVhMmY3YTFkMjQ5MGM0
|
10
|
+
NmMzNzM4OGU3ZmI3NzYxYThmZTk4N2U0MDE0YmZjOTRiODAxNGMyNzIwOWJm
|
11
|
+
NWMzNzA4YjY2NDE5YzQzNDAzNzU2YmY5MmI2M2U1MTQ3MmY5ZDg=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZGEyMjk4MWViZTYyNjhmM2QxZTlmNzQ1NmZlYmYxNmIwMWVmZjQ5ZWI5OWE5
|
14
|
+
ZTJjYTVmMmRlZGEyODkzYTJmNDRlNzBmNGQ5M2ZkNjVkMDQzMDNmNzQ5YjU5
|
15
|
+
ZWY5MzY5ZDVkMTg2NjZlNWVhN2RjNjk1YjY0NmVmY2VkNjk5NWU=
|
@@ -27,12 +27,6 @@ module Runby
|
|
27
27
|
|
28
28
|
def self.parse(str)
|
29
29
|
time = str.to_s.strip.chomp
|
30
|
-
is_negative = false
|
31
|
-
|
32
|
-
if time[0] == '-'
|
33
|
-
is_negative = true
|
34
|
-
time = time[1..-1]
|
35
|
-
end
|
36
30
|
|
37
31
|
if time.match(/^\d?\d:\d\d$/)
|
38
32
|
parts = time.split(':')
|
@@ -41,8 +35,8 @@ module Runby
|
|
41
35
|
elsif time.match(/^\d+$/)
|
42
36
|
minutes_part = time.to_i
|
43
37
|
seconds_part = 0
|
44
|
-
elsif time.match(/^\d+[
|
45
|
-
parts = time.split(/[
|
38
|
+
elsif time.match(/^\d+[,. ]\d+$/)
|
39
|
+
parts = time.split(/[,. ]/)
|
46
40
|
minutes_part = parts[0].to_i
|
47
41
|
seconds_part = (parts[1].to_i / 10.0 * 60).to_i
|
48
42
|
else
|
@@ -51,10 +45,6 @@ module Runby
|
|
51
45
|
|
52
46
|
raise 'Minutes must be less than 100' if minutes_part > 99
|
53
47
|
raise 'Seconds must be less than 60' if seconds_part > 59
|
54
|
-
if is_negative
|
55
|
-
minutes_part *= -1
|
56
|
-
seconds_part *= -1
|
57
|
-
end
|
58
48
|
time_formatted = "#{minutes_part.to_s.rjust(2, '0')}:#{seconds_part.to_s.rjust(2, '0')}"
|
59
49
|
|
60
50
|
RunbyTime.new(time_s: time_formatted, minutes_part: minutes_part, seconds_part: seconds_part)
|
@@ -70,8 +60,8 @@ module Runby
|
|
70
60
|
|
71
61
|
# Break out these sanity checks into their own class if we add any more.
|
72
62
|
if !time.nil? && is_five_k
|
73
|
-
|
74
|
-
|
63
|
+
warning_message = '5K times of less than 14:00 are unlikely' if time.minutes_part < 14
|
64
|
+
warning_message = '5K times of greater than 42:00 are not fully supported' if time.total_seconds > (42 * 60)
|
75
65
|
end
|
76
66
|
|
77
67
|
{ time: time, error: error_message, warning: warning_message }
|
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.4.
|
4
|
+
version: 0.4.83
|
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-09-
|
11
|
+
date: 2016-09-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -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: a445dba05448c2c68a58d5dc2a1b086be9fbb6bf
|
103
103
|
post_install_message:
|
104
104
|
rdoc_options: []
|
105
105
|
require_paths:
|