Module: Dex::UI
- Defined in:
- lib/dex/ui.rb,
lib/dex/ui/box.rb,
lib/dex/ui/ansi.rb,
lib/dex/ui/color.rb,
lib/dex/ui/frame.rb,
lib/dex/ui/glyph.rb,
lib/dex/ui/prompt.rb,
lib/dex/ui/spinner.rb,
lib/dex/ui/progress.rb,
lib/dex/ui/terminal.rb,
lib/dex/ui/formatter.rb,
lib/dex/ui/stdout_router.rb
Defined Under Namespace
Modules: ANSI, Box, Frame, Progress, Prompt, Spinner, StdoutRouter, Terminal
Classes: Color, Formatter, Glyph
Constant Summary
collapse
- SpinGroup =
Spinner::SpinGroup
Class Method Summary
collapse
Class Method Details
.ask(question, **kwargs) ⇒ Object
36
37
38
|
# File 'lib/dex/ui.rb', line 36
def self.ask(question, **kwargs)
Dex::UI::Prompt.ask(question, **kwargs)
end
|
.confirm(question) ⇒ Object
32
33
34
|
# File 'lib/dex/ui.rb', line 32
def self.confirm(question)
Dex::UI::Prompt.confirm(question)
end
|
.fmt(input, enable_color: true) ⇒ Object
45
46
47
|
# File 'lib/dex/ui.rb', line 45
def self.fmt(input, enable_color: true)
Dex::UI::Formatter.new(input).format(enable_color: enable_color)
end
|
.frame(*args, &block) ⇒ Object
49
50
51
|
# File 'lib/dex/ui.rb', line 49
def self.frame(*args, &block)
Dex::UI::Frame.open(*args, &block)
end
|
.glyph(handle) ⇒ Object
18
19
20
|
# File 'lib/dex/ui.rb', line 18
def self.glyph(handle)
Dex::UI::Glyph.lookup(handle)
end
|
.log_output_to(path) ⇒ Object
.raw ⇒ Object
73
74
75
76
77
78
79
|
# File 'lib/dex/ui.rb', line 73
def self.raw
prev = Thread.current[:no_dexui_frame_inset]
Thread.current[:no_dexui_frame_inset] = true
yield
ensure
Thread.current[:no_dexui_frame_inset] = prev
end
|
.resolve_color(input) ⇒ Object
23
24
25
26
27
28
29
30
|
# File 'lib/dex/ui.rb', line 23
def self.resolve_color(input)
case input
when Symbol
Dex::UI::Color.lookup(input)
else
input
end
end
|
.resolve_text(input) ⇒ Object
40
41
42
43
|
# File 'lib/dex/ui.rb', line 40
def self.resolve_text(input)
return input if input.nil?
Dex::UI::Formatter.new(input).format
end
|
.spinner(*args, &block) ⇒ Object
53
54
55
|
# File 'lib/dex/ui.rb', line 53
def self.spinner(*args, &block)
Dex::UI::Spinner.spin(*args, &block)
end
|
.with_frame_color(color, &block) ⇒ Object