pitchcar 0.7.0 → 0.7.1
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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/track.rb +2 -1
- data/pitchcar.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c90f21df4d98ee1bffd05769a126c46b1ed309f
|
4
|
+
data.tar.gz: 4bfa23d66ea7d036ffc0bb3437b56e719e2c28ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7570e40a5cc00c1f9aa2c8a2bf3d2565c4ec9879c6de4560a9005dfa67c0970e333bc90cce7b86c5059930adca21adc6d2f5f06a26dc1f1f730933c9d7b139e7
|
7
|
+
data.tar.gz: 17ee9a3c803a1ce3b3681e823ab1878ffc1773d6705961c1dd9741eb62343a102c1b1f0e0f792fd55d1d1b5cb9996575450eafaf14a86cf73f6f6083f5d6d96b
|
data/Gemfile.lock
CHANGED
data/lib/track.rb
CHANGED
@@ -90,10 +90,11 @@ module Pitchcar
|
|
90
90
|
end
|
91
91
|
|
92
92
|
def assign_start_piece
|
93
|
+
return self if pieces.any? { |piece| piece.instance_of? Pieces::Start }
|
93
94
|
start_index = pieces.each_index.select { |i| pieces[i].is_a? Pieces::StraightRightWall }.sample
|
94
95
|
# If there are no straight right pieces, pick any straight piece to be the start
|
95
96
|
start_index = pieces.each_index.select { |i| pieces[i].is_a? Pieces::Straight }.sample if start_index.nil?
|
96
|
-
|
97
|
+
pieces[start_index] = Pieces::Start.new(pieces[start_index].to_h) unless start_index.nil?
|
97
98
|
self
|
98
99
|
end
|
99
100
|
|
data/pitchcar.gemspec
CHANGED