Skip to content
/ babbler Public

Ruby gem for creating nonsense babble in the form of an adjective plus a noun

License

Notifications You must be signed in to change notification settings

lml/babbler

Repository files navigation

Babbler

Babbler is a Ruby gem that will make short nonsense phrases for you. The phrases nominally consist of an adjective followed by a noun, though the format can be configured. The words in the phrase are common English words.

Installation

Add this line to your application's Gemfile:

gem 'babbler'

And then execute:

$ bundle

Or install it yourself as:

$ gem install babbler

Configuration

To configure Babbler, put the following code in your applications initialization logic (eg. in the config/initializers in a Rails app)

Babbler.configure do |config|
  ...
end

The following example lists all of the available configuration options, with the default values shown:

Babbler.configure do |config|
  # Use a different format for the resulting phrase
  # phrase, e.g. with a value of 'nn' you might get 'prosecutor dog'
  config.format = 'an'

  # Choose a different word list. Options:
  #   :original - the original word list in Babbler
  #   :safer_words_1 - the original list with potentially awkward words removed
  #   :california_words - words 2nd graders in California are expected to know
  config.word_list = :original
end

Usage

To get a random babble, type:

Babbler.babble

To always be able to get a specific babble, pass an integer in:

Note: This is not guaranteed to be the same result over major versions

Babbler.babble(42)

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Add tests
  5. Push to the branch (git push origin my-new-feature)
  6. Create a new Pull Request

About

Ruby gem for creating nonsense babble in the form of an adjective plus a noun

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages