Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dannyben/concode
Generate consistent-codenames from any string (Heroku style, aka Haiku).
https://github.com/dannyben/concode
codename gem generator haikunator heroku ruby
Last synced: 28 days ago
JSON representation
Generate consistent-codenames from any string (Heroku style, aka Haiku).
- Host: GitHub
- URL: https://github.com/dannyben/concode
- Owner: DannyBen
- License: mit
- Created: 2018-06-21T16:36:09.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-09-28T04:41:01.000Z (about 1 year ago)
- Last Synced: 2024-10-06T05:19:33.272Z (about 1 month ago)
- Topics: codename, gem, generator, haikunator, heroku, ruby
- Language: Ruby
- Size: 102 KB
- Stars: 7
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Concode
==================================================[![Gem Version](https://badge.fury.io/rb/concode.svg)](https://badge.fury.io/rb/concode)
[![Build Status](https://github.com/DannyBen/concode/workflows/Test/badge.svg)](https://github.com/DannyBen/concode/actions?query=workflow%3ATest)
[![Maintainability](https://api.codeclimate.com/v1/badges/6aa0a88a0276cf20b84f/maintainability)](https://codeclimate.com/github/DannyBen/concode/maintainability)---
Generate *consistent-codenames* from any string (Heroku style, aka Haiku).
This is a Ruby port of Python's [codenamize][1].
---
Installation
--------------------------------------------------$ gem install concode
Feature Highlights
--------------------------------------------------- Use as a Ruby library or from the command line
- Generate heroku-style / docker-style consistent codenames from any string (e.g. IP address, git commit
hash)
- Control the number of words, and number of letters in each word
- Compatibility with Python's codenamize (both libraries will generate the
same codes given the same string)
- Limitless combinations (over 1.7 million for 2 words, and 1.8 billion for 3
words)Command Line Usage
--------------------------------------------------```shell
$ concode --helpUsage:
concode [options]
concode --random [options]
concode --count [options]
concode (-h|--help|-v|--version)Options:
-w, --words N Number of words to generate
-c, --chars N Max characters per word
-g, --glue CHAR Word separator
-C, --caps Capitalize words
-n, --count Count possible combinations
-r, --random Generate a random code
-h, --help Show this message
-v, --version Show version
```### Examples
```shell
$ concode hello
plausible-term$ concode hello --words 3
ancient-plausible-term$ concode hello --words 3 --chars 3 --caps --glue ' '
Cut Red Bar$ concode --random -w4
cruel-aggressive-cute-world
```Library Usage
--------------------------------------------------```ruby
require 'concode'# basic use:
generator = Concode::Generator.new
puts generator.generate 'something annoying'
# => annoyed-poem# or, with all the options:
generator = Concode::Generator.new words: 3, chars: 4, capitalize: true, glue: ' '
puts generator.generate 'something annoying'
# => Wise Rude Boot# get the available combinations with:
puts generator.word_count
# => 7402200
```Credits
--------------------------------------------------Thanks to Jose Juan Montes ([@jjmontesl][2]) for developing and documenting
[codenamize][1].[1]: https://github.com/jjmontesl/codenamize
[2]: https://github.com/jjmontesl