-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest-fancy-box.rb
35 lines (29 loc) · 890 Bytes
/
test-fancy-box.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env ruby
require 'cli/ui'
require_relative 'fancy_box'
CLI::UI::StdoutRouter.enable
# The original default :box
CLI::UI::Frame.open('{{i}} Initializing', color: :cyan) do
puts "Testing Box"
end
puts
# Enable FancyBox as our framestyle
CLI::UI.frame_style = FancyBox
CLI::UI::Frame.open('{{i}} Initializing', color: :cyan) do
puts "Testing FancyBox"
end
puts
# Trim FancyBox down
FancyBox.width = 80
CLI::UI::Frame.open('{{i}} Initializing', color: :cyan) do
puts "Testing FancyBox 80 wide"
CLI::UI::Frame.divider("{{i}} Let's do a divider too")
puts "More information"
end
puts
# But what about the missing bar on other lines?
CLI::UI::Frame.open('{{i}} Initializing', color: :cyan) do
puts "Testing FancyBox 80 wide with lineterm" << FancyBox.lineterm
CLI::UI::Frame.divider("{{i}} Let's do a divider too")
puts "More information" << FancyBox.lineterm
end