Sirens
Sirens gives Ruby developers some simple and interactive utilities to ease development, testing and learning Ruby.
These utilities are written in Ruby and use gtk3 as its GUI support.
Installation
Pre requisites
apt install libglib2.0-dev
In the project Gemfile add the following gem:
group :test, :development do
gem 'sirens'
end
and install the bundles with:
bundle install
Usage
First require the gem:
require 'rubygems'
require 'bundler/setup'
require 'sirens'
then open a browser in any part of the application or in a test with:
Sirens.browse(object: user)
Testing
Run the tests with
bundle exec rspec
References
These utilities are heavily based in the Smalltalk browsers, in particular in the Object Arts implementation named Dolphin Smalltalk, which I fancy for its outstanding beauty.
I started a similar framework some years ago implementing a custom GTK+ GUI framework inspired in Shoes and Dolphin's MVP framework but then I dropped the project.
I recently learned React and I liked very much its simplicity and its declarative DSL.
I decided to re-implement these utilities from scratch using a DSL similar to Shoes (which also resembles React JSX) but bringing back the models to it, adding a custom layer of composable models to handle most of the information updates between components instead of lifting up the state to a common ancestor.
I think the final result is both very simple to use and highly adaptable and its worth looking at it.
The graphics code remains in the View layer, so it would be possible to switch to any graphics library, be it GTK+ or QT.
I like this implementation much better than the previous one I did several years ago and it could be spin-off to a GTK+ gem on its own, but currently there are no plans to do that.