evanwalsh / morning_zoo

Generate a name for your morning radio program

This URL has Read+Write access

morning_zoo / morning_zoo.rb
100644 14 lines (10 sloc) 0.423 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/ruby
 
require "yaml"
require "plural"
 
data = YAML.load(File.read("data.yml"))
@lists = %w{military_rank extreme_name animal_name female_name location}
 
@lists.each do |list|
  eval("@#{list.plural} = data[ \"#{list.plural}\" ]")
  eval("@#{list} = @#{list.plural}[ rand( @#{list.plural}.length ) ]")
end
 
puts "#{@military_rank} #{@extreme_name} and The #{@animal_name} with #{@female_name} in the #{@location}"