module

Cowsay

Constants

SOURCE = "https://github.com/kojix2/cowsay.cr"
VERSION = {{ (`shards version /tmp/tmp.KMobED/src/src/cowsay`).chomp.stringify }}

Class methods

[](character) : Class
Source
character_names
Source
say(message, character = "cow", mode = "default", eyes = nil, tongue = nil, wrapcolumn = 40, color = false)

Creates a speech bubble with the given message and renders it with the specified character.

Parameters

  • message : The message to display in the speech bubble
  • character : The character to use (default: "cow")
  • mode : The face mode to use (default: "default")
  • eyes : Custom eyes to use (overrides mode)
  • tongue : Custom tongue to use (overrides mode)
  • wrapcolumn : Column width for text wrapping (default: 40)
  • color : Whether to enable colored output (default: false)

Example

puts Cowsay.say("Hello, World!")
puts Cowsay.say("Hello, Tux!", character: "tux", mode: "borg")
puts Cowsay.say("Colorful!", color: true)
Source
think(message, character = "cow", mode = "default", eyes = nil, tongue = nil, wrapcolumn = 40, color = false)

Creates a thought bubble with the given message and renders it with the specified character.

Parameters

  • message : The message to display in the thought bubble
  • character : The character to use (default: "cow")
  • mode : The face mode to use (default: "default")
  • eyes : Custom eyes to use (overrides mode)
  • tongue : Custom tongue to use (overrides mode)
  • wrapcolumn : Column width for text wrapping (default: 40)
  • color : Whether to enable colored output (default: false)

Example

puts Cowsay.think("I wonder...")
puts Cowsay.think("Hmm...", character: "tux", mode: "paranoid")
puts Cowsay.think("Colorful thoughts!", color: true)
Source

Nested types