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.
Files changed (3) hide show
  1. checksums.yaml +8 -8
  2. data/lib/runby_pace/runby_time.rb +4 -14
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- Yjk0NTE4MDcyMmQ5ZmRkNWNmZWI1YmNlZDAwNTA4OWJhMTc2NzU4Ng==
4
+ YWU4NjlkZGFkZWI4N2Q5YzRkYzQwNjE4YWEzM2Q5N2VkMjUzZTc0MQ==
5
5
  data.tar.gz: !binary |-
6
- OWMwOTgyMTExMGFmYzQ3ZjU0ODUwNjVlYmNjNjM0MTM0MDZkZmQxYQ==
6
+ M2QzNzY2OTVhODYzNDMxNzFlN2M1ZDI2OWQxYjcxOWE1MjYyYThkNQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YjczYWIxNTRkNmY2MTZmYzMyN2FhMTk2Mzg4Mjc1NWE1ZmY5ZjYzZDU1NWU1
10
- ODU0ZjM1MGM5NjA5Y2FkOWJmOGRmMDM5M2YwYzk3NTczN2E0NDRhODY2NDUz
11
- NWQwYzFmMWQ2ZTBlZjA3ZDc5ODE2ZDkxNGE5MjQyMDNjNGQxMDI=
9
+ MmVhOWVlYWY0OGM0MmY1MmVhZjdjNDc3Njg4MDBmMDVhMmY3YTFkMjQ5MGM0
10
+ NmMzNzM4OGU3ZmI3NzYxYThmZTk4N2U0MDE0YmZjOTRiODAxNGMyNzIwOWJm
11
+ NWMzNzA4YjY2NDE5YzQzNDAzNzU2YmY5MmI2M2U1MTQ3MmY5ZDg=
12
12
  data.tar.gz: !binary |-
13
- NzdhNTJkMjU3MTI2ZDI4ZDcwZjkwMGQ3MGJiODY4NmFhMzM0MTQ5ZmJmOTM0
14
- ZDZjZWU1NjMwMTRlOTdmZWNmNjEzMDMyNGQyOWEwZmEyNDcwODk2ZmYzZmJk
15
- MTBjODZiZWUwNWJjYjZkNGYxZGRhZTBmMTUwY2U3MGI0NThiNGI=
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+[,\. ]\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
- if time.minutes_part < 14 then warning_message = '5K times of less than 14:00 are unlikely' end
74
- if time.total_seconds > (42 * 60) then warning_message = '5K times of greater than 42:00 are not fully supported' end
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.82
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-03 00:00:00.000000000 Z
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: 3b73ac13865afa0ba9cc33a5e3f5c55593a0e282
102
+ commit-hash: a445dba05448c2c68a58d5dc2a1b086be9fbb6bf
103
103
  post_install_message:
104
104
  rdoc_options: []
105
105
  require_paths: