require 'json'

main_info = {};

proj_list = Dir['/home/ethan/games/kerbal/CKAN-meta/*']

# TODO once I can access docs, see if ruby would normally use a foreach here instead of a map
proj_list.map { |proj|
	versions = Dir["#{proj}/*.ckan"]
	versions.map { |v|
		puts "Reading #{v}"
		info = JSON.parse(File.read(v))
		main_info[info['identifier']] = info['version']
	}
}

puts main_info

require 'json'

main_info = {};

proj_list = Dir['/home/ethan/games/kerbal/CKAN-meta/*']

proj_list.each { |proj|
	versions = Dir["#{proj}/*.ckan"]
	versions.each { |v|
		puts "Reading #{v}"
		info = JSON.parse(File.read(v))
		main_info[info['identifier']] = info['version']
	}
}

puts main_info

Change arr.map to arr.each (ah, THAT'S how to do a foreach in Ruby)
Change arr.map to arr.each (ah, THAT'S how to do a foreach in Ruby)
