Last active
December 16, 2015 19:19
-
-
Save hamin/5484247 to your computer and use it in GitHub Desktop.
Fun exercise for Brooks :)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Title 49th parallel | |
| URL http://artsweb.bham.ac.uk/ | |
| Domain artsweb.bham.ac.uk | |
| Title ABAA booknet | |
| URL http://abaa.org/ | |
| Domain abaa.org |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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