Skip to content

Instantly share code, notes, and snippets.

@hamin
Last active December 16, 2015 19:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save hamin/5484247 to your computer and use it in GitHub Desktop.
Save hamin/5484247 to your computer and use it in GitHub Desktop.
Fun exercise for Brooks :)
Title 49th parallel
URL http://artsweb.bham.ac.uk/
Domain artsweb.bham.ac.uk
Title ABAA booknet
URL http://abaa.org/
Domain abaa.org
configs = []
sanitized_lines = File.readlines('A.cfg').map{|l| l.gsub("\n","").strip }.reject{|l| l.empty?}
sanitized_lines.each_slice(3) do |title, url, domain|
hash = {}
[title, url, domain].each do |line|
hash.store( line.split(" ").first.strip, line.split(" ").last.strip)
end
configs << hash
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment