examples/debug/Supfile in wassup-0.1.2 vs examples/debug/Supfile in wassup-0.2.0
- old
+ new
@@ -6,14 +6,14 @@
pane.highlight = false
pane.title = "Time Update - Every Second"
pane.interval = 1
- pane.content do
- [
- `date`
- ]
+ pane.content do |content|
+ date = `date`
+
+ content.add_row(date)
end
end
add_pane do |pane|
pane.height = 0.25
@@ -22,15 +22,15 @@
pane.left = 0
pane.highlight = false
pane.title = "Time Update - Every 5 Seconds"
- pane.interval = 5
- pane.content do
- [
- `date`
- ]
+ pane.interval = 30
+ pane.content do |content|
+ date = `date`
+
+ content.add_row(date)
end
end
add_pane do |pane|
pane.height = 0.25
@@ -40,15 +40,74 @@
pane.highlight = false
pane.title = "Maybe Error - Every 10 Seconds"
pane.interval = 10
- pane.content do
+ pane.content do |content|
if [true, false].sample
raise "An error occured! Oh no!"
end
- [
- "[fg=cyan]No error occured[fg=white]"
- ]
+ output = "[fg=cyan]No error occured[fg=white]"
+
+ content.add_row(output)
+ end
+end
+
+add_pane do |pane|
+ pane.height = 0.25
+ pane.width = 0.35
+ pane.top = 0.25
+ pane.left = 0.25
+
+ pane.highlight = false
+ pane.title = "Multiple Contents"
+
+ pane.interval = 10
+ pane.content do |content|
+ content.add_row("Line 1 of page 1", page: "Page 1")
+ content.add_row("Line 2 of page 1", page: "Page 1")
+ content.add_row("Line 1 of page 2", page: "Page 2")
+ content.add_row("Line 2 of page 2", page: "Page 2")
+ end
+end
+
+add_pane do |pane|
+ pane.height = 0.25
+ pane.width = 0.6
+ pane.top = 0.5
+ pane.left = 0
+
+ pane.highlight = false
+ pane.title = "Time Update - Slow Reload"
+
+ pane.interval = 30
+ pane.show_refresh = true
+ pane.content do |content|
+ sleep 10
+
+ date = `date`
+
+ content.add_row(date)
+ end
+end
+
+require 'stringio'
+foo = StringIO.new
+$stdout = foo
+
+add_pane do |pane|
+ pane.height = 1
+ pane.width = 0.4
+ pane.top = 0.0
+ pane.left = 0.6
+
+ pane.highlight = false
+ pane.title = "STDOUT"
+
+ pane.interval = 4
+ pane.content do |content|
+ $stdout.string.split("\n").each do |line|
+ content.add_row(line)
+ end
end
end