Created
June 25, 2026 15:14
-
-
Save peterc/1fbfa2b60c8fe7abd0555c94083e3e32 to your computer and use it in GitHub Desktop.
RubyUI shim for Sinatra
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Replicates what RubyUI's Rails install generator wires up, but for a plain | |
| # Ruby process: make `RubyUI` a Phlex Kit, then load every component file. | |
| require "date" | |
| require "phlex" | |
| require "tailwind_merge" | |
| module RubyUI | |
| extend Phlex::Kit | |
| end | |
| dir = File.expand_path("components/ruby_ui", __dir__) | |
| # Base must load first (other components subclass RubyUI::Base). | |
| require File.join(dir, "base.rb") | |
| Dir[File.join(dir, "*.rb")].sort.each do |file| | |
| next if File.basename(file) == "base.rb" | |
| require file | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment