← All languages

wildling

Ruby library and CLI for pattern-based string generation. Zero third-party gems (stdlib only, including json). Requires Ruby 3.0+.

Example

Install

From this repository:

cd ruby
./build.sh
./bin/wildling "Year 19##"

Git (Bundler):

gem "wildling", git: "https://github.com/dotmonk/wildling.git", tag: "v2.0.0", glob: "ruby/wildling.gemspec"

Registry: gem install wildling

require_relative "lib/wildling"

wildling = Wildling.create(["Year 19##"])
value = wildling.next
while value != false
  puts value
  value = wildling.next
end

CLI

./bin/wildling "Year 19##"
./bin/wildling --dictionary planets:../dictionaries/planets.txt "%{'planets'}"
./bin/wildling --template ./config.json

Help text and --check output follow docs/cli.md / docs/help.txt.

Build

./build.sh   # Docker (ruby:3.3-alpine): copy help.txt + syntax-check

Project tests live in ../tests/ and are run with ../test.sh.