Created
February 2, 2010 00:03
-
-
Save riethmayer/292204 to your computer and use it in GitHub Desktop.
This file contains 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
# name.rb ;; 2010 (cc) Jan Riethmayer | |
# This work is licensend under a Creative Commons Attribution 3.0 license. | |
class Name | |
class << self | |
def parts | |
result = <<-NAMES | |
dev developer code arborium conservatory garden bit byte aid bot | |
open offen test behaviour mate rack ateer hash tree green grow | |
bloom karoshi flora keim flow forge former light nerds geeks rack | |
lab cultivation culture breed web mash restless awake less wheel | |
NAMES | |
result.gsub(/\n/," ").gsub(/ /," ").split(" ") | |
end | |
def compute | |
result = [] | |
Name.parts.each do |n1| | |
Name.parts.each do |n2| | |
unless n1 == n2 | |
result << "#{n1}#{n2}".capitalize | |
result << "#{n2}#{n1}".capitalize | |
end | |
end | |
end | |
result.uniq.sort | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment