Gtk-Scarpe is a specific Scarpe implementation based on GTK4. Scarpe is a reimplementation of Shoes, a Ruby desktop UI library originally written by _why the lucky stiff.
Gtk-Scarpe uses Lacci, the standard Scarpe DSL, and Scarpe-Components. It's a non-HTML-based local display.
Gtk-Scarpe support Shoes-Spec, though only the set of drawables and features currently supported by Gtk-Scarpe.
Install the gem and add to the application's Gemfile by executing:
$ bundle add gtk-scarpe
If bundler is not being used to manage dependencies, install the gem by executing:
$ gem install gtk-scarpe
Your application should include gtk-scarpe as a dependency. You can run a Shoes application with gtk-scarpe by using the gtk-scarpe executable:
./exe/gtk-scarpe examples/button_alert.rb
TODO: when gtk-scarpe is tested with Shoes-Spec, .scas and .sspec files, etc. add usage instructions here.
After checking out the repo, run bin/setup
to install dependencies. Then, run rake test
to run the tests. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and the created tag, and push the .gem
file to rubygems.org.
Shoes-Spec is the preferred way to write integration tests. To run a Shoes-Spec test, you can use exe/gtk-scarpe. If your filename ends in .sspec and you don't set the environment var SHOES_MINITEST_EXPORT_FILE, Gtk-Scarpe will print your test results to the console:
noah@Noahs-MBP-3 gtk-scarpe % ./exe/gtk-scarpe --dev ../shoes-spec/cases/drawables/button/basic_click.sspec
Test results:
Success!
If there's an exception, skip or failure you should see console results printed as well.
Bug reports and pull requests are welcome on GitHub at https://github.com/scarpe-team/gtk-scarpe. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.
The gem is available as open source under the terms of the MIT License.
Everyone interacting in the Gtk::Scarpe project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.
Lots of these have great reference code for Shoes and Scarpe, and general Shoes-related information.
- Nobody Knows Shoes - the original "learn Shoes" book by _why
- The Shoes Manual
- Scarpe API Docs
- Scarpe Source Code
- Scarpe-Wasm - another "free-standing" display service for Scarpe, not packaged with Scarpe itself
- AndyObtiva's Glimmer DSL for GTK+ 3.0 - a good reference for another Ruby GTK+-based binding
Lots of these have great reference code for Shoes, Scarpe, GTK+ or similar.
Also, when Googling for GTK+ references, keep in mind that GTK+ version 4 ("gtk4") is significantly different from version 2 or version 3. Lots of changes, deprecations and so on. So older code using gtk2 and gtk3 will need updating.
- Ruby-Gnome project - Ruby bindings for GNOME libs like GTK+
- Ruby GTK docs
- GTK+ 4.0 docs
- The GTK+ 4 Draw Model - this is a little different from earlier versions of GTK+
- Green Shoes - a gtk2 implementation of Shoes Classic, from long before Scarpe existed