module AsciiParadise

#

require 'ascii_paradise/animation/reset.rb'

#
#

require 'ascii_paradise/ascii_say/say.rb'

#
#

AsciiParadise::AsciiTable::Cell

#
#

AsciiParadise::Table::Style

A Style object holds all the formatting information for a Table object.

To create a table with a certain style, use either the constructor option :style, the Table#style object or the Table#style= method.

All these examples have the same effect:

# by constructor
@table = Table.new(:style => {:padding_left => 2, :width => 40})

# by object
@table.style.padding_left = 2
@table.style.width = 40

# by method
@table.style = {:padding_left => 2, :width => 40}

To set a default style for all tables created afterwards, use Style.defaults=

AsciiParadise::AsciiTable::Style.defaults = {:width => 80}
#
#
#

AsciiParadise::AsciiTable::TableHelper

#
#

AsciiParadise::AsciiTable

#

require 'asciitable/toplevel_methods.rb'

#
#

require 'ascii_paradise/base/initialize.rb'

#
#

require 'ascii_paradise/base/menu.rb'

#
#

require 'ascii_paradise/base/reset.rb'

#
#

AsciiParadise::ClockCounter

This class will show a little ASCII clock counter.

#

require 'ascii_paradise/clock_counter/clock_counter.rb' AsciiParadise::ClockCounter.new { :rename_kde_konsole_tab }

#
#

require 'ascii_paradise/commandline/help.rb'

#
#

require 'ascii_paradise/commandline/menu.rb'

#
#

require 'ascii_paradise/constants/unicode_symbols.rb'

#
#

AsciiParadise::TableFlip

This code was written by havenwood - ask him for the license.

https://gist.githubusercontent.com/havenwood/7387731/raw/555d8b0f8d11e5b85921f3d7c55618e8a72fe7b1/table_flip.rb
#

require 'ascii_paradise/curses/table_flip.rb'

#
#

Methods and attributes stored here reside under the module AsciiParadise namespace.

#

require 'ascii_paradise/debug/debug.rb'

#
#

AsciiParadise::GUI::Gtk::AnimatedFrameConstants

#

require 'ascii_paradise/gui/shared_code/animated_frame/animated_frame_constants.rb' include ::AsciiParadise::GUI::Gtk::AnimatedFrameConstants

#
#

AsciiParadise::GUI::Gtk::AnimatedFrameModule

#

require 'ascii_paradise/gui/shared_code/animated_frame/animated_frame_module.rb' include ::AsciiParadise::GUI::Gtk::AnimatedFrameModule

#
#

AsciiParadise::GUI::Gtk::WidgetModule

#

require 'ascii_paradise/gui/shared_code/animated_frame/widget_module.rb' include ::AsciiParadise::GUI::Gtk::WidgetModule

#
#

require 'ascii_paradise/project/project.rb' AsciiParadise::PROJECT_BASE_DIRECTORY

#
#

require 'ascii_paradise/requires/require_sparky_components.rb'

#
#

AsciiParadise::Sparky::CLI

#
#

AsciiParadise::BeautifulPattern

#
#

AsciiParadise::Heart

This class will generate a red ruby heart. This is a tribute to _why.

Usage example:

AsciiParadise::Heart.new
#
#
#

require 'ascii_paradise/table/table.rb'

#
#

require 'ascii_paradise/toplevel_methods/available_ascii_components_options.rb'

#
#

require 'ascii_paradise/toplevel_methods/clear_screen.rb'

#
#

require 'ascii_paradise/toplevel_methods/colour_parse_this_string.rb' puts AsciiParadise.colour_parse_this_string(ARGV)

#

require 'ascii_paradise/toplevel_methods/colour_parse_this_string.rb'

#
#

require 'ascii_paradise/toplevel_methods/e.rb'

#
#

require 'ascii_paradise/toplevel_methods/new.rb'

#
#

require 'ascii_paradise/toplevel_methods/return_dataset_of_this_animated_ascii_component.rb' dataset = AsciiParadise.dataset_for(:rubber_duck)

#
#

require 'ascii_paradise/toplevel_methods/run_this_animated_component.rb' AsciiParadise.run_this_animated_component

#
#

require 'ascii_paradise/toplevel_methods/sort_files.rb' AsciiParadise.sort_files

#
#

require 'ascii_paradise/toplevel_methods/to_camelcase.rb'

#
#

require 'ascii_paradise/toplevel_methods/wrap_at.rb'

#
#
#

require 'ascii_paradise/www/embeddable_interface.rb' include AsciiParadise::EmbeddableInterface

#

Constants

ARRAY_SAY_CONSTANTS
#

ARRAY_SAY_CONSTANTS

The names here correspond to .ascii files. For instance, there will be a file called “cat_in_the_hat.ascii”, in the subdirectory ascii_say/.

Sort this Array alphabetically.

#
AsciiCounter
CAT_FACE
#

AsciiParadise::CAT_FACE

#
CHECKMARK_SYMBOL
#

CHECKMARK_SYMBOL

#
CLEAR_COMMAND
#

CLEAR_COMMAND

#
DEFAULT_COLOUR_TO_USE
#

DEFAULT_COLOUR_TO_USE

#
HOME_DIRECTORY_OF_THE_USER_X
#

HOME_DIRECTORY_OF_THE_USER_X

#
LAST_UPDATE
#

LAST_UPDATE

#
MONA_LISA
#

AsciiParadise::MONA_LISA

#
N
#

N

#
N_CHARACTERS_PER_LINE
#

AsciiParadise::N_CHARACTERS_PER_LINE

Default value to be used for word-wrap splitting.

#
PROJECT_BASE_DIRECTORY
#

AsciiParadise::PROJECT_BASE_DIRECTORY

#
R
#

R

#
REGISTERED_CLASS_METHODS
#

AsciiParadise::REGISTERED_CLASS_METHODS

Register all class methods that can be used via .random here.

#
SLEEP_FOR_N_SECONDS
#

SLEEP_FOR_N_SECONDS

#
SNOWMAN
#

SNOWMAN

#
Table
#

Add an “alias” called Table next.

#
UNICODE_DOUBLE_BORDER_BOTTOM_LEFT
#

UNICODE_DOUBLE_BORDER_BOTTOM_LEFT

#
UNICODE_DOUBLE_BORDER_BOTTOM_RIGHT
#

UNICODE_DOUBLE_BORDER_BOTTOM_RIGHT

#
UNICODE_DOUBLE_BORDER_HORIZONTAL
#

UNICODE_DOUBLE_BORDER_HORIZONTAL

#
UNICODE_DOUBLE_BORDER_TOP_LEFT
#

UNICODE_DOUBLE_BORDER_TOP_LEFT

#
UNICODE_DOUBLE_BORDER_TOP_RIGHT
#

UNICODE_DOUBLE_BORDER_TOP_RIGHT

#
UNICODE_DOUBLE_BORDER_VERTICAL
#

UNICODE_DOUBLE_BORDER_VERTICAL

#
URL_TO_THE_DOCUMENTATION
#

URL_TO_THE_DOCUMENTATION

#
VERSION
#

VERSION

#

Public Class Methods

Airbus() click to toggle source
#

AsciiParadise.Airbus

#
# File lib/ascii_paradise/animations/airbus.rb, line 32
def self.Airbus
  Airbus
end
AirplaneFight() click to toggle source
#

AsciiParadise.AirplaneFight

#
# File lib/ascii_paradise/animations/airplane_fight.rb, line 32
def self.AirplaneFight
  AirplaneFight
end
AirplaneOverForest() click to toggle source
#

AsciiParadise.AirplaneOverForest

#
# File lib/ascii_paradise/animations/airplane_over_forest.rb, line 32
def self.AirplaneOverForest
  AirplaneOverForest
end
AnimatedClock() click to toggle source
#

AsciiParadise.AnimatedClock

#
# File lib/ascii_paradise/animations/animated_clock.rb, line 33
def self.AnimatedClock
  AnimatedClock
end
AntiAir() click to toggle source
#

AsciiParadise.AntiAir

#
# File lib/ascii_paradise/animations/anti_air.rb, line 31
def self.AntiAir
  AntiAir
end
Aquarium() click to toggle source
#

AsciiParadise.Aquarium

#
# File lib/ascii_paradise/animations/aquarium.rb, line 32
def self.Aquarium
  Aquarium
end
BabyDragon() click to toggle source
#

AsciiParadise.BabyDragon

#
# File lib/ascii_paradise/animations/baby_dragon.rb, line 32
def self.BabyDragon
  BabyDragon
end
Backflip() click to toggle source
#

AsciiParadise.Backflip

#
# File lib/ascii_paradise/animations/backflip.rb, line 32
def self.Backflip
  Backflip
end
BallBouncesAgainstWall() click to toggle source
#

AsciiParadise.BallBouncesAgainstWall

#
# File lib/ascii_paradise/animations/ball_bounces_against_wall.rb, line 33
def self.BallBouncesAgainstWall
  BallBouncesAgainstWall
end
BallFactory() click to toggle source
#

AsciiParadise.BallFactory

#
# File lib/ascii_paradise/animations/ball_factory.rb, line 32
def self.BallFactory
  BallFactory
end
Basketball() click to toggle source
#

AsciiParadise.Basketball

#
# File lib/ascii_paradise/animations/basketball.rb, line 32
def self.Basketball
  Basketball
end
BasketballGame() click to toggle source
#

AsciiParadise.BasketballGame

#
# File lib/ascii_paradise/animations/basketball_game.rb, line 32
def self.BasketballGame
  BasketballGame
end
BeautifulPattern() click to toggle source
#

AsciiParadise.BeautifulPattern

#
# File lib/ascii_paradise/static_ascii/beautiful_pattern.rb, line 55
def self.BeautifulPattern
  AsciiParadise::BeautifulPattern
end
BikerAndSnail() click to toggle source
#

AsciiParadise.BikerAndSnail

#
# File lib/ascii_paradise/animations/biker_and_snail.rb, line 33
def self.BikerAndSnail
  BikerAndSnail
end
Bird() click to toggle source
#

AsciiParadise.Bird

#
# File lib/ascii_paradise/animations/bird.rb, line 32
def self.Bird
  Bird
end
BirdAttack() click to toggle source
#

AsciiParadise.BirdAttack

#
# File lib/ascii_paradise/animations/bird_attack.rb, line 32
def self.BirdAttack
  BirdAttack
end
BlockBreaker() click to toggle source
#

AsciiParadise.BlockBreaker

#
# File lib/ascii_paradise/animations/block_breaker.rb, line 32
def self.BlockBreaker
  BlockBreaker
end
BodyBuilders() click to toggle source
#

AsciiParadise.BodyBuilders

#
# File lib/ascii_paradise/animations/body_builders.rb, line 32
def self.BodyBuilders
  BodyBuilders
end
Boomerang() click to toggle source
#

AsciiParadise.Boomerang

#
# File lib/ascii_paradise/animations/boomerang.rb, line 32
def self.Boomerang
  Boomerang
end
BouncingBall() click to toggle source
#

AsciiParadise.BouncingBall

#
# File lib/ascii_paradise/animations/bouncing_ball.rb, line 32
def self.BouncingBall
  BouncingBall
end
BouncyBall() click to toggle source
#

AsciiParadise.BouncyBall

#
# File lib/ascii_paradise/animations/bouncy_ball.rb, line 32
def self.BouncyBall
  BouncyBall
end
BouncyExplodingBall() click to toggle source
#

AsciiParadise.BouncyExplodingBall

#
# File lib/ascii_paradise/animations/bouncy_exploding_ball.rb, line 32
def self.BouncyExplodingBall
  BouncyExplodingBall
end
Box() click to toggle source
#

AsciiParadise.Box

#
# File lib/ascii_paradise/static_ascii/box.rb, line 298
def self.Box
  AsciiParadise::Box
end
BreakingGlass() click to toggle source
#

AsciiParadise.BreakingGlass

#
# File lib/ascii_paradise/animations/breaking_glass.rb, line 32
def self.BreakingGlass
  BreakingGlass
end
BubbleDragon() click to toggle source
#

AsciiParadise.BubbleDragon

#
# File lib/ascii_paradise/animations/bubble_dragon.rb, line 32
def self.BubbleDragon
  BubbleDragon
end
Bunnies() click to toggle source
#

AsciiParadise.Bunnies

#
# File lib/ascii_paradise/animations/bunnies.rb, line 32
def self.Bunnies
  Bunnies
end
Bunnycat() click to toggle source
#

AsciiParadise.Bunnycat

#
# File lib/ascii_paradise/animations/bunnycat.rb, line 32
def self.Bunnycat
  Bunnycat
end
CanadianFlag() click to toggle source
#

AsciiParadise.CanadianFlag

#
# File lib/ascii_paradise/animations/canadian_flag.rb, line 32
def self.CanadianFlag
  CanadianFlag
end
CarProduction() click to toggle source
#

AsciiParadise.CarProduction

#
# File lib/ascii_paradise/animations/car_production.rb, line 32
def self.CarProduction
  CarProduction
end
CatFace() click to toggle source
#

AsciiParadise.CatFace

#
# File lib/ascii_paradise/static_ascii/cat_face.rb, line 35
def self.CatFace
  AsciiParadise::CatFace
end
CatchTheBall() click to toggle source
#

AsciiParadise.CatchTheBall

#
# File lib/ascii_paradise/animations/catch_the_ball.rb, line 32
def self.CatchTheBall
  CatchTheBall
end
Chopper() click to toggle source
#

AsciiParadise.Chopper

#
# File lib/ascii_paradise/animations/chopper.rb, line 32
def self.Chopper
  Chopper
end
Cigarette() click to toggle source
#

AsciiParadise.Cigarette

#
# File lib/ascii_paradise/animations/cigarette.rb, line 32
def self.Cigarette
  Cigarette
end
Circle() click to toggle source
#

AsciiParadise.Circle

#
# File lib/ascii_paradise/static_ascii/circle.rb, line 237
def self.Circle
  AsciiParadise::Circle
end
CircleOfLife() click to toggle source
#

AsciiParadise.CircleOfLife

#
# File lib/ascii_paradise/animations/circle_of_life.rb, line 39
def self.CircleOfLife
  CircleOfLife
end
CoinRoll() click to toggle source
#

AsciiParadise.CoinRoll

#
# File lib/ascii_paradise/animations/coin_roll.rb, line 33
def self.CoinRoll
  CoinRoll
end
ColourfulFlowers() click to toggle source
#

AsciiParadise.ColourfulFlowers

#
# File lib/ascii_paradise/static_ascii/colourful_flowers.rb, line 58
def self.ColourfulFlowers
  AsciiParadise::ColourfulFlowers
end
Counter() click to toggle source
#

AsciiParadise.Counter

#
# File lib/ascii_paradise/animations/counter.rb, line 128
def self.Counter
  AsciiParadise::Counter
end
DancingGirl() click to toggle source
#

AsciiParadise.DancingGirl

#
# File lib/ascii_paradise/animations/dancing_girl.rb, line 32
def self.DancingGirl
  DancingGirl
end
DigitalClock() click to toggle source
#

AsciiParadise.DigitalClock

#
# File lib/ascii_paradise/animations/digital_clock.rb, line 32
def self.DigitalClock
  DigitalClock
end
Diver() click to toggle source
#

AsciiParadise.Diver

#
# File lib/ascii_paradise/animations/diver.rb, line 32
def self.Diver
  Diver
end
DotFactory() click to toggle source
#

AsciiParadise.DotFactory

#
# File lib/ascii_paradise/animations/dot_factory.rb, line 33
def self.DotFactory
  DotFactory
end
DrivingCar() click to toggle source
#

AsciiParadise.DrivingCar

#
# File lib/ascii_paradise/animations/driving_car.rb, line 32
def self.DrivingCar
  DrivingCar
end
Earth() click to toggle source
#

AsciiParadise.Earth

#
# File lib/ascii_paradise/animations/earth.rb, line 32
def self.Earth
  Earth
end
EndlessMonkeyBars() click to toggle source
#

AsciiParadise.EndlessMonkeyBars

#
# File lib/ascii_paradise/animations/endless_monkey_bars.rb, line 32
def self.EndlessMonkeyBars
  EndlessMonkeyBars
end
EndlessRunner() click to toggle source
#

AsciiParadise.EndlessRunner

#
# File lib/ascii_paradise/animations/endless_runner.rb, line 33
def self.EndlessRunner
  EndlessRunner
end
ExplodingAlien() click to toggle source
#

AsciiParadise.ExplodingAlien

#
# File lib/ascii_paradise/animations/exploding_alien.rb, line 32
def self.ExplodingAlien
  ExplodingAlien
end
ExplodingBubbles() click to toggle source
#

AsciiParadise.ExplodingBubbles

#
# File lib/ascii_paradise/animations/exploding_bubbles.rb, line 32
def self.ExplodingBubbles
  ExplodingBubbles
end
EyeWiggling() click to toggle source
#

AsciiParadise.EyeWiggling

#
# File lib/ascii_paradise/animations/eye_wiggling.rb, line 32
def self.EyeWiggling
  EyeWiggling
end
Fire() click to toggle source
#

AsciiParadise.Fire

#
# File lib/ascii_paradise/animations/fire.rb, line 33
def self.Fire
  Fire
end
FireworkClock() click to toggle source
#

AsciiParadise.FireworkClock

#
# File lib/ascii_paradise/animations/firework_clock.rb, line 32
def self.FireworkClock
  FireworkClock
end
FireworkLauncher() click to toggle source
#

AsciiParadise.FireworkLauncher

#
# File lib/ascii_paradise/animations/firework_launcher.rb, line 32
def self.FireworkLauncher
  FireworkLauncher
end
Fireworks() click to toggle source
#

AsciiParadise.Fireworks

#
# File lib/ascii_paradise/animations/fireworks.rb, line 32
def self.Fireworks
  Fireworks
end
FlameThrower() click to toggle source
#

AsciiParadise.FlameThrower

#
# File lib/ascii_paradise/animations/flame_thrower.rb, line 32
def self.FlameThrower
  FlameThrower
end
FlyingHead() click to toggle source
#

AsciiParadise.FlyingHead

#
# File lib/ascii_paradise/animations/flying_head.rb, line 32
def self.FlyingHead
  FlyingHead
end
FramerateWalking() click to toggle source
#

AsciiParadise.FramerateWalking

#
# File lib/ascii_paradise/animations/framerate_walking.rb, line 33
def self.FramerateWalking
  FramerateWalking
end
FriendlyMonkey() click to toggle source
#

AsciiParadise.FriendlyMonkey

#
# File lib/ascii_paradise/animations/friendly_monkey.rb, line 32
def self.FriendlyMonkey
  FriendlyMonkey
end
Gargoyle() click to toggle source
#

AsciiParadise.Gargoyle

#
# File lib/ascii_paradise/animations/gargoyle.rb, line 32
def self.Gargoyle
  Gargoyle
end
Genie() click to toggle source
#

AsciiParadise.Genie

#
# File lib/ascii_paradise/animations/genie.rb, line 32
def self.Genie
  Genie
end
GoodMorning() click to toggle source
#

AsciiParadise.GoodMorning

#
# File lib/ascii_paradise/animations/good_morning.rb, line 32
def self.GoodMorning
  GoodMorning
end
Hadouken() click to toggle source
#

AsciiParadise.Hadouken

#
# File lib/ascii_paradise/animations/hadouken.rb, line 32
def self.Hadouken
  Hadouken
end
HandOfGod() click to toggle source
#

AsciiParadise.HandOfGod

#
# File lib/ascii_paradise/animations/hand_of_god.rb, line 32
def self.HandOfGod
  HandOfGod
end
Heart() click to toggle source
#

AsciiParadise.Heart

#
# File lib/ascii_paradise/static_ascii/heart.rb, line 147
def self.Heart
  AsciiParadise::Heart
end
Hourglass() click to toggle source
#

AsciiParadise.Hourglass

#
# File lib/ascii_paradise/animations/hourglass.rb, line 32
def self.Hourglass
  Hourglass
end
HumanFactory() click to toggle source
#

AsciiParadise.HumanFactory

#
# File lib/ascii_paradise/animations/human_factory.rb, line 33
def self.HumanFactory
  HumanFactory
end
Intercourse() click to toggle source
#

AsciiParadise.Intercourse

#
# File lib/ascii_paradise/animations/intercourse.rb, line 32
def self.Intercourse
  Intercourse
end
Jello() click to toggle source
#

AsciiParadise.Jello

#
# File lib/ascii_paradise/animations/jello.rb, line 32
def self.Jello
  Jello
end
Juggling() click to toggle source
#

AsciiParadise.Juggling

#
# File lib/ascii_paradise/animations/juggling.rb, line 32
def self.Juggling
  Juggling
end
JumpRope() click to toggle source
#

AsciiParadise.JumpRope

#
# File lib/ascii_paradise/animations/jump_rope.rb, line 32
def self.JumpRope
  JumpRope
end
JumpingPig() click to toggle source
#

AsciiParadise.JumpingPig

#
# File lib/ascii_paradise/animations/jumping_pig.rb, line 31
def self.JumpingPig
  JumpingPig
end
LaserClock() click to toggle source
#

AsciiParadise.LaserClock

#
# File lib/ascii_paradise/animations/laser_clock.rb, line 32
def self.LaserClock
  LaserClock
end
LightningBolt() click to toggle source
#

AsciiParadise.LightningBolt

#
# File lib/ascii_paradise/animations/lightning_bolt.rb, line 44
def self.LightningBolt
  LightningBolt
end
LoadingDots() click to toggle source
#

AsciiParadise.LoadingDots

#
# File lib/ascii_paradise/animations/loading_dots.rb, line 32
def self.LoadingDots
  LoadingDots
end
Macarena() click to toggle source
#

AsciiParadise.Macarena

#
# File lib/ascii_paradise/animations/macarena.rb, line 32
def self.Macarena
  Macarena
end
MonaLisa() click to toggle source
#

AsciiParadise.MonaLisa

#
# File lib/ascii_paradise/static_ascii/mona_lisa.rb, line 35
def self.MonaLisa
  AsciiParadise::MonaLisa
end
Moth() click to toggle source
#

AsciiParadise.Moth

#
# File lib/ascii_paradise/animations/moth.rb, line 32
def self.Moth
  Moth
end
NeverendingStaircase() click to toggle source
#

AsciiParadise.NeverendingStaircase

#
# File lib/ascii_paradise/animations/neverending_staircase.rb, line 32
def self.NeverendingStaircase
  NeverendingStaircase
end
OneDestroyer() click to toggle source
#

AsciiParadise.OneDestroyer

#
# File lib/ascii_paradise/animations/one_destroyer.rb, line 32
def self.OneDestroyer
  OneDestroyer
end
ParachuteJump() click to toggle source
#

AsciiParadise.ParachuteJump

#
# File lib/ascii_paradise/animations/parachute_jump.rb, line 32
def self.ParachuteJump
  ParachuteJump
end
Phone() click to toggle source
#

AsciiParadise.Phone

#
# File lib/ascii_paradise/animations/phone.rb, line 33
def self.Phone
  Phone
end
PinkPanther() click to toggle source
#

AsciiParadise.PinkPanther

#
# File lib/ascii_paradise/static_ascii/pink_panther.rb, line 55
def self.PinkPanther
  AsciiParadise::PinkPanther
end
PlantingAForest() click to toggle source
#

AsciiParadise.PlantingAForest

#
# File lib/ascii_paradise/animations/planting_a_forest.rb, line 32
def self.PlantingAForest
  PlantingAForest
end
Ponies() click to toggle source
#

AsciiParadise.Ponies

#
# File lib/ascii_paradise/static_ascii/ponies.rb, line 57
def self.Ponies
  AsciiParadise::Ponies
end
ProgressBar() click to toggle source
#

AsciiParadise.ProgressBar

#
# File lib/ascii_paradise/animations/progress_bar.rb, line 99
def self.ProgressBar
  ProgressBar
end
PullRope() click to toggle source
#

AsciiParadise.PullRope

#
# File lib/ascii_paradise/animations/pull_rope.rb, line 32
def self.PullRope
  PullRope
end
Raindrop() click to toggle source
#

AsciiParadise.Raindrop

#
# File lib/ascii_paradise/animations/raindrop.rb, line 32
def self.Raindrop
  Raindrop
end
Raining() click to toggle source
#

AsciiParadise.Raining

#
# File lib/ascii_paradise/animations/raining.rb, line 32
def self.Raining
  Raining
end
Reflection() click to toggle source
#

AsciiParadise.Reflection

#
# File lib/ascii_paradise/animations/reflection.rb, line 32
def self.Reflection
  Reflection
end
RidingADuck() click to toggle source
#

AsciiParadise.RidingADuck

#
# File lib/ascii_paradise/animations/riding_a_duck.rb, line 32
def self.RidingADuck
  RidingADuck
end
RotatingCube() click to toggle source
#

AsciiParadise.RotatingCube

#
# File lib/ascii_paradise/animations/rotating_cube.rb, line 32
def self.RotatingCube
  RotatingCube
end
RotatingDna() click to toggle source
#

AsciiParadise.RotatingDna

#
# File lib/ascii_paradise/animations/rotating_dna.rb, line 187
def self.RotatingDna
  AsciiParadise::RotatingDNA
end
RotatingSlash() click to toggle source
#

AsciiParadise.RotatingSlash

#
# File lib/ascii_paradise/animations/rotating_slash.rb, line 106
def self.RotatingSlash
  AsciiParadise::RotatingSlash
end
RubberDuck() click to toggle source
#

AsciiParadise.RubberDuck

#
# File lib/ascii_paradise/animations/rubber_duck.rb, line 32
def self.RubberDuck
  RubberDuck
end
RunningMan() click to toggle source
#

AsciiParadise.RunningMan

#
# File lib/ascii_paradise/animations/running_man.rb, line 32
def self.RunningMan
  RunningMan
end
SailingBoat() click to toggle source
#

AsciiParadise.SailingBoat

#
# File lib/ascii_paradise/animations/sailing_boat.rb, line 32
def self.SailingBoat
  SailingBoat
end
SandClock() click to toggle source
#

AsciiParadise.SandClock

#
# File lib/ascii_paradise/animations/sand_clock.rb, line 32
def self.SandClock
  SandClock
end
SeductiveLady() click to toggle source
#

AsciiParadise.SeductiveLady

#
# File lib/ascii_paradise/static_ascii/seductive_lady.rb, line 44
def self.SeductiveLady
  AsciiParadise::SeductiveLady
end
Seesaw() click to toggle source
#

AsciiParadise.Seesaw

#
# File lib/ascii_paradise/animations/seesaw.rb, line 32
def self.Seesaw
  Seesaw
end
ShootingRange() click to toggle source
#

AsciiParadise.ShootingRange

#
# File lib/ascii_paradise/animations/shooting_range.rb, line 32
def self.ShootingRange
  ShootingRange
end
Shotgun() click to toggle source
#

AsciiParadise.Shotgun

#
# File lib/ascii_paradise/animations/shotgun.rb, line 32
def self.Shotgun
  Shotgun
end
SierpinskiTriangle() click to toggle source
#

AsciiParadise.SierpinskiTriangle

#
# File lib/ascii_paradise/static_ascii/sierpinksi_triangle.rb, line 94
def self.SierpinskiTriangle
  AsciiParadise::SierpinksiTriangle
end
SilentCity() click to toggle source
#

AsciiParadise.SilentCity

#
# File lib/ascii_paradise/animations/silent_city.rb, line 32
def self.SilentCity
  SilentCity
end
SoccerInFrontOfAHouse() click to toggle source
#

AsciiParadise.SoccerInFrontOfAHouse

#
# File lib/ascii_paradise/animations/soccer_in_front_of_a_house.rb, line 33
def self.SoccerInFrontOfAHouse
  SoccerInFrontOfAHouse
end
SoccerTwins() click to toggle source
#

AsciiParadise.SoccerTwins

#
# File lib/ascii_paradise/animations/soccer_twins.rb, line 32
def self.SoccerTwins
  SoccerTwins
end
Spider() click to toggle source
#

AsciiParadise.Spider

#
# File lib/ascii_paradise/animations/spider.rb, line 32
def self.Spider
  Spider
end
StarTrek() click to toggle source
#

AsciiParadise.StarTrek

#
# File lib/ascii_paradise/animations/star_trek.rb, line 33
def self.StarTrek
  StarTrek
end
StaticPacman() click to toggle source
#

AsciiParadise.StaticPacman

#
# File lib/ascii_paradise/static_ascii/static_pacman.rb, line 55
def self.StaticPacman
  AsciiParadise::StaticPacman
end
StationTraffic() click to toggle source
#

AsciiParadise.StationTraffic

#
# File lib/ascii_paradise/animations/station_traffic.rb, line 32
def self.StationTraffic
  StationTraffic
end
Steamer() click to toggle source
#

AsciiParadise.Steamer

#
# File lib/ascii_paradise/animations/steamer.rb, line 32
def self.Steamer
  Steamer
end
StepperLepper() click to toggle source
#

AsciiParadise.StepperLepper

#
# File lib/ascii_paradise/animations/stepper_lepper.rb, line 33
def self.StepperLepper
  StepperLepper
end
SwimmingLane() click to toggle source
#

AsciiParadise.SwimmingLane

#
# File lib/ascii_paradise/animations/swimming_lane.rb, line 32
def self.SwimmingLane
  SwimmingLane
end
TableFlip() click to toggle source
#

AsciiParadise.TableFlip

#
# File lib/ascii_paradise/curses/table_flip.rb, line 96
def self.TableFlip
  AsciiParadise::TableFlip
end
TableTennis() click to toggle source
#

AsciiParadise.TableTennis

#
# File lib/ascii_paradise/animations/table_tennis.rb, line 31
def self.TableTennis
  TableTennis
end
TearsOfIce() click to toggle source
#

AsciiParadise.TearsOfIce

#
# File lib/ascii_paradise/animations/tears_of_ice.rb, line 33
def self.TearsOfIce
  TearsOfIce
end
Tetris() click to toggle source
#

AsciiParadise.Tetris

#
# File lib/ascii_paradise/animations/tetris.rb, line 32
def self.Tetris
  Tetris
end
ThreadAndBall() click to toggle source
#

AsciiParadise.ThreadAndBall

#
# File lib/ascii_paradise/animations/thread_and_ball.rb, line 32
def self.ThreadAndBall
  ThreadAndBall
end
Trampoline() click to toggle source
#

AsciiParadise.Trampoline

#
# File lib/ascii_paradise/animations/trampoline.rb, line 32
def self.Trampoline
  Trampoline
end
Turtle() click to toggle source
#

AsciiParadise.Turtle

#
# File lib/ascii_paradise/animations/turtle.rb, line 31
def self.Turtle
  Turtle
end
Volcano() click to toggle source
#

AsciiParadise.Volcano

#
# File lib/ascii_paradise/animations/volcano.rb, line 31
def self.Volcano
  Volcano
end
Whip() click to toggle source
#

AsciiParadise.Whip

#
# File lib/ascii_paradise/animations/whip.rb, line 31
def self.Whip
  Whip
end
Worker() click to toggle source
#

AsciiParadise.Worker

#
# File lib/ascii_paradise/animations/worker.rb, line 32
def self.Worker
  Worker
end
Worm() click to toggle source
#

AsciiParadise.Worm

#
# File lib/ascii_paradise/animations/worm.rb, line 32
def self.Worm
  Worm
end
WristWatch() click to toggle source
#

AsciiParadise.WristWatch

#
# File lib/ascii_paradise/animations/wrist_watch.rb, line 31
def self.WristWatch
  WristWatch
end
[](i = 12) click to toggle source
#

AsciiParadise[]

This is an alias towards one of the registered methods listed above.

If it can not be found, we will use the last else clause and delegate to AsciiParadise.ascii_counter() instead.

#
# File lib/ascii_paradise/toplevel_methods/run_this_animated_component.rb, line 125
def self.[](i = 12)
  _ = available_ascii_components?
  case i
  when 'random','', # empty string also invokes random, as of Nov 2015.
       /^run(_|-)?random(_|-)?animation$/i
    run_random_animation
  else
    if i.to_s =~ /^\d+$/
      run_this_animated_component(
        _[i.to_i - 1]
      )
    else
      run_this_animated_component(i)
    end
  end
end
airbus(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.airbus

#
# File lib/ascii_paradise/animations/airbus.rb, line 39
def self.airbus(commandline_arguments = ARGV)
  Airbus.new(commandline_arguments)
end
airplane_fight(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.airplane_fight

#
# File lib/ascii_paradise/animations/airplane_fight.rb, line 39
def self.airplane_fight(commandline_arguments = ARGV)
  AirplaneFight.new(commandline_arguments)
end
airplane_over_forest(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.airplane_over_forest

#
# File lib/ascii_paradise/animations/airplane_over_forest.rb, line 39
def self.airplane_over_forest(commandline_arguments = ARGV)
  AirplaneOverForest.new(commandline_arguments)
end
animated_clock(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.animated_clock

#
# File lib/ascii_paradise/animations/animated_clock.rb, line 40
def self.animated_clock(commandline_arguments = ARGV)
  AnimatedClock.new(commandline_arguments)
end
animated_duck() click to toggle source
#

AsciiParadise.animated_duck

#
# File lib/ascii_paradise/animations/animated_duck.rb, line 47
def self.animated_duck
  AsciiParadise::AnimatedDuck.new
end
animated_pacman() click to toggle source
#

AsciiParadise.animated_pacman

#
# File lib/ascii_paradise/animations/animated_pacman.rb, line 62
def self.animated_pacman
  AsciiParadise::AnimatedPacman.new
end
animated_progress_bar() click to toggle source
#

AsciiParadise.animated_progress_bar

#
# File lib/ascii_paradise/animations/animated_progress_bar.rb, line 123
def self.animated_progress_bar
  AsciiParadise::AnimatedProgressBar.new
end
animatedpacman() click to toggle source
#

AsciiParadise.animatedpacman

#
# File lib/ascii_paradise/animations/animated_pacman.rb, line 69
def self.animatedpacman
  AsciiParadise::AnimatedPacman
end
animatedprogressbar() click to toggle source
#

AsciiParadise.animatedprogressbar

#
# File lib/ascii_paradise/animations/animated_progress_bar.rb, line 130
def self.animatedprogressbar
  AsciiParadise::AnimatedProgressBar
end
animations_directory?() click to toggle source
#

AsciiParadise.animations_directory?

Where all animations will be kept.

#
# File lib/ascii_paradise/project/project.rb, line 40
def self.animations_directory?
  "#{project_base_directory?}animations/"
end
anti_air(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.anti_air

#
# File lib/ascii_paradise/animations/anti_air.rb, line 38
def self.anti_air(commandline_arguments = ARGV)
  AntiAir.new(commandline_arguments)
end
aquarium(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.aquarium

#
# File lib/ascii_paradise/animations/aquarium.rb, line 39
def self.aquarium(commandline_arguments = ARGV)
  Aquarium.new(commandline_arguments)
end
ascii_box(msg_content = 'Hello World!') click to toggle source
#

AsciiParadise.ascii_box 'Hello World!'

#
# File lib/ascii_paradise/static_ascii/box.rb, line 291
def self.ascii_box(msg_content = 'Hello World!')
  AsciiParadise::Box.new(msg_content).report
end
ascii_circle(radius = 5) click to toggle source
#

AsciiParadise.ascii_circle

We draw an ascii circle here. We can pass the radius as its first argument.

#
# File lib/ascii_paradise/static_ascii/circle.rb, line 230
def self.ascii_circle(radius = 5)
  AsciiParadise::Circle.new(radius, 1.0, '#').display
end
ascii_counter(count_down_from = 50) click to toggle source
#

AsciiParadise.ascii_counter

#
# File lib/ascii_paradise/animations/counter.rb, line 121
def self.ascii_counter(count_down_from = 50)
  AsciiParadise::Counter.new(count_down_from)
end
ascii_heart(size = '12') click to toggle source
#

AsciiParadise.ascii_heart 'Hello World!'

#
# File lib/ascii_paradise/static_ascii/heart.rb, line 139
def self.ascii_heart(size = '12')
  AsciiParadise::Heart.draw_heart(size)
end
ascii_say( i = 'Hello world!', use_which_subcomponent = :random ) click to toggle source
#

AsciiParadise.ascii_say

Use a simplified ascii-talker, a bit like in a cartoon.

The second argument of this method tells us which subcomponent is to be used.

Usage examples:

AsciiParadise.say 'Yo there how do you do?', :wizard
#
# File lib/ascii_paradise/ascii_say/say.rb, line 25
def self.ascii_say(
    i                      = 'Hello world!',
    use_which_subcomponent = :random
  )
  if i.is_a? Array
    i = i.join(' ')
  end
  case use_which_subcomponent.to_sym
  # ======================================================================= #
  # === :random
  #
  # This entry point will list all possible components that respond
  # to .say().
  # ======================================================================= #
  when :random
    array = [
      AsciiParadise::Alien,
      AsciiParadise::Buddha,
      AsciiParadise::CatInTheHat,
      AsciiParadise::DomeTent,
      AsciiParadise::FlowerDecoration,
      AsciiParadise::Wizard,
      AsciiParadise::Knight,
      AsciiParadise::SexyAngel,
      AsciiParadise::Cowsay,
      AsciiParadise::Ponysay
    ]
    subcomponent_to_use = array.sample
  # ======================================================================= #
  # === :alien
  # ======================================================================= #
  when :alien
    subcomponent_to_use = AsciiParadise::Alien
  # ======================================================================= #
  # === :buddha
  # ======================================================================= #
  when :buddha
    subcomponent_to_use = AsciiParadise::Buddha
  # ======================================================================= #
  # === :dome_tent
  # ======================================================================= #
  when :dome_tent,
       :tent
    subcomponent_to_use = AsciiParadise::DomeTent
  # ======================================================================= #
  # === :flower
  # ======================================================================= #
  when :flower,
       :flower_decoration
    subcomponent_to_use = AsciiParadise::FlowerDecoration
  # ======================================================================= #
  # === :cat
  # ======================================================================= #
  when :cat,
       :cat_in_the_hat
    subcomponent_to_use = AsciiParadise::CatInTheHat
  # ======================================================================= #
  # === :wizard
  # ======================================================================= #
  when :wizard
    subcomponent_to_use = AsciiParadise::Wizard
  # ======================================================================= #
  # === :knight
  # ======================================================================= #
  when :knight
    subcomponent_to_use = AsciiParadise::Knight
  # ======================================================================= #
  # === :sexy_angel
  # ======================================================================= #
  when :sexy_angel
    subcomponent_to_use = AsciiParadise::SexyAngel
  # ======================================================================= #
  # === :cowsay
  # ======================================================================= #
  when :cowsay,
       :cow
    subcomponent_to_use = AsciiParadise::Cowsay
  # ======================================================================= #
  # === :ponysay
  # ======================================================================= #
  when :ponysay,
       :pony
    subcomponent_to_use = AsciiParadise::Ponysay
  end
  subcomponent_to_use.say i
end
ask_the_user_which_component_should_be_run_next() click to toggle source
#

AsciiParadise.ask_the_user_which_component_should_be_run_next

We will ask the user which component should be run next.

#
# File lib/ascii_paradise/interactive/interactive.rb, line 77
def self.ask_the_user_which_component_should_be_run_next
  e
  e 'Input your command next. Input "help" or "h" to get all options and'
  e '"exit" or "q" to exit from this user input loop again.'
  e 
  return_value = loop {
    user_input = $stdin.gets.chomp.strip
    # ===================================================================== #
    # === Downcase it next
    # ===================================================================== #
    user_input.downcase!
    case user_input # case tag
    # ===================================================================== #
    # === clear
    # ===================================================================== #
    when /^clear$/i
      e 'Clearing colour assignments next.'
      clear_colours
    # ===================================================================== #
    # === help
    # ===================================================================== #
    when /^-?-?help$/i,'h'
      show_interactive_help
    # ===================================================================== #
    # === exit
    # ===================================================================== #
    when 'exit','q'
      e 'Exiting now.'
      exit
    else # Else the user did input something. We will evaluate this.
      if ::Colours.does_include? user_input
        e 'Now using Colours. '+user_input+' colour.'
        @colour = user_input
      else
        components = ::AsciiParadise.return_all_animated_ascii_components
        result = nil
        # possible_match =
        #   result.map {|entry| entry.to_s }.select {|entry| entry.include? user_input }
        # =================================================================== #
        # === First check if it is a number
        # =================================================================== #
        if user_input =~ /^\d+$/
          result = components[user_input.to_i - 1]
        # =================================================================== #
        # === Check if the input is part of the component
        # =================================================================== #
        # elsif !possible_match.empty? # Not enable dfor now.
        # else # Else we did not find anything.
        end
        if result
          _ = nil
          if @colour
            _ = '--use-this-colour='+@colour.to_s
          end
          result.new(_) # Instantiate it here.
        end
      end
    end
  }
  return return_value
end
attractive_lady() click to toggle source
#

AsciiParadise.attractive_lady

#
# File lib/ascii_paradise/static_ascii/attractive_lady.rb, line 31
def self.attractive_lady
  AsciiParadise::AttractiveLady.new
end
attractivelady() click to toggle source
#

AsciiParadise.attractivelady

#
# File lib/ascii_paradise/static_ascii/attractive_lady.rb, line 38
def self.attractivelady
  AsciiParadise::AttractiveLady
end
available_ascii_components?() click to toggle source
#

AsciiParadise.available_ascii_components?

This will return a sorted Array which will have all the ascii components that are available.

This Array will look like so:

["AirplaneOverForest", "AnimatedCigarette"] # And so on.
#
# File lib/ascii_paradise/toplevel_methods/available_ascii_components.rb, line 26
def self.available_ascii_components?
  target = ::AsciiParadise.animations_directory?
  array = []
  Dir["#{target}*.rb"].each {|file|
    _ = File.basename(file).
        gsub(/ascii_/,'').
        sub(/\.rb$/,'').capitalize
    # ===================================================================== #
    # Camelcase it:
    # ===================================================================== #
    if _.include? '_'
      _ = _.split('_').map {|entry| entry.capitalize }.join
    end
    array << _
  }
  array.sort # Must sort it alphabetically.
end
available_ascii_components_options() click to toggle source
#

AsciiParadise.available_ascii_components_options

The Array that will be returned here, is used in a case-when menu elsewhere. It is used to determine which options are applicable in order to show the available ascii components of this project.

#
# File lib/ascii_paradise/toplevel_methods/available_ascii_components_options.rb, line 17
def self.available_ascii_components_options
  %w(
    --available
    --show-available
    --showavailable
    --overview
    overview
    show-available
  ) 
end
baby_dragon(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.baby_dragon

#
# File lib/ascii_paradise/animations/baby_dragon.rb, line 39
def self.baby_dragon(commandline_arguments = ARGV)
  BabyDragon.new(commandline_arguments)
end
backflip(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.backflip

#
# File lib/ascii_paradise/animations/backflip.rb, line 39
def self.backflip(commandline_arguments = ARGV)
  Backflip.new(commandline_arguments)
end
ball_bounces_against_wall(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.ball_bounces_against_wall

#
# File lib/ascii_paradise/animations/ball_bounces_against_wall.rb, line 40
def self.ball_bounces_against_wall(commandline_arguments = ARGV)
  BallBouncesAgainstWall.new(commandline_arguments)
end
ball_factory(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.ball_factory

#
# File lib/ascii_paradise/animations/ball_factory.rb, line 39
def self.ball_factory(commandline_arguments = ARGV)
  BallFactory.new(commandline_arguments)
end
basketball(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.basketball

#
# File lib/ascii_paradise/animations/basketball.rb, line 39
def self.basketball(commandline_arguments = ARGV)
  Basketball.new(commandline_arguments)
end
basketball_game(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.basketball_game

#
# File lib/ascii_paradise/animations/basketball_game.rb, line 39
def self.basketball_game(commandline_arguments = ARGV)
  BasketballGame.new(commandline_arguments)
end
beautiful_pattern() click to toggle source
#

AsciiParadise.beautiful_pattern

#
# File lib/ascii_paradise/static_ascii/beautiful_pattern.rb, line 48
def self.beautiful_pattern
  AsciiParadise::BeautifulPattern.new
end
biker_and_snail(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.biker_and_snail

#
# File lib/ascii_paradise/animations/biker_and_snail.rb, line 40
def self.biker_and_snail(commandline_arguments = ARGV)
  BikerAndSnail.new(commandline_arguments)
end
bird(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.bird

#
# File lib/ascii_paradise/animations/bird.rb, line 39
def self.bird(commandline_arguments = ARGV)
  Bird.new(commandline_arguments)
end
bird_attack(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.bird_attack

#
# File lib/ascii_paradise/animations/bird_attack.rb, line 39
def self.bird_attack(commandline_arguments = ARGV)
  BirdAttack.new(commandline_arguments)
end
block_breaker(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.block_breaker

#
# File lib/ascii_paradise/animations/block_breaker.rb, line 39
def self.block_breaker(commandline_arguments = ARGV)
  BlockBreaker.new(commandline_arguments)
end
body_builders(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.body_builders

#
# File lib/ascii_paradise/animations/body_builders.rb, line 39
def self.body_builders(commandline_arguments = ARGV)
  BodyBuilders.new(commandline_arguments)
end
boomerang(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.boomerang

#
# File lib/ascii_paradise/animations/boomerang.rb, line 39
def self.boomerang(commandline_arguments = ARGV)
  Boomerang.new(commandline_arguments)
end
bouncing_ball(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.bouncing_ball

#
# File lib/ascii_paradise/animations/bouncing_ball.rb, line 39
def self.bouncing_ball(commandline_arguments = ARGV)
  BouncingBall.new(commandline_arguments)
end
bouncy_ball(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.bouncy_ball

#
# File lib/ascii_paradise/animations/bouncy_ball.rb, line 39
def self.bouncy_ball(commandline_arguments = ARGV)
  BouncyBall.new(commandline_arguments)
end
bouncy_exploding_ball(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.bouncy_exploding_ball

#
# File lib/ascii_paradise/animations/bouncy_exploding_ball.rb, line 39
def self.bouncy_exploding_ball(commandline_arguments = ARGV)
  BouncyExplodingBall.new(commandline_arguments)
end
breaking_glass(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.breaking_glass

#
# File lib/ascii_paradise/animations/breaking_glass.rb, line 39
def self.breaking_glass(commandline_arguments = ARGV)
  BreakingGlass.new(commandline_arguments)
end
bubble_dragon(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.bubble_dragon

#
# File lib/ascii_paradise/animations/bubble_dragon.rb, line 39
def self.bubble_dragon(commandline_arguments = ARGV)
  BubbleDragon.new(commandline_arguments)
end
bunnies(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.bunnies

#
# File lib/ascii_paradise/animations/bunnies.rb, line 39
def self.bunnies(commandline_arguments = ARGV)
  Bunnies.new(commandline_arguments)
end
bunnycat(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.bunnycat

#
# File lib/ascii_paradise/animations/bunnycat.rb, line 39
def self.bunnycat(commandline_arguments = ARGV)
  Bunnycat.new(commandline_arguments)
end
canadian_flag(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.canadian_flag

#
# File lib/ascii_paradise/animations/canadian_flag.rb, line 39
def self.canadian_flag(commandline_arguments = ARGV)
  CanadianFlag.new(commandline_arguments)
end
car_production(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.car_production

#
# File lib/ascii_paradise/animations/car_production.rb, line 39
def self.car_production(commandline_arguments = ARGV)
  CarProduction.new(commandline_arguments)
end
cat_face() click to toggle source
#

AsciiParadise.cat_face

#
# File lib/ascii_paradise/static_ascii/cat_face.rb, line 28
def self.cat_face
  AsciiParadise::CatFace.new
end
catch_the_ball(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.catch_the_ball

#
# File lib/ascii_paradise/animations/catch_the_ball.rb, line 39
def self.catch_the_ball(commandline_arguments = ARGV)
  CatchTheBall.new(commandline_arguments)
end
chopper(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.chopper

#
# File lib/ascii_paradise/animations/chopper.rb, line 39
def self.chopper(commandline_arguments = ARGV)
  Chopper.new(commandline_arguments)
end
cigarette(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.cigarette

#
# File lib/ascii_paradise/animations/cigarette.rb, line 39
def self.cigarette(commandline_arguments = ARGV)
  Cigarette.new(commandline_arguments)
end
circle_of_life(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.circle_of_life

#
# File lib/ascii_paradise/animations/circle_of_life.rb, line 32
def self.circle_of_life(commandline_arguments = ARGV)
  CircleOfLife.new(commandline_arguments)
end
clear_colours() click to toggle source
#

AsciiParadise.clear_colours

#
# File lib/ascii_paradise/colours/colours.rb, line 43
def self.clear_colours
  AsciiParadise.set_colour(nil)
end
clear_screen() click to toggle source
#

AsciiParadise.clear_screen

Simply perform 'clear' here.

#
# File lib/ascii_paradise/toplevel_methods/clear_screen.rb, line 14
def self.clear_screen
  system 'clear'
end
coin_roll(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.coin_roll

#
# File lib/ascii_paradise/animations/coin_roll.rb, line 40
def self.coin_roll(commandline_arguments = ARGV)
  CoinRoll.new(commandline_arguments)
end
colour?() click to toggle source
#

AsciiParadise.colour?

#
# File lib/ascii_paradise/colours/colours.rb, line 29
def self.colour?
  @colour
end
colour_parse_this_string(i) click to toggle source
#

AsciiParadise.colour_parse_this_string

This method can take an existing String and replace all html colour tags, such as <steelblue>, with the corresponding ASCII escape code, on the commandline.

#
# File lib/ascii_paradise/toplevel_methods/colour_parse_this_string.rb, line 21
def self.colour_parse_this_string(i)
  if i.is_a? Array
    i = i.first
  end
  if i and File.file?(i)
    i = File.readlines(i)
  end
  if i.is_a? String
    i = i.split("\n")
  end
  i.map! {|entry|
    if ::Colours.does_this_line_include_a_html_colour?(entry)
      # =================================================================== #
      # The line contains a HTML colour, so let's parse it.
      # =================================================================== #
      entry = ::Colours.replace_all_html_colours_in_this_line(entry, :default, :revert)
    end
    entry
  }
  if i.is_a? Array
    i = i.join
  end
  i
end
colourful_flowers() click to toggle source
#

AsciiParadise.colourful_flowers

#
# File lib/ascii_paradise/static_ascii/colourful_flowers.rb, line 50
def self.colourful_flowers
  AsciiParadise::ColourfulFlowers.run
end
cowsay(i = 'Hello world!') click to toggle source
#

AsciiParadise.cowsay

The ascii cow will say the given text.

Invocation example:

AsciiParadise.cowsay 'I am a happy cow!'
#
# File lib/ascii_paradise/ascii_say/say.rb, line 124
def self.cowsay(i = 'Hello world!')
  say(i, :cow)
end
dancing_girl(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.dancing_girl

#
# File lib/ascii_paradise/animations/dancing_girl.rb, line 39
def self.dancing_girl(commandline_arguments = ARGV)
  DancingGirl.new(commandline_arguments)
end
debug?() click to toggle source
#

AsciiParadise.debug?

Query the debug value here.

#
# File lib/ascii_paradise/debug/debug.rb, line 22
def self.debug?
  @debug
end
demo(delay = 12) click to toggle source
#

AsciiParadise.demo (demo tag, test tag)

We can use this method to demo what the AsciiParadise is capable of doing.

#
# File lib/ascii_paradise/demo/demo.rb, line 21
def self.demo(delay = 12) # 12 Seconds between individual runs.
  if delay.is_a? Hash
    if delay.has_key? :delay
      delay = delay.delete :delay
    end
  end
  e 'We will next test the various components of the AsciiParadise project.'
  e
  e 'We will display a short header to explain which component we will test.'
  e
  e 'Next we test '+sfancy('AsciiParadise.seductive_lady')+':'
  AsciiParadise.seductive_lady
  e 'Next we test '+sfancy('AsciiParadise.attractive_lady')+':'
  AsciiParadise.attractive_lady
  # ======================================================================= #
  # === Next, show the Mona Lisa, as ASCII art.
  # ======================================================================= #
  e 
  e 'Next, we show the Mona Lisa, via AsciiParadise.mona_lisa'
  e AsciiParadise.mona_lisa
  e
  # ======================================================================= #
  # === Next, showing the pink panther.
  # ======================================================================= #
  e
  e 'Next, showing the the pink panther:'
  AsciiParadise.pink_panther
  e
  e 'Next we try '+sfancy('AsciiParadise.ascii_counter')+':'
  AsciiParadise.ascii_counter(delay)
  e # Need this newline here.
  e 'Next we test '+sfancy('AsciiParadise.ascii_box')+':'
  AsciiParadise.ascii_box ['Hello World!', 'what a big world']
  e 'Next we test '+sfancy('AsciiParadise.draw_heart')+':'
  AsciiParadise.draw_heart size: 25
  e 'Next we test '+sfancy('AsciiParadise.sierpinski_triangle (size: 25)')+':'
  AsciiParadise.sierpinski_triangle size: 25
  e 'Next we test '+sfancy('AsciiParadise.beautiful_pattern')+':'
  AsciiParadise.beautiful_pattern
  e
  e 'Next we test '+sfancy('AsciiParadise.ascii_circle')+': (radius will be 25)'
  AsciiParadise.ascii_circle(25)
  e
  e 'Next we test AsciiParadise.progress_bar:'
  AsciiParadise.progress_bar
  e
  e 'Next we test AsciiParadise.rotating_slash:'
  AsciiParadise.rotating_slash
  e 'Next we test AsciiParadise.rotating_dna :dna:'
  AsciiParadise.rotating_dna :dna
  e
  e 'Next we test AsciiParadise.rotating_dna :star:'
  AsciiParadise.rotating_dna :star
  # =========================================================================== #
  # === ASCII Animations
  #
  # At this point come the various ASCII-animations.
  # =========================================================================== #
  e 'Next we test AsciiParadise.volcano:'
  AsciiParadise.volcano {{ run_n_times: 10 }} # Run 10 times.
  e 'Next we test AsciiParadise.earth:'
  AsciiParadise.earth   {{ run_n_times:  6 }}
  e 'Next we test AsciiParadise.steamer:'
  AsciiParadise.steamer {{ run_n_times:  6 }}
  e 'Next we test AsciiParadise.animated_clock:'
  AsciiParadise.animated_clock {{ run_n_times: 10 }} # Run 10 times.
  e 'Next we test AsciiParadise.bubble_dragon:'
  AsciiParadise.bubble_dragon_animation
  e 'Next we test AsciiParadise.swimming_lane:'
  AsciiParadise.swimming_lane
  e 'Next we test AsciiParadise.animated_cigarette:'
  AsciiParadise.animated_cigarette
  e 'Next we test AsciiParadise.animated_pacman:'
  AsciiParadise.animated_pacman
  e 'Next we test AsciiParadise.animated_duck:'
  AsciiParadise.animated_duck
  e 'Next testing animated progress bar'
  AsciiParadise.animated_progress_bar
  e 'Next we test AsciiParadise.dancing_girl (we will wait 8 seconds before doing so):'
  sleep delay
  AsciiParadise.dancing_girl
  # Pacman-dance also blocks the screen.
  e 'Next we test AsciiParadise.static_pacman:'
  AsciiParadise.static_pacman
  e 'Next, table flip:'
  AsciiParadise.table_flip
end
digital_clock(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.digital_clock

#
# File lib/ascii_paradise/animations/digital_clock.rb, line 39
def self.digital_clock(commandline_arguments = ARGV)
  DigitalClock.new(commandline_arguments)
end
disable_debug() click to toggle source
#

AsciiParadise.disable_debug

#
# File lib/ascii_paradise/debug/debug.rb, line 29
def self.disable_debug
  @debug = false
end
diver(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.diver

#
# File lib/ascii_paradise/animations/diver.rb, line 39
def self.diver(commandline_arguments = ARGV)
  Diver.new(commandline_arguments)
end
dot_factory(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.dot_factory

#
# File lib/ascii_paradise/animations/dot_factory.rb, line 40
def self.dot_factory(commandline_arguments = ARGV)
  DotFactory.new(commandline_arguments)
end
driving_car(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.driving_car

#
# File lib/ascii_paradise/animations/driving_car.rb, line 39
def self.driving_car(commandline_arguments = ARGV)
  DrivingCar.new(commandline_arguments)
end
e(i = '') click to toggle source
#

AsciiParadise.e

#
# File lib/ascii_paradise/toplevel_methods/e.rb, line 12
def self.e(i = '')
  puts i
end
earth(i = ARGV) click to toggle source
#

AsciiParadise.earth

#
# File lib/ascii_paradise/animations/earth.rb, line 39
def self.earth(i = ARGV)
  Earth.new(i)
end
efiglet(i) click to toggle source
#

AsciiParadise.efiglet

This is as figlet(), but it will output the result.

#
# File lib/ascii_paradise/toplevel_methods/figlet.rb, line 78
def self.efiglet(i)
  e figlet(i)
end
embeddable_interface() click to toggle source
#

AsciiParadise.embeddable_interface

#
# File lib/ascii_paradise/www/embeddable_interface.rb, line 123
def self.embeddable_interface
  object = Object.new
  object.extend(::AsciiParadise::EmbeddableInterface)
  #object.extend(::HtmlTags)
  return object
end
enable_debug( optional_be_verbose = false ) click to toggle source
#

AsciiParadise.enable_debug

The first argument determines whether we will give a notification to the user, when he wants to have it. By default, no notification will be made, to lessen the noise-level.

This method will enable debug all across the AsciiParadise components.

#
# File lib/ascii_paradise/debug/debug.rb, line 42
def self.enable_debug(
    optional_be_verbose = false
  )
  case optional_be_verbose
  when :be_verbose
    optional_be_verbose = true
  end
  if optional_be_verbose
    e 'We will now debug when we run code from the AsciiParadise project.'
  end
  @debug = true
end
endless_monkey_bars(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.endless_monkey_bars

#
# File lib/ascii_paradise/animations/endless_monkey_bars.rb, line 39
def self.endless_monkey_bars(commandline_arguments = ARGV)
  EndlessMonkeyBars.new(commandline_arguments)
end
endless_runner(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.endless_runner

#
# File lib/ascii_paradise/animations/endless_runner.rb, line 40
def self.endless_runner(commandline_arguments = ARGV)
  EndlessRunner.new(commandline_arguments)
end
exploding_alien(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.exploding_alien

#
# File lib/ascii_paradise/animations/exploding_alien.rb, line 39
def self.exploding_alien(commandline_arguments = ARGV)
  ExplodingAlien.new(commandline_arguments)
end
exploding_bubbles(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.exploding_bubbles

#
# File lib/ascii_paradise/animations/exploding_bubbles.rb, line 39
def self.exploding_bubbles(commandline_arguments = ARGV)
  ExplodingBubbles.new(commandline_arguments)
end
eye_wiggling(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.eye_wiggling

#
# File lib/ascii_paradise/animations/eye_wiggling.rb, line 39
def self.eye_wiggling(commandline_arguments = ARGV)
  EyeWiggling.new(commandline_arguments)
end
figlet( i, optional_use_this_font = nil ) click to toggle source
#

AsciiParadise.figlet

This method requires the program called 'figlet' installed - otherwise it will not work. If you wish to add more fonts then you can download them from websites such as www.jave.de/figlet/fonts/overview.html or other sites.

Figlet is a text-to-ASCII “symbols” converter. To make use of fonts, you can issue something like this:

figlet -w 120 -f ~/Downloads/broadway.flf

The first argument to this method should be a String. This string will be “figletized” - that is, converted into an ASCII representation.

The second (optional) argument can be used to specify the path to a locally existing .flf file (font file).

Note that this method will return a String.

The following list shows some fonts which I consider as useful; many other fonts are quite crappy, though.

Invocation examples:

AsciiParadise.figlet 'Wikipedia'
AsciiParadise.figlet 'Wikipedia', '3d_diagonal'
AsciiParadise.figlet 'Wikipedia', :acrobatic
AsciiParadise.figlet 'Wikipedia', :alpha
AsciiParadise.figlet 'Wikipedia', :broadway
AsciiParadise.figlet 'Wikipedia', :colossal
AsciiParadise.figlet 'Wikipedia', :doh
AsciiParadise.figlet 'Wikipedia', 'Georgia11'
AsciiParadise.figlet 'Wikipedia', 'pebbles'
AsciiParadise.figlet 'Wikipedia', 'univers'
#
# File lib/ascii_paradise/toplevel_methods/figlet.rb, line 49
def self.figlet(
    i, optional_use_this_font = nil
  )
  if i.is_a? Array
    i = i.join(' ').strip
  end
  cmd_to_use = 'figlet -t'.dup
  if optional_use_this_font
    unless optional_use_this_font.include? '/'
      # =================================================================== #
      # Use a hardcoded path in this case.
      # =================================================================== #
      optional_use_this_font.prepend('/Depot/jjj/fonts/')
    end
    cmd_to_use << ' -f '+optional_use_this_font.to_s
    unless cmd_to_use.end_with? '.flf'
      cmd_to_use << '.flf'
    end
  end
  cmd_to_use << " #{i}"
  result = `#{cmd_to_use}`
  return result
end
fire(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.fire

#
# File lib/ascii_paradise/animations/fire.rb, line 40
def self.fire(commandline_arguments = ARGV)
  Fire.new(commandline_arguments)
end
firework_clock(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.firework_clock

#
# File lib/ascii_paradise/animations/firework_clock.rb, line 39
def self.firework_clock(commandline_arguments = ARGV)
  FireworkClock.new(commandline_arguments)
end
firework_launcher(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.firework_launcher

#
# File lib/ascii_paradise/animations/firework_launcher.rb, line 39
def self.firework_launcher(commandline_arguments = ARGV)
  FireworkLauncher.new(commandline_arguments)
end
fireworks(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.fireworks

#
# File lib/ascii_paradise/animations/fireworks.rb, line 39
def self.fireworks(commandline_arguments = ARGV)
  Fireworks.new(commandline_arguments)
end
flame_thrower(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.flame_thrower

#
# File lib/ascii_paradise/animations/flame_thrower.rb, line 39
def self.flame_thrower(commandline_arguments = ARGV)
  FlameThrower.new(commandline_arguments)
end
flexbox(i, &block) click to toggle source
#

AsciiParadise.flexbox

#
# File lib/ascii_paradise/flexbox/flexbox.rb, line 1577
def self.flexbox(i, &block)
  AsciiParadise::Flexbox.new(i, &block).display
end
flower_decoration(i = 'Hello world!') click to toggle source
#

AsciiParadise.flower_decoration

Invocation example:

AsciiParadise.flower_decoration(("Once upon a time ... \n there were three evil witches."*10))
#
# File lib/ascii_paradise/ascii_say/say.rb, line 150
def self.flower_decoration(i = 'Hello world!')
  say(i, :flower_decoration)
end
flying_head(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.flying_head

#
# File lib/ascii_paradise/animations/flying_head.rb, line 39
def self.flying_head(commandline_arguments = ARGV)
  FlyingHead.new(commandline_arguments)
end
framerate_walking(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.framerate_walking

#
# File lib/ascii_paradise/animations/framerate_walking.rb, line 40
def self.framerate_walking(commandline_arguments = ARGV)
  FramerateWalking.new(commandline_arguments)
end
friendly_monkey(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.friendly_monkey

#
# File lib/ascii_paradise/animations/friendly_monkey.rb, line 39
def self.friendly_monkey(commandline_arguments = ARGV)
  FriendlyMonkey.new(commandline_arguments)
end
gargoyle(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.gargoyle

#
# File lib/ascii_paradise/animations/gargoyle.rb, line 39
def self.gargoyle(commandline_arguments = ARGV)
  Gargoyle.new(commandline_arguments)
end
genie(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.genie

#
# File lib/ascii_paradise/animations/genie.rb, line 39
def self.genie(commandline_arguments = ARGV)
  Genie.new(commandline_arguments)
end
good_morning(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.good_morning

#
# File lib/ascii_paradise/animations/good_morning.rb, line 39
def self.good_morning(commandline_arguments = ARGV)
  GoodMorning.new(commandline_arguments)
end
hadouken(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.hadouken

#
# File lib/ascii_paradise/animations/hadouken.rb, line 39
def self.hadouken(commandline_arguments = ARGV)
  Hadouken.new(commandline_arguments)
end
hand_of_god(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.hand_of_god

#
# File lib/ascii_paradise/animations/hand_of_god.rb, line 39
def self.hand_of_god(commandline_arguments = ARGV)
  HandOfGod.new(commandline_arguments)
end
have_the_animations_files_been_required?() click to toggle source
#

AsciiParadise.have_the_animations_files_been_required?

#
# File lib/ascii_paradise/requires/require_animations_files.rb, line 20
def self.have_the_animations_files_been_required?
  @have_the_animations_files_been_required
end
hourglass(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.hourglass

#
# File lib/ascii_paradise/animations/hourglass.rb, line 39
def self.hourglass(commandline_arguments = ARGV)
  Hourglass.new(commandline_arguments)
end
human_factory(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.human_factory

#
# File lib/ascii_paradise/animations/human_factory.rb, line 40
def self.human_factory(commandline_arguments = ARGV)
  HumanFactory.new(commandline_arguments)
end
include_this_file?(i) click to toggle source
#

AsciiParadise.include_this_file?

This method can be used to determine whether we do include a specific file. Any '-' tokens in the input will be ignored, thus allowing you to more easily search for the name of the file at hand.

Usage example:

AsciiParadise.include_this_file? '--endless_runner'
AsciiParadise.include_this_file? '--volcano' # => true
#
# File lib/ascii_paradise/toplevel_methods/misc.rb, line 27
def self.include_this_file?(i)
  i = File.basename(i.to_s.delete('-'))
  files = Dir[project_base_dir?+'animations/*.rb'].map {|entry|
    File.basename(entry)
  }
  files.any? {|filename| filename.include? i }
end
initialize_the_animated_ascii_components() click to toggle source
#

AsciiParadise.initialize_the_animated_ascii_components

This method will initialize all the animated ASCII components, but only if this has not yet been done.

#
# File lib/ascii_paradise/requires/require_animations_files.rb, line 30
def self.initialize_the_animated_ascii_components
  unless @have_the_animations_files_been_required
    require_animations_files
  end
end
interactive() click to toggle source
#

AsciiParadise.interactive

Use this method if you want to ask interactively what component we should run next.

#
# File lib/ascii_paradise/interactive/interactive.rb, line 26
def self.interactive
  @show_this_message_on_exit = 'We will exit now, as requested.'
  register_sigint
  initialize_animated_ascii_components
  ask_the_user_which_component_should_be_run_next
end
intercourse(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.intercourse

#
# File lib/ascii_paradise/animations/intercourse.rb, line 39
def self.intercourse(commandline_arguments = ARGV)
  Intercourse.new(commandline_arguments)
end
jello(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.jello

#
# File lib/ascii_paradise/animations/jello.rb, line 39
def self.jello(commandline_arguments = ARGV)
  Jello.new(commandline_arguments)
end
juggling(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.juggling

#
# File lib/ascii_paradise/animations/juggling.rb, line 39
def self.juggling(commandline_arguments = ARGV)
  Juggling.new(commandline_arguments)
end
jump_rope(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.jump_rope

#
# File lib/ascii_paradise/animations/jump_rope.rb, line 39
def self.jump_rope(commandline_arguments = ARGV)
  JumpRope.new(commandline_arguments)
end
jumping_pig(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.jumping_pig

#
# File lib/ascii_paradise/animations/jumping_pig.rb, line 38
def self.jumping_pig(commandline_arguments = ARGV)
  JumpingPig.new(commandline_arguments)
end
laser_clock(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.last_clock

#
# File lib/ascii_paradise/animations/laser_clock.rb, line 39
def self.laser_clock(commandline_arguments = ARGV)
  LaserClock.new(commandline_arguments)
end
lightning_bolt(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.lightning_bolt

#
# File lib/ascii_paradise/animations/lightning_bolt.rb, line 51
def self.lightning_bolt(commandline_arguments = ARGV)
  LightningBolt.new(commandline_arguments)
end
loading_dots(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.loading_dots

#
# File lib/ascii_paradise/animations/loading_dots.rb, line 39
def self.loading_dots(commandline_arguments = ARGV)
  LoadingDots.new(commandline_arguments)
end
lobster(i = ARGV) click to toggle source
#

AsciiParadise.lobster

#
# File lib/ascii_paradise/misc/lobster.rb, line 107
def self.lobster(i = ARGV)
  AsciiParadise::Lobster.new(i)
end
macarena(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.macarena

#
# File lib/ascii_paradise/animations/macarena.rb, line 39
def self.macarena(commandline_arguments = ARGV)
  Macarena.new(commandline_arguments)
end
mediumpurple(i = '') click to toggle source
#

AsciiParadise.mediumpurple

#
# File lib/ascii_paradise/colours/colours.rb, line 50
def self.mediumpurple(i = '')
  Colours.mediumpurple(i)
end
menu( i = ARGV ) click to toggle source
#

AsciiParadise.menu (menu tag)

This method can be used to parse the commandline arguments given to the AsciiParadise project, whenever a user invokes the executable called “ascii_paradise”.

#
mona_lisa() click to toggle source
#

AsciiParadise.mona_lisa

#
# File lib/ascii_paradise/static_ascii/mona_lisa.rb, line 28
def self.mona_lisa
  AsciiParadise::MonaLisa.new
end
moth(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.moth

#
# File lib/ascii_paradise/animations/moth.rb, line 39
def self.moth(commandline_arguments = ARGV)
  Moth.new(commandline_arguments)
end
n_animated_ascii_components() click to toggle source
#

AsciiParadise.n_animated_ascii_components

This method will return a number, which tells us how many ASCII components are registered in this project.

#
# File lib/ascii_paradise/toplevel_methods/available_ascii_components.rb, line 51
def self.n_animated_ascii_components
  ::AsciiParadise.available_ascii_components?.size
end
n_animated_components?() click to toggle source
#

AsciiParadise.n_animated_components?

This will return how many animated components we have.

#
# File lib/ascii_paradise/toplevel_methods/n_animated_components.rb, line 17
def self.n_animated_components? # 66
  files = Dir[
    AsciiParadise.animations_subdirectory?+'*.rb'
  ]
  files.size # Return how many entries we have found here.
end
neverending_staircase(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.neverending_staircase

#
# File lib/ascii_paradise/animations/neverending_staircase.rb, line 39
def self.neverending_staircase(commandline_arguments = ARGV)
  NeverendingStaircase.new(commandline_arguments)
end
new(i = ARGV) click to toggle source
#

AsciiParadise.new

This is a simpler toplevel-instantiation variant.

#
# File lib/ascii_paradise/toplevel_methods/new.rb, line 15
def self.new(i = ARGV)
  ::AsciiParadise.run_this_animated_component(
    i.map {|entry|
      entry.to_s.delete(':')
    }
  )
end
one_destroyer(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.one_destroyer

#
# File lib/ascii_paradise/animations/one_destroyer.rb, line 39
def self.one_destroyer(commandline_arguments = ARGV)
  OneDestroyer.new(commandline_arguments)
end
parachute_jump(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.parachute_jump

#
# File lib/ascii_paradise/animations/parachute_jump.rb, line 39
def self.parachute_jump(commandline_arguments = ARGV)
  ParachuteJump.new(commandline_arguments)
end
phone(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.phone

#
# File lib/ascii_paradise/animations/phone.rb, line 40
def self.phone(commandline_arguments = ARGV)
  Phone.new(commandline_arguments)
end
pink_panther() click to toggle source
#

AsciiParadise.pink_panther

#
# File lib/ascii_paradise/static_ascii/pink_panther.rb, line 48
def self.pink_panther
  AsciiParadise::PinkPanther.run
end
planting_a_forest(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.planting_a_forest

#
# File lib/ascii_paradise/animations/planting_a_forest.rb, line 39
def self.planting_a_forest(commandline_arguments = ARGV)
  PlantingAForest.new(commandline_arguments)
end
ponies() click to toggle source
#

AsciiParadise.ponyies

#
# File lib/ascii_paradise/static_ascii/ponies.rb, line 50
def self.ponies
  AsciiParadise::Ponies.new
end
ponysay(i = 'Hello world!') click to toggle source
#

AsciiParadise.ponysay

The ascii pony will say the given text.

Invocation example:

AsciiParadise.ponysay 'I am a happy pony!'
#
# File lib/ascii_paradise/ascii_say/say.rb, line 138
def self.ponysay(i = 'Hello world!')
  say(i, :pony)
end
progress_bar() click to toggle source
#

AsciiParadise.progress_bar

You can also invoke this method via:

AsciiParadise.progressbar
#
# File lib/ascii_paradise/animations/progress_bar.rb, line 91
def self.progress_bar
  ProgressBar.new
end
project_base_dir?() click to toggle source
#

AsciiParadise.project_base_dir?

#
# File lib/ascii_paradise/project/project.rb, line 19
def self.project_base_dir?
  PROJECT_BASE_DIRECTORY
end
pull_rope(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.pull_rope

#
# File lib/ascii_paradise/animations/pull_rope.rb, line 39
def self.pull_rope(commandline_arguments = ARGV)
  PullRope.new(commandline_arguments)
end
raindrop(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.raindrop

#
# File lib/ascii_paradise/animations/raindrop.rb, line 39
def self.raindrop(commandline_arguments = ARGV)
  Raindrop.new(commandline_arguments)
end
raining(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.raining

#
# File lib/ascii_paradise/animations/raining.rb, line 39
def self.raining(commandline_arguments = ARGV)
  Raining.new(commandline_arguments)
end
reflection(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.reflection

#
# File lib/ascii_paradise/animations/reflection.rb, line 39
def self.reflection(commandline_arguments = ARGV)
  Reflection.new(commandline_arguments)
end
register(name, template) click to toggle source
#

AsciiParadise.register

The second argument to this method is the path to the .ascii file in question, the template that we will use for the speak-bubble.

#
# File lib/ascii_paradise/ascii_say/parse_static_ascii.rb, line 243
def self.register(name, template)
  AsciiParadise.const_set(
    name, AsciiParadise::ParseStaticAscii.new(template)
  )
end
register_sigint( show_this_message_on_exit = @show_this_message_on_exit ) click to toggle source
#

AsciiParadise.register_sigint

#
# File lib/ascii_paradise/toplevel_methods/register_sigint.rb, line 19
def self.register_sigint(
    show_this_message_on_exit = @show_this_message_on_exit
  )
  Signal.trap('SIGINT') {
    if show_this_message_on_exit
      e show_this_message_on_exit
    end
    exit
  }
end
require_animations_files() click to toggle source
#

AsciiParadise.require_animations_files

#
# File lib/ascii_paradise/requires/require_animations_files.rb, line 39
def self.require_animations_files
  # ======================================================================= #
  # Pull in all the subcomponents within the "ascii_paradise/animations/"
  # directory next.
  # ======================================================================= #
  Dir["#{project_base_dir?}animations/*.rb"].each {|file|
    require "ascii_paradise/animations/#{File.basename(file)}"
  }
  @have_the_animations_files_been_required = true
end
require_sparky_components() click to toggle source
#

AsciiParadise.require_sparky_components

#
# File lib/ascii_paradise/requires/require_sparky_components.rb, line 12
def self.require_sparky_components
  require 'ascii_paradise/sparky/sparkline.rb'
end
require_static_ascii_files() click to toggle source
#

AsciiParadise.require_static_ascii_files

#
# File lib/ascii_paradise/requires/require_static_ascii_files.rb, line 14
def self.require_static_ascii_files
  # ======================================================================= #
  # Pull in all the subcomponents within the "ascii_paradise/static/"
  # directory next.
  # ======================================================================= #
  Dir["#{AsciiParadise.static_ascii?}*.rb"].each {|file|
    require "ascii_paradise/static_ascii/#{File.basename(file)}"
  }
end
require_the_toplevel_methods() click to toggle source
#

AsciiParadise.require_the_toplevel_methods

#
# File lib/ascii_paradise/requires/require_the_toplevel_methods.rb, line 17
def self.require_the_toplevel_methods
  Dir["#{AsciiParadise::PROJECT_BASE_DIRECTORY}toplevel_methods/*.rb"].each {|this_file|
    require "ascii_paradise/toplevel_methods/#{File.basename(this_file)}"
  }
end
return_all_animated_ascii_components() click to toggle source
#

AsciiParadise.return_all_animated_ascii_components

This method will return all AsciiParadise components that can be animated.

For now we assume that this will only work for all those components that are a subclass of class AsciiParadise::Animation.

Usage example:

x = AsciiParadise.return_all_animated_ascii_components
#
# File lib/ascii_paradise/toplevel_methods/available_ascii_components.rb, line 69
def self.return_all_animated_ascii_components
  # ======================================================================= #
  # First obtain the available candidates:
  # ======================================================================= #
  possible_candidates = available_ascii_components?
  # ======================================================================= #
  # Turn these into real constants, via const_get(). In order for this
  # to work, the whole dataset has to be initialized for these individual
  # classes.
  # ======================================================================= #
  possible_candidates.map! {|entry|
    if ::AsciiParadise.const_defined? entry.to_sym
      entry = ::AsciiParadise.const_get(entry)
    end
    entry
  }
  possible_candidates.compact!
  # ======================================================================= #
  # Next select the proper entries that contain the dataset.:
  # ======================================================================= #
  possible_candidates.select! {|entry|
    entry.is_animated?
  }
  # ======================================================================= #
  # Now we have the entries that we want to have, thus we can return them.
  # ======================================================================= #
  return possible_candidates
end
return_dataset_of_this_animated_ascii_component( i = :volcano, convert_to_camelcase = true ) click to toggle source
#

AsciiParadise.return_dataset_of_this_animated_ascii_component

This method can retrieve the dataset of a given animated ASCII component. This ASCII component must have been registered, though,

The argument to this method should be camelcased, e. g. :RubberDuck rather than :rubber_duck. In order to simplify the use of the API, the user can also send :rubber_duck, though.

A String can also be passed into this method, such as 'RubberDuck', but it is recommended to use Symbols, if possible, such as :rubber_duck or :RubberDuck.

Usage example:

dataset = AsciiParadise.dataset_for(:rubber_duck)
dataset = AsciiParadise.dataset_for(:table_tennis)
dataset = AsciiParadise.dataset_for('TableTennis')
dataset = AsciiParadise.return_dataset_of_this_animated_ascii_component(:volcano)
#
# File lib/ascii_paradise/toplevel_methods/return_dataset_of_this_animated_ascii_component.rb, line 35
def self.return_dataset_of_this_animated_ascii_component(
    i                    = :volcano, # :rubber_duck,
    convert_to_camelcase = true
  )
  case convert_to_camelcase
  when :do_not_uppercase
    convert_to_camelcase = false
  end
  if i.is_a? Array
    i = i.first
  end
  # ======================================================================= #
  # Initialize the animated ASCII components next:
  # ======================================================================= #
  initialize_the_animated_ascii_components

  i = i.to_s
  i = to_camelcase(i) if convert_to_camelcase
  unless AsciiParadise.respond_to? i
    array_available_ascii_components = AsciiParadise.available_ascii_components?
    # ===================================================================== #
    # Try to find a fitting component in this case.
    # ===================================================================== #
    possible_matches = array_available_ascii_components.map {|inner_entry|
      inner_entry.to_s.downcase
    }.select {|entry| entry.include? i.to_s.downcase }
    if !possible_matches.empty?
      # =================================================================== #
      # In this case we have at the least one partial match.
      # =================================================================== #
      i = array_available_ascii_components.select {|entry|
        entry.to_s.downcase.include?(i.to_s.downcase)
      }
      if i.is_a? Array
        i = i.first
      end
    end
  end
  if AsciiParadise.respond_to? i
    instance = AsciiParadise.send(i)
    # ======================================================================= #
    # The dataset that will be returned is an Array.
    # ======================================================================= #
    dataset = instance.new { :do_not_run_yet }.dataset?
    return dataset
  else
    e "Not an animated component (#{i})."
    false
  end
end
return_what_is_available() click to toggle source
#

AsciiParadise.return_what_is_available

#
# File lib/ascii_paradise/toplevel_methods/show_available_ascii_components.rb, line 95
def self.return_what_is_available
  target = ::AsciiParadise.animations_directory?
  array = []
  # ======================================================================= #
  # Next, obtain all entries residing in the Animations directory.
  # ======================================================================= #
  Dir["#{target}*.rb"].each {|file|
    # ===================================================================== #
    # Next, we modify it a bit, by getting rid of leading "ascii_" and
    # trailing ".rb" part, then capitalizing it:
    # ===================================================================== #
    _ = File.basename(file).sub(/^ascii_/,'').sub(/\.rb$/,'').capitalize.dup
    # ===================================================================== #
    # Followed by camelcasing it:
    # ===================================================================== #
    if _.include? '_'
      _ = _.split('_').map {|e| e.capitalize }.join
    end
    array << _ # And adding it to our Array. \o/
  }
  return array 
end
riding_a_duck(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.riding_a_duck

#
# File lib/ascii_paradise/animations/riding_a_duck.rb, line 39
def self.riding_a_duck(commandline_arguments = ARGV)
  RidingADuck.new(commandline_arguments)
end
rotating_cube(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.rotating_cube

#
# File lib/ascii_paradise/animations/rotating_cube.rb, line 39
def self.rotating_cube(commandline_arguments = ARGV)
  RotatingCube.new(commandline_arguments)
end
rotating_dna(runmode = :dna) click to toggle source
#

AsciiParadise.rotating_dna

#
# File lib/ascii_paradise/animations/rotating_dna.rb, line 180
def self.rotating_dna(runmode = :dna)
  AsciiParadise::RotatingDNA[runmode]
end
rotating_slash() click to toggle source
#

AsciiParadise.rotating_slash

#
# File lib/ascii_paradise/animations/rotating_slash.rb, line 99
def self.rotating_slash
  AsciiParadise::RotatingSlash.new
end
rubber_duck(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.rubber_duck

#
# File lib/ascii_paradise/animations/rubber_duck.rb, line 39
def self.rubber_duck(commandline_arguments = ARGV)
  RubberDuck.new(commandline_arguments)
end
run_class_based_on_this_filename(i) click to toggle source
#

AsciiParadise.run_class_based_on_this_filename

This method should only be called after a prior call to AsciiParadise.include_this_file?().

#
# File lib/ascii_paradise/toplevel_methods/run_class_based_on_this_filename.rb, line 17
def self.run_class_based_on_this_filename(i)
  if i.is_a? Array
    i = i.first
  end
  # ======================================================================= #
  # First, obtain the proper filename.
  # ======================================================================= #
  i = File.basename(i.to_s.delete('-'))
  i.sub!(/#{File.extname(i)}$/,'')
  run_this_animated_component(i)
end
run_random_animation() click to toggle source
#

AsciiParadise.run_random_animation

This method can be used to run a random animation.

#
# File lib/ascii_paradise/toplevel_methods/run_this_animated_component.rb, line 111
def self.run_random_animation
  _ = available_ascii_components?.sample
  run_this_animated_component(_)
end
run_this_animated_component( i = :default ) { || ... } click to toggle source
#

AsciiParadise.run_this_animated_component

This toplevel method can be used to run an animated component of the AsciiParadise project. The main purpose is, primarily, to allow this from the commandline directly, so that it can be used from the file residing at bin/ascii_paradise directly.

The API use may be like this:

AsciiParadise.run_this_animated_component '--endless_runner'
AsciiParadise.run_this_animated_component '--chopper'

Note that you can also obtain individual frames, like this:

AsciiParadise.run(:spider) { :frame5 }
AsciiParadise.run(:spider) { 5 }

This component will be returned.

#
# File lib/ascii_paradise/toplevel_methods/run_this_animated_component.rb, line 34
def self.run_this_animated_component(
    i = :default
  )
  if i.is_a? Array
    i = i.join(' ').strip # Aggregate the Array into a String.
  end
  case i
  when :default
    i = 'endless_runner' # This is the default value.
  end
  require 'abbrev'
  array_available_constants = available_ascii_components?
  this_constant = i.to_s.delete('-') # This will now be something like "endless_runner".
  case this_constant # Use some popular aliases/shortcuts.
  when 'tennis'
    this_constant = 'table_tennis'
  end
  if this_constant.include? '_' # This requires a camelcase-operation!
    this_constant = to_camelcase(this_constant)
  end
  unless array_available_constants.include? this_constant
    # ===================================================================== #
    # In this case, the input was not found, so we will try to
    # abbrev-find something more useful.
    # ===================================================================== #
    flattened = Abbrev.abbrev(array_available_constants).flatten
    alternatives = Hash[*flattened.sort]
    if alternatives.has_key? this_constant
      # =================================================================== #
      # Ok, the hash includes that key, so find the real constant next.
      # =================================================================== #
      this_constant = alternatives[this_constant]
    end
  end
  if this_constant.include? '=' # In this case, assume input such as "colour=slateblue"
    # ======================================================================= #
    # Pass through in this case. Not sure if this is still in use or not,
    # though.
    # ======================================================================= #
  else
    # ======================================================================= #
    # In a constant, the first character is ALWAYS upcased. The following
    # line ensures this to be the case.
    # ======================================================================= #
    this_constant = this_constant.dup if this_constant.frozen?
    this_constant[0,1] = this_constant[0,1].upcase
    # ======================================================================= #
    # Ensure that the animated ASCII components are initialized next.
    # ======================================================================= #
    initialize_the_animated_ascii_components
    if ::AsciiParadise.const_defined? this_constant
      yielded = nil
      if block_given?
        yielded = yield
      end
      if yielded
        if yielded.is_a? Symbol
          # Assume a symbol such as: frame5
          if yielded.to_s.start_with?('frame')
            yielded = yielded.to_s.sub(/^frame/,'').to_i
          end
        end
        if yielded.is_a? Numeric
          _ = AsciiParadise.return_dataset_of_this_animated_ascii_component(this_constant)
          return _[yielded - 1]
        end
      end
      ::AsciiParadise.send(this_constant).animate # We will make use of the .animate method.
    end
  end
end
running_man(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.running_man

#
# File lib/ascii_paradise/animations/running_man.rb, line 39
def self.running_man(commandline_arguments = ARGV)
  RunningMan.new(commandline_arguments)
end
sailing_boat(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.sailing_boat

#
# File lib/ascii_paradise/animations/sailing_boat.rb, line 39
def self.sailing_boat(commandline_arguments = ARGV)
  SailingBoat.new(commandline_arguments)
end
sand_clock(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.sand_clock

#
# File lib/ascii_paradise/animations/sand_clock.rb, line 39
def self.sand_clock(commandline_arguments = ARGV)
  SandClock.new(commandline_arguments)
end
seductive_lady() click to toggle source
#

AsciiParadise.seductive_lady

#
# File lib/ascii_paradise/static_ascii/seductive_lady.rb, line 37
def self.seductive_lady
  AsciiParadise::SeductiveLady.new
end
seesaw(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.seesaw

#
# File lib/ascii_paradise/animations/seesaw.rb, line 39
def self.seesaw(commandline_arguments = ARGV)
  Seesaw.new(commandline_arguments)
end
set_colour(i = nil) click to toggle source
#

AsciiParadise.set_colour

#
# File lib/ascii_paradise/colours/colours.rb, line 36
def self.set_colour(i = nil)
  @colour = i
end
sfancy(i) click to toggle source
#

AsciiParadise.sfancy

#
# File lib/ascii_paradise/colours/colours.rb, line 71
def self.sfancy(i)
  Colours.sfancy(i)
end
sfile(i) click to toggle source
#

AsciiParadise.sfile

#
# File lib/ascii_paradise/colours/colours.rb, line 64
def self.sfile(i)
  Colours.sfile(i)
end
shooting_range(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.shooting_range

#
# File lib/ascii_paradise/animations/shooting_range.rb, line 39
def self.shooting_range(commandline_arguments = ARGV)
  ShootingRange.new(commandline_arguments)
end
shotgun(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.shotgun

#
# File lib/ascii_paradise/animations/shotgun.rb, line 39
def self.shotgun(commandline_arguments = ARGV)
  Shotgun.new(commandline_arguments)
end
show_available_ascii_components( display_mode = :everything ) click to toggle source
#

AsciiParadise.show_available_ascii_components

This method will show the available ASCII classes.

Since as of March 2017, this class accepts an optional argument, which should be a Symbol. The default Symbol is :everything which means that we will display everything, including the LINKS.md file - on my home system at least.

If the argument is :show_only_ascii_components then we will only show the ASCII components of the project.

To invoke this, do:

aparadise --help
aparadise --show-available
#
# File lib/ascii_paradise/toplevel_methods/show_available_ascii_components.rb, line 33
def self.show_available_ascii_components(
    display_mode = :everything
  )
  target = ::AsciiParadise.animations_directory?
  if display_mode == :everything
    e 'The following classes are part of this project:'
    e
  end
  array = []
  # ======================================================================= #
  # Next, obtain all entries residing in the Animations directory.
  # ======================================================================= #
  Dir["#{target}*.rb"].each {|file|
    # ===================================================================== #
    # Next, we modify it a bit, by getting rid of leading "ascii_" and
    # trailing ".rb" part, then capitalizing it:
    # ===================================================================== #
    _ = File.basename(file).sub(/^ascii_/,'').sub(/\.rb$/,'').capitalize.dup
    # ===================================================================== #
    # Followed by camelcasing it:
    # ===================================================================== #
    if _.include? '_'
      _ = _.split('_').map {|e| e.capitalize }.join
    end
    array << _ # And adding it to our Array. \o/
  }
  # ======================================================================= #
  # Next, display that array in a sorted manner.
  # ======================================================================= #
  array.sort.each_with_index {|entry, _index|
    _index += 1
    case display_mode
    when :everything, :default
      e '  '+sfancy(entry)
    when :show_only_ascii_components
      e simp(_index.to_s.rjust(5))+') '+sfancy(entry)
    end
  }
  case display_mode
  # ======================================================================= #
  # === :everything
  # ======================================================================= #
  when :everything
    e
    # ===================================================================== #
    # === Next, display the LINKS.md file if it is available.
    #
    # This is the primary use case for :everything.
    # ===================================================================== #
    _ = "#{HOME_DIRECTORY_OF_THE_USER_X}DATA/PROGRAMMING_LANGUAGES/RUBY/src/ascii_paradise/doc/LINKS.md"
    if File.exist? _
      e 'Additionally, these links are available:'; e
      File.read(_).split(N).select {|entry| entry.start_with? '  '}.each {|file|
        e '  '+simp(file)
      }; e
    end
  end
end
show_help() click to toggle source
#

AsciiParadise.show_help

This method can be used to show the available help options in general.

It is a class-method primarily so that we can display the help options without having to instantiate a new class.

An invocation example for the method follows:

asciispider --help
#
# File lib/ascii_paradise/commandline/help.rb, line 25
def self.show_help
  e 'These options are available:'
  e
  array = [] # Store it in an Array, primarily so that we can run .sort on it.
  array << '  --run-n-times=()             # run n times'
  array << '  --no-clear                   # do not invoke "clear"; this '\
           'may be helpful for debugging'
  array << '  --wait-for-keypress          # wait for keypress events'
  array << '  --colour=green               # use a specific colour, in this example green'
  array << '  --colour=random-colour       # this is equivalent to --random-colour'
  array << '  --colourspray                # use a random colour during each (full) '\
           'iteration'
  array << '  --rainbow-line               # this option will colourize every '\
           'individual cell of a given frame'
  array << '  --disco-inferno              # change the colour during every iteration'
  array << '  --half-colour                # use two random colours, one '\
           'for the upper area, another for the lower area '
  array << '  --numbers                    # like --full-debug but also uses red '\
           '"frame numbers"'
  array << '  --random-colour              # use a random colour (useful if '\
           'you do not want to decide on any specific colour)'
  array << '  --overview                   # show the available components '\
           '(most of them at least)'
  array << '  --n_components?              # show how many components are '\
           'available (a number)'
  array << '  --interactive                # enter the interactive part '\
           'of AsciiParadise'
  array << '  --random                     # run a random component of '\
           'the AsciiParadise project'
  array << '  --show-frame=33              # show a specific frame, '\
           'in this case, frame 33'
  array << '  --framerate                  # query, in seconds, the delay '\
           'before the next frame is shown'
  array << '  --delay=2 (Float or Integer) # set the delay to 2 '\
           'seconds, in this case; use any number as input'
  array << '  --random                     # animate a random component'
  array.sort.each {|entry| e entry }
  # ======================================================================= #
  # Check if Konsole is available, as part of the Colours namespace.
  # ======================================================================= #
  unless Object.const_defined? :Colours
    e; e 'Note that you do not appear to have Colours available.'
       e 'This means that we will use normal ansicolours instead.'
  end
  e
end
show_interactive_help() click to toggle source
#

AsciiParadise.show_interactive_help (help tag)

This method will allow the user to select the relevant component to run.

#
# File lib/ascii_paradise/interactive/interactive.rb, line 39
def self.show_interactive_help
  e 'These interactive components are available:'
  e
  # ======================================================================= #
  # === Get a handle on all the ASCII components of this project next
  #
  # This requires that we initiate these components first when running
  # this interactive-component, which has been done before via
  # initialize_animated_ascii_components().
  # ======================================================================= #
  components = return_all_animated_ascii_components
  components.each_with_index {|entry, index|
    index += 1
    e index.to_s.rjust(4)+' '+Colours.simp(entry)
  }
  e
  e 'Please input the positional number only, such as "50", without '\
    'the "" quotes.'
  e
  e 'If you wish to use colours-gem, simply input the colour, '\
    'then press enter.'
  e 'All components from that point onwards will use this colour.'
  e 'Use "clear" to clear it again.'
  # e 'You can input either the full name, a partial name, or the '\
  #   'positional number.'
  # e
  # e 'So for instance, if you have this line here "50 AsciiParadise::Worm", '\
  #   'then'
  # e 'you can invoke this either by typing 50, by typing worm or Worm '\
  #   'but also'
  # e 'by typing AsciiParadise::Worm or AsciiParadise.Worm.'
end
sierpinski_triangle(size = 80) click to toggle source
#

AsciiParadise.sierpinski_triangle

#
# File lib/ascii_paradise/static_ascii/sierpinksi_triangle.rb, line 87
def self.sierpinski_triangle(size = 80)
  AsciiParadise::SierpinksiTriangle.new(size)
end
silent_city(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.silent_city

#
# File lib/ascii_paradise/animations/silent_city.rb, line 39
def self.silent_city(commandline_arguments = ARGV)
  SilentCity.new(commandline_arguments)
end
simp(i) click to toggle source
#

AsciiParadise.simp

#
# File lib/ascii_paradise/colours/colours.rb, line 57
def self.simp(i)
  Colours.simp(i)
end
soccer_in_front_of_a_house(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.SoccerInFrontOfAHouse

#
# File lib/ascii_paradise/animations/soccer_in_front_of_a_house.rb, line 40
def self.soccer_in_front_of_a_house(commandline_arguments = ARGV)
  SoccerInFrontOfAHouse.new(commandline_arguments)
end
soccer_twins(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.soccer_twins

#
# File lib/ascii_paradise/animations/soccer_twins.rb, line 39
def self.soccer_twins(commandline_arguments = ARGV)
  SoccerTwins.new(commandline_arguments)
end
sort_files(sort_these_files) click to toggle source
#

AsciiParadise.sort_files

This module-method will keep the files stored in the animations/ subdirectory properly sorted, from 01 etc.. to 100 and so on.

It will use a regex in order to achieve this.

#
# File lib/ascii_paradise/toplevel_methods/sort_files.rb, line 18
def self.sort_files(sort_these_files)
  sort_these_files.sort_by! {|entry|
    regex = /\/.+_(\d+).ascii$/ # See: http://rubular.com/r/9UfgCczgPi
    entry =~ regex
    number_value = $1.to_s.dup
    number_value.to_i
  }
end
sparky(numbers, &block) click to toggle source
#

AsciiParadise.sparky

This method will return a UTF-8 “sparky” line.

Invocation example:

array = [3, 33]
AsciiParadise.sparky(array)

Next, let's show an example with a block passed to the method:

Let's say you have your list of open and closed issues, but you want to format it so the open ones are red and the closed ones are green, so you can quickly see how you are doing. Let's further suppose you use a gem that adds a color method to String for ANSI coloring.

line = AsciiParadise.sparky(list) { |tick, count, index|
  if index == 0
    tick.color(:red)
  else
    tick.color(:green)
  end
}
line

@param numbers [Array<String, Fixnum, Float>] the numbers to be rendered @param &block [Proc] optional, can be used to format the rendered string

@return [String]

#
# File lib/ascii_paradise/sparky/sparkline.rb, line 152
def self.sparky(numbers, &block)
  new_sparky_instance = Sparky.new(numbers)
  # ======================================================================= #
  # Handle blocks given to this method.
  # ======================================================================= #
  if block
    new_sparky_instance.format(&block)
  end
  new_sparky_instance.to_s
end
spider(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.spider

#
# File lib/ascii_paradise/animations/spider.rb, line 39
def self.spider(commandline_arguments = ARGV)
  Spider.new(commandline_arguments)
end
star_trek(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.star_trek

#
# File lib/ascii_paradise/animations/star_trek.rb, line 40
def self.star_trek(commandline_arguments = ARGV)
  StarTrek.new(commandline_arguments)
end
static_ascii?() click to toggle source
#

AsciiParadise.static_ascii?

This method may resolve to a path such as:

"/Programs/Ruby/2.6.3/lib/ruby/site_ruby/2.6.0/ascii_paradise/static_ascii/"
#
# File lib/ascii_paradise/project/project.rb, line 54
def self.static_ascii?
  "#{::AsciiParadise.project_base_directory?}static_ascii/"
end
static_pacman() click to toggle source
#

AsciiParadise.static_pacman

#
# File lib/ascii_paradise/static_ascii/static_pacman.rb, line 62
def self.static_pacman
  AsciiParadise::StaticPacman.new
end
station_traffic(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.station_traffic

#
# File lib/ascii_paradise/animations/station_traffic.rb, line 39
def self.station_traffic(commandline_arguments = ARGV)
  StationTraffic.new(commandline_arguments)
end
steamer(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.steamer

#
# File lib/ascii_paradise/animations/steamer.rb, line 39
def self.steamer(commandline_arguments = ARGV)
  Steamer.new(commandline_arguments)
end
stepper_lepper(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.stepper_lepper

#
# File lib/ascii_paradise/animations/stepper_lepper.rb, line 40
def self.stepper_lepper(commandline_arguments = ARGV)
  StepperLepper.new(commandline_arguments)
end
swarn(i) click to toggle source
#

AsciiParadise.swarn

#
# File lib/ascii_paradise/colours/colours.rb, line 78
def self.swarn(i)
  Colours.swarn(i)
end
swimming_lane(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.swimming_lane

#
# File lib/ascii_paradise/animations/swimming_lane.rb, line 39
def self.swimming_lane(commandline_arguments = ARGV)
  SwimmingLane.new(commandline_arguments)
end
table(*dataset) click to toggle source
#

AsciiParadise.table

This method will show a simple ASCII Table of the given input.

The input to this method should be an Array or just several strings.

Usage example:

AsciiParadise.table 'hello','world','john', 'doe'
#
# File lib/ascii_paradise/table/table.rb, line 21
def self.table(*dataset)
  chunk = dataset.each_slice(2).to_a
  line = '# =========================================================== #'
  e line
  chunk.each {|array|
    _ = array[0].rjust(28)+' | '+array[1].ljust(28)
    e '# '+_+' #'
  }
  e line
end
table_flip() click to toggle source
#

AsciiParadise.table_flip

#
# File lib/ascii_paradise/curses/table_flip.rb, line 89
def self.table_flip
  AsciiParadise::TableFlip.run
end
table_tennis(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.table_tennis

#
# File lib/ascii_paradise/animations/table_tennis.rb, line 38
def self.table_tennis(commandline_arguments = ARGV)
  TableTennis.new(commandline_arguments)
end
tears_of_ice(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.tears_of_ice

#
# File lib/ascii_paradise/animations/tears_of_ice.rb, line 40
def self.tears_of_ice(commandline_arguments = ARGV)
  TearsOfIce.new(commandline_arguments)
end
template_directory?() click to toggle source
#

AsciiParadise.template_directory?

Where we store the .txt files that can be used for cartoon-like speaking.

#
# File lib/ascii_paradise/project/project.rb, line 31
def self.template_directory?
  "#{::AsciiParadise.project_base_directory?}ascii_say/"
end
tetris(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.tetris

#
# File lib/ascii_paradise/animations/tetris.rb, line 39
def self.tetris(commandline_arguments = ARGV)
  Tetris.new(commandline_arguments)
end
thread_and_ball(commandline_arguments) click to toggle source
#

AsciiParadise.thread_and_ball

#
# File lib/ascii_paradise/animations/thread_and_ball.rb, line 39
def self.thread_and_ball(commandline_arguments)
  ThreadAndBall.new(commandline_arguments)
end
to_camelcase(i) click to toggle source
#

AsciiParadise.to_camelcase

This will camelcase the given input, from 'rubber_duck' to 'RubberDuck'.

#
# File lib/ascii_paradise/toplevel_methods/to_camelcase.rb, line 14
def self.to_camelcase(i)
  if i.is_a? Array
    i = i.first
  end
  if i
    if i.include? '_'
      return i.to_s.split('_').map { |_| _.capitalize }.join
    else
      i = i.dup if i.frozen?
      i[0] = i[0].upcase
    end
  end
  i
end
trampoline(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.trampoline

#
# File lib/ascii_paradise/animations/trampoline.rb, line 39
def self.trampoline(commandline_arguments = ARGV)
  Trampoline.new(commandline_arguments)
end
turtle(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.turtle

#
# File lib/ascii_paradise/animations/turtle.rb, line 38
def self.turtle(commandline_arguments = ARGV)
  Turtle.new(commandline_arguments)
end
volcano(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.volcano

#
# File lib/ascii_paradise/animations/volcano.rb, line 38
def self.volcano(commandline_arguments = ARGV)
  Volcano.new(commandline_arguments)
end
whip(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.whip

#
# File lib/ascii_paradise/animations/whip.rb, line 38
def self.whip(commandline_arguments = ARGV)
  Whip.new(commandline_arguments)
end
worker(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.worker

#
# File lib/ascii_paradise/animations/worker.rb, line 39
def self.worker(commandline_arguments = ARGV)
  Worker.new(commandline_arguments)
end
worm(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.worm

#
# File lib/ascii_paradise/animations/worm.rb, line 39
def self.worm(commandline_arguments = ARGV)
  Worm.new(commandline_arguments)
end
wrap_at( this_string, my_limit = N_CHARACTERS_PER_LINE, add_newline = true, add_padding = nil ) click to toggle source
#

AsciiParadise.wrap_at (Begrenzung tag, limit tag, boundary tag)

Wraps at a specified position.

Specific examples:

puts "abc abc abdc abc abc abc abc abc abc abc abcdef abc abc abc abc abc abc abc abc abc ".wrap_at(20)
puts AsciiParadise.wrap_at(("x"*200), 30)
("x"*200).wrap_at(30,true,5)
#
# File lib/ascii_paradise/toplevel_methods/wrap_at.rb, line 28
def self.wrap_at(
    this_string, # <- This must be the input-String.
    my_limit    = N_CHARACTERS_PER_LINE,
    add_newline = true,
    add_padding = nil
  )
  case my_limit
  when :default
    my_limit = N_CHARACTERS_PER_LINE
  end
  begin
    add_padding = add_padding.to_i unless add_padding.nil?
    if add_newline
      _ = "\\1\\3\n" # newline at end
      unless add_padding.nil?
        _ = _.linsert(' ' * add_padding)
      end
      return this_string.gsub(
        /(.{1,#{my_limit}})( +|$)\n?|(.{#{my_limit}})/,_
      )
    else
      _ = "\\1\\3"
      unless add_padding.nil?
        _ = _.linsert(' ' * add_padding)
      end
      return this_string.gsub(
        /(.{1,#{my_limit}})( +|$)\n?|(.{#{my_limit}})/,
        _
      ) # No newline at the end.
    end
  rescue Exception => error
    puts error
  end
end
wrist_watch(commandline_arguments = ARGV) click to toggle source
#

AsciiParadise.wrist_watch

#
# File lib/ascii_paradise/animations/wrist_watch.rb, line 38
def self.wrist_watch(commandline_arguments = ARGV)
  WristWatch.new(commandline_arguments)
end

Public Instance Methods

return_checkmark_symbol() click to toggle source
#

return_checkmark_symbol

#
# File lib/ascii_paradise/sparky/sparkline.rb, line 166
def return_checkmark_symbol
  CHECKMARK_SYMBOL
end