runby_pace 0.2.73 → 0.2.74

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/run_math.rb +12 -0
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NzRhMDJiMDg2YzY0YjdjMTQ4OGFhOTlmMDNmMzA2ODgyM2I2Zjk0Ng==
4
+ ZjNjNTQxNzczYzcyZmM5MWJiNDk4ZTFkMzAyZDVhNzVhOGYzOWVhMg==
5
5
  data.tar.gz: !binary |-
6
- NzAyNmRmMmE3MTcxY2QyYTEzMTRkZDc3OTBmOTFiNTBiYmUzOGQyMw==
6
+ YzVmOWZhZjJiZmRjODU3NjJmMmFhNTUxZTliNGNmNGJhNWJiMDE0Ng==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NDhiMWQ5ODE4ZGI4Nzg2ZDVhOTM4MjhiNTU1ZjU0NzVjYTc0ZGNkZjVlMmRj
10
- ODRhMWJhMGYyY2RmNjY1MTEzNTIxYjM2NWY4NTlkZmVlOTcxMDczNDM4MTg5
11
- ZjlhNTZhMmQxYzJiZmY5NDFhYjk3ZjVkNTI4NmI3OGIxOTgzZTM=
9
+ MjI2ZjNmYWRjNzFiODI3YzAxZmE2YjAzODQwM2QxYTAzZmVkOTZkZDUyMjc2
10
+ MmUxNjgwMzAwMTJhMDlhMzExZDUwZjZmNGI4YWFlOWE2MjdhNWYwNmExOTU5
11
+ ODUzODQ1MTU2MTc1MjQyOGYxYTMyZmRkN2UxM2JhZDc4ODZhM2U=
12
12
  data.tar.gz: !binary |-
13
- MDEwNzQ2NWU0MWZiYTk5MGFjNzJhNzJlZThiNGI5ZDRjMjlmODc1ZDE5NDdh
14
- YTAzZmZkOGFlYzJmZjI1ZTA0YTY2NjJkMjhiYzQ0ZjYyMGI3MmRjYTI0NzMz
15
- ODgyNTU1YTQyZjBjNTkyNjE2ODE5MGNlMjdkZTZiYmUwNDBkYTE=
13
+ MmVkODlmOWRjZDA0ZWUxMmY5Mzg5ZjY5NzcyNzdkYjQxMzEzZjlkNjgwYWQy
14
+ NjdjOGRlNTcwYmIyOGRjZDE0YzQyYWM0ODMwMjg0OTYwMWQ0OTkzOThlMzE3
15
+ MjZkYjljY2ZjYjM0NTFmNDZjZDBkYmFkMzY4N2QyZGY0Zjg2MzQ=
@@ -10,5 +10,17 @@ module RunbyPace
10
10
  raise 'units_per_hour must be numeric' unless units_per_hour.is_a? Numeric
11
11
  RunbyPace::PaceTime.from_minutes(60.0 / units_per_hour)
12
12
  end
13
+
14
+ def self.distance_traveled(pace, time)
15
+ # TODO: I sense the need for a refactor...
16
+ # Consider extracting a new Pace class, which consists of Time + Units
17
+ # Then move this method to the new class, and give it a better name.
18
+ pace = RunbyPace::PaceTime.new(pace)
19
+ time = RunbyPace::PaceTime.new(time)
20
+
21
+ divisor = pace.total_minutes / time.total_minutes
22
+ distance_units_traveled = 1 / divisor
23
+ return distance_units_traveled
24
+ end
13
25
  end
14
26
  end
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.73
4
+ version: 0.2.74
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-08-11 00:00:00.000000000 Z
11
+ date: 2016-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -97,7 +97,7 @@ homepage: https://github.com/tygerbytes/runby-pace
97
97
  licenses:
98
98
  - MIT
99
99
  metadata:
100
- commit-hash: e0969155c9dce3802aaba44d908aa7e3efda7d17
100
+ commit-hash: 2f95dbd6e8780b0f141fbad54968f291a2f087c9
101
101
  post_install_message:
102
102
  rdoc_options: []
103
103
  require_paths: