Skip to content

add Thaum.app and SomeApp.run quick-start entry points - #9

Merged
phaedryx merged 1 commit into
mainfrom
tthorley_app-entry
Jun 29, 2026
Merged

add Thaum.app and SomeApp.run quick-start entry points#9
phaedryx merged 1 commit into
mainfrom
tthorley_app-entry

Conversation

@phaedryx

Copy link
Copy Markdown
Member

A little sugar to make things a bit more approachable

`Thaum.app do … end` builds and runs an app from a block (an ordinary class body) in place of defining a named class; `SomeApp.run` builds and runs an instance, forwarding the same options as `Thaum.run`, which stays the primitive for apps needing constructor arguments.

Deliberately minimal — no builder helpers or handler macros (one way to define handlers: plain `def`). Converts class-form examples to `.run` and hello_world to `Thaum.app`; updates README + CHANGELOG.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds quick-start entry points to make bootstrapping a Thaum app more ergonomic: Thaum.app { … } for anonymous apps and SomeApp.run for classes that include Thaum::App.

Changes:

  • Add Thaum::App::ClassMethods#run and auto-extend it on include Thaum::App.
  • Add Thaum.app(**, &block) to build an anonymous app class from a block and run it (with a missing-block guard).
  • Update README, examples, changelog, and add a focused test for the new entry points.

Reviewed changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated no comments.

Show a summary per file
File Description
test/test_app_dsl.rb Adds coverage for .run being added by include Thaum::App and for Thaum.app requiring a block.
README.md Documents Thaum.app quick-start and updates usage to prefer SomeApp.run.
lib/thaum/app.rb Extends including classes with a .run class method that instantiates and delegates to Thaum.run.
lib/thaum.rb Adds Thaum.app helper that builds an anonymous Thaum::App class from a block and runs it.
examples/hello_world.rb Switches the “Hello World” example to use Thaum.app do … end.
examples/counter.rb Uses CounterApp.run instead of Thaum.run(CounterApp.new).
examples/checkbox.rb Uses CheckboxApp.run instead of Thaum.run(CheckboxApp.new).
examples/layout_demo.rb Uses LayoutDemoApp.run instead of Thaum.run(LayoutDemoApp.new).
examples/log_generator.rb Uses LogGeneratorApp.run(...) instead of Thaum.run(LogGeneratorApp.new, ...).
examples/modal.rb Uses ModalApp.run instead of Thaum.run(ModalApp.new).
examples/mouse.rb Uses MouseApp.run instead of Thaum.run(MouseApp.new).
examples/progress_bar.rb Uses ProgressApp.run instead of Thaum.run(ProgressApp.new).
examples/scroll_view.rb Uses ScrollViewApp.run instead of Thaum.run(ScrollViewApp.new).
examples/spinner.rb Uses SpinnerApp.run instead of Thaum.run(SpinnerApp.new).
examples/status_bar.rb Uses StatusBarApp.run instead of Thaum.run(StatusBarApp.new).
examples/stopwatch.rb Uses StopwatchApp.run(tick: ...) instead of Thaum.run(StopwatchApp.new, tick: ...).
examples/tabs.rb Uses TabsApp.run instead of Thaum.run(TabsApp.new).
examples/text.rb Uses TextApp.run instead of Thaum.run(TextApp.new).
examples/theme_picker.rb Uses ThemePickerApp.run instead of Thaum.run(ThemePickerApp.new).
examples/todo.rb Uses TodoApp.run instead of Thaum.run(TodoApp.new).
CHANGELOG.md Notes the new Thaum.app / SomeApp.run entry points and guidance on when to still use Thaum.run(app).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@phaedryx
phaedryx merged commit afc4cf5 into main Jun 29, 2026
1 check passed
@phaedryx
phaedryx deleted the tthorley_app-entry branch June 29, 2026 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants