Skip to content
Generate Heroku-like memorable random names like adorable-ox-1234.
Ruby Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Generate Heroku-like memorable random names like adorable-ox-1234.


Add this line to your application's Gemfile:

gem "haikunate"

And then execute:

$ bundle install

Or install it yourself as:

$ gem install haikunate


You generate random haiku names by calling (or its alias
#=> satisfied-eagle-7977

You can change the joiner string by provider the option joiner. ".")
#=> passionate.alpaca.7619

A haiku composed by adjective-noun-variant, where variant is a random number within 1000..9999 range. You can override the range by setting Haiku.default_range.

Haiku.default_range = 10_000..99_999
#=> abundant-panda-57702

Alternatively, you can provide a variant option, which can be any object that responds to .call().

require "securerandom" -> { SecureRandom.alphanumeric(5).downcase })
#=> tidy-skunk-s8ln0

To override the dictionary list, use Haiku.adjectives=(list) and Haiku.nouns=(list).

Haiku.adjectives = %w[awful terrible crazy]
Haiku.nouns = %w[lawyer judge politian]
#=> terrible-politian-8116

If you're planning to use a haiku as some unique value on your database, you can use, &block); a new haiku will be generated until returns false. For instance, this is how you'd use it with ActiveRecord:

site =
site.slug = {|slug| Site.where(slug: slug).exists? }!

That can be a problem for databases with lots and lots of records. If that's the case, you can then use a more random variant like 6 random alphanumeric characters.

You can override the default variant generator by setting Haiku.default_variant=(new_variant).

Haiku.default_variant = -> { SecureRandom.alphanumeric(6).downcase }


After checking out the repo, run bin/setup to install dependencies. Then, run rake test to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to


Bug reports and pull requests are welcome on GitHub at This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.


The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the Haikunate project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

You can’t perform that action at this time.