Class: HunkReviewChanges::Server
- Inherits:
-
Object
- Object
- HunkReviewChanges::Server
- Defined in:
- lib/hunk_review_changes/server.rb
Overview
Boots the review UI for a bundle: configures the app, picks a free localhost port, opens the browser, arms the watchdog, and runs Puma. Blocks until the user clicks Done (which writes export.md and exits) or the watchdog fires.
Instance Method Summary collapse
- #export_path ⇒ Object
-
#initialize(bundle, port: nil, open: true) ⇒ Server
constructor
A new instance of Server.
- #run ⇒ Object
- #url ⇒ Object
Constructor Details
Instance Method Details
#export_path ⇒ Object
23 |
# File 'lib/hunk_review_changes/server.rb', line 23 def export_path = File.join(@bundle.dir, "export.md") |
#run ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/hunk_review_changes/server.rb', line 25 def run configure_app open_browser arm_watchdog announce App.run!(port: @port, server: "puma") end |
#url ⇒ Object
22 |
# File 'lib/hunk_review_changes/server.rb', line 22 def url = "http://127.0.0.1:#{@port}/" |