⚠️ WARNING: PRE-ALPHA SOFTWARE⚠️ This project is currently in pre-pre-pre-alpha stage. The API is unstable and subject to breaking changes. Don't use it it's broken. Documentation is incomplete.
A Ruby Terminal User Interface framework with a canvas-based drawing system and flexbox-like styling. Beautty provides a powerful and intuitive way to create rich terminal applications with a focus on ease of use and visual appeal. You can check the project's progress and planned features in the TASKS.md file.
- Full-terminal canvas with double buffering
- Terminal interaction (raw mode, cursor positioning, etc.)
- Drawing primitives (text, lines, rectangles)
- Color and style support
- Resize handling
- Flexbox-like layout system
- Event-driven architecture
- Cross-platform support
Add this line to your application's Gemfile:
gem 'beautty'
And then execute:
$ bundle install
$ gem install beautty
require 'beautty'
app = Beautty.application do
# Application setup here
end
app.start do |canvas, input|
# Draw on the canvas
canvas.clear
canvas.draw_text(10, 5, "Hello, World!", fg: :green, style: :bold)
canvas.draw_rect(5, 3, 20, 5)
# Handle input
break if input == 'q'
end
# Draw text with styling
canvas.draw_text(x, y, "Text", fg: :red, bg: :blue, style: :bold)
# Draw horizontal and vertical lines
canvas.draw_hline(x, y, length, char: '-', fg: :yellow)
canvas.draw_vline(x, y, length, char: '|', fg: :cyan)
# Draw rectangles (filled and unfilled)
canvas.draw_rect(x, y, width, height, fill: false, fg: :green)
canvas.draw_rect(x, y, width, height, fill: true, bg: :magenta)
Beautty supports a wide range of colors:
- Basic colors:
:black
,:red
,:green
,:yellow
,:blue
,:magenta
,:cyan
,:white
- Bright colors:
:bright_black
,:bright_red
, etc. - RGB colors:
[r, g, b]
where r, g, b are values between 0-255
Available text styles:
:bold
:dim
:italic
:underline
:blink
:reverse
:hidden
$ bundle exec rspec
$ bundle exec yard doc
- Fork the repository
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
- Inspired by modern UI frameworks
- Built with Ruby's powerful terminal capabilities