rcurses 0.8.8 → 1.0
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/lib/rcurses.rb +0 -0
- data/rcurses_example.rb +19 -15
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 11ec23437aa3fe94db8f25b249c30915f43bd7d4e2111839a09cf293e3201a11
|
4
|
+
data.tar.gz: af7956384b9ca1480866e1d4a9d981012f1628a4f1f8ea554b91fb1ea038809f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9ed014f4c3f6adc8365d6e0d2a9db0179ad82a0ed045203f803e9761ab738d7a1f3ebb356a7de1f63242b247446d3bd6da13b5e5a25103edc1f9152d5957eac
|
7
|
+
data.tar.gz: cbe90f866c49bd7ca0cfdf7631dd4b426f373db2eb233321befff359f9bdfe355602ab779dbfc0bef8fefb2acab5d4e99bd4f453d133b441d51d0cb59c29f625
|
data/lib/rcurses.rb
CHANGED
Binary file
|
data/rcurses_example.rb
CHANGED
@@ -2,30 +2,34 @@
|
|
2
2
|
|
3
3
|
require 'rcurses'
|
4
4
|
|
5
|
+
# Start by creating the panes; Format:
|
5
6
|
# pane = Rcurses::Pane.new( startx, starty, width, height, fg, bg)
|
6
7
|
pane_top = Rcurses::Pane.new( 1, 1, Rcurses::MAXw, 1, 255, 236)
|
7
8
|
pane_bottom = Rcurses::Pane.new( 1, Rcurses::MAXh, Rcurses::MAXw, 1, 236, 254)
|
8
9
|
pane_left = Rcurses::Pane.new( 2, 3, Rcurses::MAXw/2 - 2, Rcurses::MAXh - 4, 52, nil)
|
9
10
|
pane_right = Rcurses::Pane.new(Rcurses::MAXw/2 + 1, 2, Rcurses::MAXw/2, Rcurses::MAXh - 2, 255, 52)
|
10
11
|
|
11
|
-
pane_left.border
|
12
|
+
pane_left.border = true # Adding a border to the left pane
|
12
13
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
# Add content to the panes
|
15
|
+
pane_top.text = Time.now.to_s[0..15].b + " Welcome to the rcurses example program"
|
16
|
+
pane_left.text = `ls --color`
|
17
|
+
pane_right.text = "Output of lsblk:\n\n" + `lsblk`
|
18
|
+
pane_bottom.prompt = "Enter any text and press ENTER: ".b # The prompt text before the user starts writing content
|
17
19
|
|
18
|
-
pane_top.refresh
|
19
|
-
pane_left.refresh
|
20
|
-
pane_right.refresh
|
21
|
-
pane_bottom.editline
|
20
|
+
pane_top.refresh # This is the order of drawing/refreshing the panes
|
21
|
+
pane_left.refresh # ...then the left pane
|
22
|
+
pane_right.refresh # ...and the right pane
|
23
|
+
pane_bottom.editline # Do not use a refresh before editline
|
22
24
|
|
23
|
-
|
24
|
-
pane_mid
|
25
|
-
pane_mid.
|
26
|
-
pane_mid.
|
25
|
+
# Then create a "pop-up" pane in the middle of the screen
|
26
|
+
pane_mid = Rcurses::Pane.new(Rcurses::MAXw/2 - 10, Rcurses::MAXh/2 - 5, 20, 10, 18, 254)
|
27
|
+
pane_mid.border = true
|
28
|
+
pane_mid.text = "You wrote: \n \n" + pane_bottom.text.i
|
29
|
+
pane_mid.align = "c"
|
27
30
|
pane_mid.refresh
|
28
31
|
|
29
|
-
|
30
|
-
pane_bottom.
|
32
|
+
# Then ask the user to hit ENTER before exiting the program
|
33
|
+
pane_bottom.prompt = "Now hit ENTER again "
|
34
|
+
pane_bottom.text = ""
|
31
35
|
pane_bottom.editline
|
metadata
CHANGED
@@ -1,21 +1,21 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rcurses
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0
|
4
|
+
version: '1.0'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Geir Isene
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-11-
|
11
|
+
date: 2024-11-24 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: 'Create panes (with the colors and(or border), manipulate the panes and
|
14
14
|
add content. Dress up text (in panes or anywhere in the terminal) in bold, italic,
|
15
15
|
underline, reverse color, blink and in any 256 terminal colors for foreground and
|
16
16
|
background. Use a simple editor to let users edit text in panes. Left, right or
|
17
|
-
center align text in panes. Cursor movement around the terminal. New in 0
|
18
|
-
|
17
|
+
center align text in panes. Cursor movement around the terminal. New in 1.0: Full
|
18
|
+
rewrite of ANSI carry-over function.'
|
19
19
|
email: g@isene.com
|
20
20
|
executables: []
|
21
21
|
extensions:
|