module Dev::UI
Constants
- SpinGroup
Convenience accessor to
Dev::UI::Spinner::SpinGroup
- VERSION
Public Class Methods
ask(question, **kwargs)
click to toggle source
confirm(question)
click to toggle source
fmt(input, enable_color: true)
click to toggle source
Conviencence Method to format text using Dev::UI::Formatter.format
Check Dev::UI::Formatter::SGR_MAP
for available formatting options
Attributes¶ ↑
-
input
- input to format
Options¶ ↑
-
enable_color
- should color be used? default to true
# File lib/dev/ui.rb, line 91 def self.fmt(input, enable_color: true) Dev::UI::Formatter.new(input).format(enable_color: enable_color) end
frame(*args, &block)
click to toggle source
glyph(handle)
click to toggle source
log_output_to(path) { || ... }
click to toggle source
Duplicate output to a file path
Attributes¶ ↑
-
path
- path to duplicate output to
# File lib/dev/ui.rb, line 134 def self.log_output_to(path) if Dev::UI::StdoutRouter.duplicate_output_to raise "multiple logs not allowed" end Dev::UI::StdoutRouter.duplicate_output_to = File.open(path, 'w') yield ensure if file_descriptor = Dev::UI::StdoutRouter.duplicate_output_to file_descriptor.close Dev::UI::StdoutRouter.duplicate_output_to = nil end end
raw() { || ... }
click to toggle source
resolve_color(input)
click to toggle source
Color
resolution using Dev::UI::Color.lookup
Will lookup using Color.lookup
if a symbol, otherwise we assume it is a valid color and return it
Attributes¶ ↑
-
input
- color to resolve
# File lib/dev/ui.rb, line 35 def self.resolve_color(input) case input when Symbol Dev::UI::Color.lookup(input) else input end end
resolve_text(input)
click to toggle source
spinner(*args, &block)
click to toggle source
with_frame_color(color, &block)
click to toggle source
Conviencence Method to override frame color using Dev::UI::Frame.with_frame_color
Attributes¶ ↑
-
color
- color to override to -
block
- block forFrame.with_frame_color_override
# File lib/dev/ui.rb, line 124 def self.with_frame_color(color, &block) Dev::UI::Frame.with_frame_color_override(color, &block) end