As part of Brick Mill Games’ efforts to write an intelligent game playing application to handle our double-blind game system, I’ve been developing a Ruby gem to allow Ruby scripts to run a GUI on any of three platforms: macOS/Cocoa, Linux/Gtk3, Win10. The name of this gem, or code library, is Epoxy.

As of today, my embryonic test script (see below) can run on both macOS and Linux. It can initialize the underlying windowing system libraries and show a modal alert dialog box using each platform’s native look & feel. While the system is nowhere close to complete, the concept has proven sound.

I’ll be working on the Win10 basic port next to finalize the concept.

As I make progress, I will be publishing a series of technical articles describing the code and underlying design philosophies and challenges. I will also be posting videos showing the code running on the various platforms.

On a personal level, it’s very exciting. I feel that years of various projects and sub-projects are finally coming together to bear fruit.

The Script

#!/usr/bin/env ruby

require ‘Epoxy’

Epoxy::Application.run do
  puts “> Block is in Context: #{self.class.name}”

  show alert, [ style: :notice, message: ‘Epoxy is Alive!!!’ ] do |result|
    puts “Alert Done? (#{result})”
  end
end

puts ‘App Done?’

Video Demo

Epoxy Demo #1 on YouTube

The Next Step

Windows 10 Pro installed in a virtual machine on my Mac.

Quick Prototype Works

After installing Win10 Pro and Ruby 2.5 (via RubyInstaller) and Sublime Text 3, I was able to get a quick and dirty prototype up and running fairly easily. The example at the Ruby/FFI gem site helped quite a bit.