rich-ruby 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +80 -0
- data/LICENSE +21 -21
- data/README.md +547 -547
- data/docs/architecture.md +43 -0
- data/docs/cheat-sheet.md +52 -0
- data/docs/customization.md +53 -0
- data/docs/how-to-use.md +96 -0
- data/docs/test-report.md +112 -0
- data/docs/troubleshooting.md +36 -0
- data/docs/windows-notes.md +30 -0
- data/examples/demo.rb +106 -106
- data/examples/showcase.rb +420 -420
- data/examples/smoke_test.rb +41 -41
- data/examples/stress_test.rb +604 -604
- data/examples/syntax_markdown_demo.rb +166 -166
- data/examples/verify.rb +216 -215
- data/examples/visual_demo.rb +145 -145
- data/lib/rich/_palettes.rb +148 -148
- data/lib/rich/box.rb +342 -342
- data/lib/rich/cells.rb +524 -512
- data/lib/rich/color.rb +631 -628
- data/lib/rich/color_triplet.rb +227 -220
- data/lib/rich/console.rb +604 -549
- data/lib/rich/control.rb +332 -332
- data/lib/rich/json.rb +260 -254
- data/lib/rich/layout.rb +314 -314
- data/lib/rich/markdown.rb +531 -509
- data/lib/rich/markup.rb +186 -175
- data/lib/rich/panel.rb +318 -311
- data/lib/rich/progress.rb +430 -430
- data/lib/rich/segment.rb +387 -387
- data/lib/rich/style.rb +464 -433
- data/lib/rich/syntax.rb +1220 -1145
- data/lib/rich/table.rb +547 -525
- data/lib/rich/terminal_theme.rb +126 -126
- data/lib/rich/text.rb +460 -433
- data/lib/rich/tree.rb +220 -220
- data/lib/rich/version.rb +5 -5
- data/lib/rich/win32_console.rb +620 -582
- data/lib/rich.rb +108 -108
- metadata +15 -5
data/examples/smoke_test.rb
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
# Smoke test for Rich library
|
|
4
|
-
|
|
5
|
-
require_relative "../lib/rich"
|
|
6
|
-
|
|
7
|
-
puts "1. Testing library load..."
|
|
8
|
-
puts " Rich library loaded successfully!"
|
|
9
|
-
|
|
10
|
-
puts "\n2. Testing Console..."
|
|
11
|
-
console = Rich::Console.new
|
|
12
|
-
puts " Color system: #{console.color_system}"
|
|
13
|
-
puts " Terminal size: #{console.width}x#{console.height}"
|
|
14
|
-
puts " Is terminal: #{console.terminal?}"
|
|
15
|
-
|
|
16
|
-
puts "\n3. Testing Color parsing..."
|
|
17
|
-
red = Rich::Color.parse("red")
|
|
18
|
-
puts " Parsed 'red': #{red.inspect}"
|
|
19
|
-
|
|
20
|
-
hex = Rich::Color.parse("#ff5500")
|
|
21
|
-
puts " Parsed '#ff5500': #{hex.inspect}"
|
|
22
|
-
|
|
23
|
-
puts "\n4. Testing Style parsing..."
|
|
24
|
-
style = Rich::Style.parse("bold red on white")
|
|
25
|
-
puts " Parsed 'bold red on white': #{style.inspect}"
|
|
26
|
-
|
|
27
|
-
puts "\n5. Testing ColorTriplet..."
|
|
28
|
-
triplet = Rich::ColorTriplet.new(255, 128, 0)
|
|
29
|
-
puts " Triplet: #{triplet.hex} / #{triplet.rgb}"
|
|
30
|
-
|
|
31
|
-
puts "\n6. Testing Cells width..."
|
|
32
|
-
puts " Width of 'Hello': #{Rich::Cells.cell_len('Hello')}"
|
|
33
|
-
puts " Width of '你好': #{Rich::Cells.cell_len('你好')}"
|
|
34
|
-
|
|
35
|
-
puts "\n7. Testing basic output..."
|
|
36
|
-
console.print("Hello from Rich!", style: "bold green")
|
|
37
|
-
|
|
38
|
-
puts "\n8. Testing markup..."
|
|
39
|
-
console.print_markup("[bold]Bold[/bold] and [red]Red[/red] text")
|
|
40
|
-
|
|
41
|
-
puts "\n✓ Smoke test complete!"
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Smoke test for Rich library
|
|
4
|
+
|
|
5
|
+
require_relative "../lib/rich"
|
|
6
|
+
|
|
7
|
+
puts "1. Testing library load..."
|
|
8
|
+
puts " Rich library loaded successfully!"
|
|
9
|
+
|
|
10
|
+
puts "\n2. Testing Console..."
|
|
11
|
+
console = Rich::Console.new
|
|
12
|
+
puts " Color system: #{console.color_system}"
|
|
13
|
+
puts " Terminal size: #{console.width}x#{console.height}"
|
|
14
|
+
puts " Is terminal: #{console.terminal?}"
|
|
15
|
+
|
|
16
|
+
puts "\n3. Testing Color parsing..."
|
|
17
|
+
red = Rich::Color.parse("red")
|
|
18
|
+
puts " Parsed 'red': #{red.inspect}"
|
|
19
|
+
|
|
20
|
+
hex = Rich::Color.parse("#ff5500")
|
|
21
|
+
puts " Parsed '#ff5500': #{hex.inspect}"
|
|
22
|
+
|
|
23
|
+
puts "\n4. Testing Style parsing..."
|
|
24
|
+
style = Rich::Style.parse("bold red on white")
|
|
25
|
+
puts " Parsed 'bold red on white': #{style.inspect}"
|
|
26
|
+
|
|
27
|
+
puts "\n5. Testing ColorTriplet..."
|
|
28
|
+
triplet = Rich::ColorTriplet.new(255, 128, 0)
|
|
29
|
+
puts " Triplet: #{triplet.hex} / #{triplet.rgb}"
|
|
30
|
+
|
|
31
|
+
puts "\n6. Testing Cells width..."
|
|
32
|
+
puts " Width of 'Hello': #{Rich::Cells.cell_len('Hello')}"
|
|
33
|
+
puts " Width of '你好': #{Rich::Cells.cell_len('你好')}"
|
|
34
|
+
|
|
35
|
+
puts "\n7. Testing basic output..."
|
|
36
|
+
console.print("Hello from Rich!", style: "bold green")
|
|
37
|
+
|
|
38
|
+
puts "\n8. Testing markup..."
|
|
39
|
+
console.print_markup("[bold]Bold[/bold] and [red]Red[/red] text")
|
|
40
|
+
|
|
41
|
+
puts "\n✓ Smoke test complete!"
|