rcurses 0.8.6 → 0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rcurses.rb +0 -0
  3. data/rcurses_example.rb +21 -11
  4. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5ba36880c4a3301cf9ccf1af316ce0e482fabfdc1f44f531813064f32aa81cae
4
- data.tar.gz: bcc4b38439ec53d01492d7698256b764f5445d8a256cf9fe2f9cd3a9a0ccb738
3
+ metadata.gz: dda7a17b837a138cd56a782cc6fca35c16008783c8821333ff5c74b7285685e3
4
+ data.tar.gz: 808367598b01ede5c0785482e9efe910620b63895ccddf1458ebdeb37456584f
5
5
  SHA512:
6
- metadata.gz: 798ac14705020ea59a590e4b9e1bfdc042636da1b4bcf33bde0d1d1bc4c75a4ace7d5b69a45c3518672c9962f2c8b01a83e879e38627532da32fa0c16fe16083
7
- data.tar.gz: afbdbd5e222f075be154315e173379bb0aaed4f52a9c66e57ef57c5dafdf25fea0e2106a9956eace2b974b12e9b2656282e1e57b08b7095aa141fac8d3e4d4fb
6
+ metadata.gz: 18a5947e92b70d62821af1912074270f7f1ef403b73411e7be89799dde9efba665fe59e6c93fc2c9a8fcc7bbee36cebb9bdd5091bdcf8a2503997cf8ba2ef28a
7
+ data.tar.gz: d6f7a3cfdd7f6a3ecd337354ee4ad934a739398a57ac85112275cf4a7bb27d8b017f30761677301b3279d60114bed8d83be76d8651db8cf5b2da901f1bca7363
data/lib/rcurses.rb CHANGED
Binary file
data/rcurses_example.rb CHANGED
@@ -2,24 +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 = true
12
+ pane_left.border = true # Adding a border to the left pane
12
13
 
13
- pane_top.text = "This is an information line at the top".b.i
14
- pane_left.text = `ls --color`
15
- pane_right.text = "Output of lsblk:\n\n" + `lsblk`
16
- pane_bottom.prompt = "Enter any text and press ENTER: ".b
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
24
+
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"
30
+ pane_mid.refresh
22
31
 
23
- pane_bottom.prompt = "You wrote: " + pane_bottom.text.i + " (now hit ENTER again)"
24
- pane_bottom.text = ""
32
+ # Then ask the user to hit ENTER before exiting the program
33
+ pane_bottom.prompt = "Now hit ENTER again "
34
+ pane_bottom.text = ""
25
35
  pane_bottom.editline
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rcurses
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.6
4
+ version: '0.9'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geir Isene
@@ -14,8 +14,8 @@ description: 'Create panes (with the colors and(or border), manipulate the panes
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.8.6: Cooler
18
- rcurses_example.rb.'
17
+ center align text in panes. Cursor movement around the terminal. New in 0.9: Simplifying
18
+ ANSI codes, catering for LS_COLORS setups.'
19
19
  email: g@isene.com
20
20
  executables: []
21
21
  extensions: