Last active
July 13, 2016 14:28
-
-
Save gouf/10958904 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
require 'randexp' | |
require 'faker' | |
require 'forgery' | |
I18n.enforce_available_locales = true | |
I18n.default_locale = :en | |
class Randgen | |
def self.rand_name(options = {}) | |
/#{Forgery::Basic.color}-#{Faker::Name.first_name}-\d{4}/.gen.downcase | |
end | |
end | |
8.times do | |
p /[:rand_name:]/.gen | |
end | |
=begin | |
"fuscia-kyleigh-8861" | |
"green-mallory-9411" | |
"goldenrod-estella-9444" | |
"pink-abby-7976" | |
"red-rogers-5788" | |
"mauv-dell-1808" | |
"blue-ron-0976" | |
"pink-eileen-0828" | |
=end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment