update some deisng parameters and add new cases

This commit is contained in:
2026-07-29 14:32:22 -07:00
parent 683697604a
commit 45a77885f9
34 changed files with 4602 additions and 79 deletions
+46
View File
@@ -0,0 +1,46 @@
# frozen_string_literal: true
module FeatherCaseWizard
class PromptingUI
def self.wrap(ui)
ui.is_a?(self) ? ui : new(ui)
end
def initialize(ui)
@ui = ui
end
def ask(*arguments, &block)
separate_after { @ui.ask(*arguments, &block) }
end
def agree(*arguments, &block)
separate_after { @ui.agree(*arguments, &block) }
end
def choose(prompt, &block)
separate_after do
@ui.choose do |menu|
menu.header = prompt.to_s.sub(/[?:]\s*\z/, "")
block.call(menu)
end
end
end
def say(*arguments, &block)
@ui.say(*arguments, &block)
end
def color(*arguments, &block)
@ui.color(*arguments, &block)
end
private
def separate_after
result = yield
@ui.say("\n")
result
end
end
end