Module: Dev::UI
- Defined in:
- lib/dev/ui.rb,
lib/dev/ui/box.rb,
lib/dev/ui/ansi.rb,
lib/dev/ui/color.rb,
lib/dev/ui/frame.rb,
lib/dev/ui/glyph.rb,
lib/dev/ui/prompt.rb,
lib/dev/ui/spinner.rb,
lib/dev/ui/version.rb,
lib/dev/ui/progress.rb,
lib/dev/ui/terminal.rb,
lib/dev/ui/formatter.rb,
lib/dev/ui/stdout_router.rb,
lib/dev/ui/interactive_prompt.rb
Defined Under Namespace
Modules: ANSI, Box, Frame, Prompt, Spinner, StdoutRouter, Terminal
Classes: Color, Formatter, Glyph, InteractivePrompt, Progress
Constant Summary
collapse
- SpinGroup =
Spinner::SpinGroup
- VERSION =
"0.0.2"
Class Method Summary
collapse
Class Method Details
.ask(question, **kwargs) ⇒ Object
38
39
40
|
# File 'lib/dev/ui.rb', line 38
def self.ask(question, **kwargs)
Dev::UI::Prompt.ask(question, **kwargs)
end
|
.confirm(question) ⇒ Object
34
35
36
|
# File 'lib/dev/ui.rb', line 34
def self.confirm(question)
Dev::UI::Prompt.confirm(question)
end
|
.fmt(input, enable_color: true) ⇒ Object
47
48
49
|
# File 'lib/dev/ui.rb', line 47
def self.fmt(input, enable_color: true)
Dev::UI::Formatter.new(input).format(enable_color: enable_color)
end
|
.frame(*args, &block) ⇒ Object
51
52
53
|
# File 'lib/dev/ui.rb', line 51
def self.frame(*args, &block)
Dev::UI::Frame.open(*args, &block)
end
|
.glyph(handle) ⇒ Object
20
21
22
|
# File 'lib/dev/ui.rb', line 20
def self.glyph(handle)
Dev::UI::Glyph.lookup(handle)
end
|
.log_output_to(path) ⇒ Object
.raw ⇒ Object
75
76
77
78
79
80
81
|
# File 'lib/dev/ui.rb', line 75
def self.raw
prev = Thread.current[:no_devui_frame_inset]
Thread.current[:no_devui_frame_inset] = true
yield
ensure
Thread.current[:no_devui_frame_inset] = prev
end
|
.resolve_color(input) ⇒ Object
25
26
27
28
29
30
31
32
|
# File 'lib/dev/ui.rb', line 25
def self.resolve_color(input)
case input
when Symbol
Dev::UI::Color.lookup(input)
else
input
end
end
|
.resolve_text(input) ⇒ Object
42
43
44
45
|
# File 'lib/dev/ui.rb', line 42
def self.resolve_text(input)
return input if input.nil?
Dev::UI::Formatter.new(input).format
end
|
.spinner(*args, &block) ⇒ Object
55
56
57
|
# File 'lib/dev/ui.rb', line 55
def self.spinner(*args, &block)
Dev::UI::Spinner.spin(*args, &block)
end
|
.with_frame_color(color, &block) ⇒ Object