Project

babbler

0.0
No commit activity in last 3 years
No release in over 3 years
Creates nonsense babble in the form of an adjective plus a noun
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0
>= 0
 Project Readme

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