csv_pirate 2.1.1 → 2.1.2
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.
- data/VERSION.yml +1 -1
- data/csv_pirate.gemspec +1 -1
- data/lib/csv_pirate.rb +8 -6
- metadata +1 -1
data/VERSION.yml
CHANGED
data/csv_pirate.gemspec
CHANGED
data/lib/csv_pirate.rb
CHANGED
@@ -301,14 +301,16 @@ class CsvPirate
|
|
301
301
|
def self.marlinespike(spoils, navigation)
|
302
302
|
navigation.map do |east,west|
|
303
303
|
spoils = spoils.send(east.to_sym)
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
304
|
+
unless spoils.nil?
|
305
|
+
if west.is_a?(Hash)
|
306
|
+
# Recursive nadness is here!
|
307
|
+
spoils = CsvPirate.marlinespike(spoils, west)
|
308
|
+
else
|
309
|
+
spoils = spoils.send(west.to_sym)
|
310
|
+
end
|
309
311
|
end
|
310
312
|
spoils
|
311
|
-
end.join(' - ')
|
313
|
+
end.compact.join(' - ')
|
312
314
|
end
|
313
315
|
|
314
316
|
# Used to read any loot found by any pirate
|