runby_pace 0.2.64 → 0.2.65

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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YjM4NWQzNmIyNjcyYzdmZGI0N2ExNDViOTRlNGYyMDg2YmUzMGI2Yg==
4
+ ZjlmYzI4YmQxZTg1YTAxM2MyOWQ4YTgxMTI2OGU3YzUyZTE3NzI1OA==
5
5
  data.tar.gz: !binary |-
6
- MDlkYTA1ZjUyNzhjYWI5OWNjYjQ4NGEyMmEyZTBlYmE2ZjkwZjA3MQ==
6
+ NWE2ZmVhY2Y1ZGIzNGYwYzY3NWM4NGMwM2ZmNWNjOTNlNDhlODE1ZQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YTg2OTJhOWMwNTNmNDcxNjBmNWRlOTVhNGM4MmMxZGVjODkwN2NmNWQ4NWRh
10
- MDkzOTljYThkYjIzOWU3MzBkYmE3ZDcxMDRkM2NmYTgzYjBlOGNiNTAzMzM2
11
- ZmUzMjIyYzFkODhlYmU5M2VkYjNkNjI5Mzk5MDNiNThlZjJlMzU=
9
+ MzkxZmFiNWFlMTY5ZmQ1Y2QxMDI2NmIwMTg4NDUxMTcwMzM4ZDhjNDM1NGMw
10
+ YmJlNzcwOTZkMzI4YTE3Mjc5YzlmYzYwOGQ5NDg5MjMyZDE5Zjg2YWU2NGVl
11
+ MzM1ZTFhNDk1ZGUwOWNiNzIxMmExMDcyMmMxNWFmNWNmMDhlNjk=
12
12
  data.tar.gz: !binary |-
13
- NDkwZDgwZTM3MTdiMDVkZjc4YjI3NWRkNWFhNjQyNzJjMWI4Yzc5MTAxY2Yw
14
- MTQxNDVhODhiZjhlZjkwN2NiNTkyZGE5YmNlMmNlOGNlMWI5YTEyYzc2ZTE5
15
- ZDlhN2YxZDJkYzc4ZGQ4Mzc0Mjc2OGIzOGYwYmVlOTEwNDJjMGE=
13
+ MDFhOGIxNWUwZTIxOGI2MmM2OTgxN2Q0MTA3MzE1Njg4OGExMTExM2U3ZDU2
14
+ MDA5MzY4MDVkZWVkZTU3NWY5MDQ4OTBhZWY1YzUyMzY1ZWFjMzg5YTc0NDdh
15
+ ZDgwYzg0Nzc1Nzc3Nzk4NTFiMDZjY2ZhNDcyODk3MzRlZTk1ZmE=
@@ -1,19 +1,11 @@
1
- module RunbyPace
1
+ require_relative 'runby_range'
2
2
 
3
- class PaceRange
4
- attr_reader :fast, :slow
3
+ module RunbyPace
5
4
 
5
+ class PaceRange < RunbyRange
6
6
  def initialize(fast, slow)
7
7
  @fast = RunbyPace::PaceTime.new(fast)
8
8
  @slow = RunbyPace::PaceTime.new(slow)
9
9
  end
10
-
11
- def to_s
12
- if @fast == @slow
13
- "#{@fast}"
14
- else
15
- "#{@fast}-#{@slow}"
16
- end
17
- end
18
10
  end
19
11
  end
@@ -0,0 +1,21 @@
1
+ module RunbyPace
2
+
3
+ class RunbyRange
4
+ attr_reader :fast, :slow
5
+
6
+ def initialize
7
+ @fast = nil
8
+ @slow = nil
9
+ raise 'RunbyRange is a base class for PaceRange and SpeedRange. Instantiate one of them instead.'
10
+ end
11
+
12
+ def to_s
13
+ if @fast == @slow
14
+ "#{@fast}"
15
+ else
16
+ "#{@fast}-#{@slow}"
17
+ end
18
+ end
19
+ end
20
+
21
+ end
@@ -0,0 +1,12 @@
1
+ require_relative 'runby_range'
2
+
3
+ module RunbyPace
4
+
5
+ class SpeedRange < RunbyRange
6
+ def initialize(fast, slow)
7
+ raise 'Invalid speed values' unless fast.is_a?(Numeric) && slow.is_a?(Numeric)
8
+ @fast = fast.round(2)
9
+ @slow = slow.round(2)
10
+ end
11
+ end
12
+ 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.64
4
+ version: 0.2.65
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-14 00:00:00.000000000 Z
11
+ date: 2016-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -87,6 +87,8 @@ files:
87
87
  - lib/runby_pace/run_types/long_run.rb
88
88
  - lib/runby_pace/run_types/slow_tempo_run.rb
89
89
  - lib/runby_pace/run_types/tempo_run.rb
90
+ - lib/runby_pace/runby_range.rb
91
+ - lib/runby_pace/speed_range.rb
90
92
  - lib/runby_pace/version.rb
91
93
  - misc/rubymine.png
92
94
  - runby_pace.gemspec
@@ -94,7 +96,7 @@ homepage: https://github.com/tygerbytes/runby-pace
94
96
  licenses:
95
97
  - MIT
96
98
  metadata:
97
- commit-hash: 71d892c815dfdbd1b9b4c3d759d7e442a44c2059
99
+ commit-hash: 447be274ca262867469d7e89a16d3fbbd498f05e
98
100
  post_install_message:
99
101
  rdoc_options: []
100
102
  require_paths: