runby_pace 0.2.67 → 0.2.68

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/pace_time.rb +9 -3
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MWFhOWIxZjc3NGZlZDE0NGUyZTUyNTFjYmYwZDA5ZmE3Y2I4OGUyMw==
4
+ MmI2OGI5NzcwY2E4NThkYjhjZWI3YzZiODQyYjcxOWI0NzBkMzdhOQ==
5
5
  data.tar.gz: !binary |-
6
- YTk2NTNmMGMzNzYxMjUzODQ5ZjQ0OGViNTFiNzdmYWRmZWQxMTk1ZQ==
6
+ NzliNTc0MWU3NGUwNzE3ZGEyZWQ5ZWY1OGJjYjVhN2YyMzhmY2UwNg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MzMwNGI4NzU3ZmRmYjRkZjA2YjkwMWNjYmM1ZDcwOWJjOGRiNmU2OGFhOTMw
10
- ZmFlN2ExYzhmMzUxZGIwMTMzODQ1MjIwYmJhZGNkZmI4ODc1NTFlMDBhMDY3
11
- MThhMmNhNTQzN2Q3Mzc1Zjg3MGUxMmY0YTUwODI4ODg3Y2YwYjI=
9
+ YTJhNjIwNTIwMmI3OTI0MzYwNTQxZDc5NTQzOGU3MDU5NDU0NmM2ODdmNWRh
10
+ OTBmNjYyOWMxZDYxNzM2MmMxNzU3MGNkOTMxMDA2NThiOWNiMTdlM2E4NGE4
11
+ NmJkMGVjMTEzMDZlMTM4MzBlODA3MmI3YjkwOTgzOTljMzVjZjE=
12
12
  data.tar.gz: !binary |-
13
- YmEyZjJkNDA1ZjExMTA4NWYzZDcwYWIwMGEzZWRjMmNiZWRlODBiMTUyOTNl
14
- MDhjZDVlZDJkMDY4YWU4YzIzZTNjZmEzM2VjNGY3OWMwYThhNTNlZjI1YmQz
15
- OGQzZmJkZTAwM2JhOGY4MTU2ZWUyNDc1NmU1NTIwMmE4MWJiNGI=
13
+ MzlmNzI1MzdjMTE1MmFkNTQxMzBlMjFjZDlkYWRiYjJlMWJlYTJjYTMzMDFk
14
+ NDI4ZmIxMzZjMWM4YzFjMjQ2MjViYzdkM2Y2NDE3MmM1MWRhZGQ3MTU0NDlm
15
+ YmU1NTFmZDg4ZDJiMjA4NTVlNjk0NjJkMzg4YjkzMGE2OTFmZmY=
@@ -60,15 +60,21 @@ module RunbyPace
60
60
  PaceTime.new({ :time_s => time_formatted, :minutes_part => minutes_part, :seconds_part => seconds_part })
61
61
  end
62
62
 
63
- def self.try_parse(str)
64
- time, error_message = nil
63
+ def self.try_parse(str, is_five_k = false)
64
+ time, error_message, warning_message = nil
65
65
  begin
66
66
  time = self.parse str
67
67
  rescue Exception => ex
68
68
  error_message = "#{ex.message} (#{str})"
69
69
  end
70
70
 
71
- return { :time => time, :error_message => error_message}
71
+ # Break out these sanity checks into their own class if we add any more.
72
+ 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
75
+ end
76
+
77
+ { time: time, error: error_message, warning: warning_message }
72
78
  end
73
79
 
74
80
  def to_s
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.2.67
4
+ version: 0.2.68
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-07-19 00:00:00.000000000 Z
11
+ date: 2016-07-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -96,7 +96,7 @@ homepage: https://github.com/tygerbytes/runby-pace
96
96
  licenses:
97
97
  - MIT
98
98
  metadata:
99
- commit-hash: 03aab75e562677d45c86a0d10ba2dd99b0e9d489
99
+ commit-hash: 717d8b66fcc5e17b4d91373ca3dd34ca0c980da1
100
100
  post_install_message:
101
101
  rdoc_options: []
102
102
  require_paths: