rcurses 0.3 → 0.4.2

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/README.md +8 -9
  3. data/lib/rcurses.rb +0 -0
  4. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b705e1f22c190243e1564cd7b56018b152673e80f49ebfba5e7514ae1ebdc2c8
4
- data.tar.gz: 8caf8faac21c53ef15c3e1845859475b0faadba9524fa960de7b617a4f074f69
3
+ metadata.gz: d0086a66ce8e0bebb76a1ea0f56fc816fefccc48b36f6e3f9a862d8255ad2b4d
4
+ data.tar.gz: c781164e25ea1396daa5ffc7442a6a1b0b933db15b6ee84bfa9a9c0e35650d9a
5
5
  SHA512:
6
- metadata.gz: afbdf8595e9a4d5e8d32e6b229afae6886370f87e4692602a37f6beb501f898b4755cb84c9255ade3f252a850ee836df2691671af30623bbd952e5c3df1baa30
7
- data.tar.gz: eb3093ac60c4452b5c11f9174b7219f359ac93613bc36da413002521d6ec5344bcaf0904a1f309907b76c749d97644b2490262b9a2f953202ea701b6db22c4d1
6
+ metadata.gz: 76b989c3dc607d1999ce35a76f345c1846d3dabc7d3e50f0586b29a9cf37b69fac849f9f9305763f270b7947df627a70364fa08000d54609b929f976d8bede2c
7
+ data.tar.gz: ab2271ca058b6496275abbad3b91ee25ef41e920374c479172fed80af9699cdf01dafad9268df0a771c24a41c252a8ec696ca0c21053e829ac0aaab594217924
data/README.md CHANGED
@@ -12,9 +12,7 @@ Having struggled with the venerable curses library and the ruby interface to it
12
12
  Simple. One file. No external requirements.
13
13
 
14
14
  # Installation
15
- Clone this repo and drop `lib/rcurses.rb` into `/usr/lib/ruby/vendor_ruby/`
16
-
17
- Or simply run `gem install rcurses`.
15
+ Simply run `gem install rcurses`.
18
16
 
19
17
  To use this library do:
20
18
  ```
@@ -33,18 +31,18 @@ require 'rcurses'
33
31
  * The class `Pane` to create and manilpulate panes/boxes
34
32
  * Extensions to the class String to print text in various degrees of fancy and also strip any fanciness
35
33
  * A module `Cursor` to give you cursor movements around the terminal
36
- * A top level function `getchr` to capture a single character input from the user (much better than any Ruby built-ins)
34
+ * A module `Rinput` providing the function `getchr` to capture a single character input from the user (much better than any Ruby built-ins)
37
35
 
38
36
  # class Pane
39
37
  To create a pane do something like this:
40
38
  ```
41
- mypane = Pane.new(80, 30, 30, 10, 19, 229)
39
+ mypane = Rcurses::Pane.new(80, 30, 30, 10, 19, 229)
42
40
  ```
43
41
  This will create a pane/box starting at terminal column/x 80 and row/y 30 with the width of 30 characters and a hight of 10 characters and with the foreground color 19 and background color 229 (from the 256 choices available)
44
42
 
45
43
  The format for creating a pane is:
46
44
  ```
47
- Pane.new(startx, starty, width, height, foregroundcolor, backgroundcolor)
45
+ Rcurses::Pane.new(startx, starty, width, height, foregroundcolor, backgroundcolor)
48
46
  ```
49
47
  You can drop the last two 256-color codes to create a pane with the defaults for your terminal. Also, you can add anything as `startx`, `starty`, `width` or `height` as those values will be run through a Ruby eval and stored in readable variables `x`, `y`, `w` and `h` respectively. So, a hight value of "@maxrow/2" is valid to create a pane with the height of half the terminal height (the integer corresponding to half the terminal height will then be accessible as the variable `h`). Use the variables @maxrow for terminal height and @maxcol for terminal width.
50
48
 
@@ -123,10 +121,11 @@ scroll_up | Scroll display up one line
123
121
  scroll_down | Scroll display down one line
124
122
  clear_screen_down | Clear screen down from current row
125
123
 
126
- # function getchr
124
+ # The function getchr
127
125
  rcurses provides a vital extension to Ruby in reading characters entered by the user. This is especially needed for curses applications where readline inputs are required.
128
-
129
- Simply use `chr = getchr` in a program to read any character input by the user. The returning code (the content of `chr` in this example could be any of the following:
126
+ The function getchr is automatically included in your arsenal when you first do `include rcurses`.
127
+ ```
128
+ Simply use `chr = getchr` in a program to read any character input by the user. The returning code (the content of `chr` in this example) could be any of the following:
130
129
 
131
130
  Key pressed | string returned
132
131
  ----------------|----------------------------------------------------------
data/lib/rcurses.rb CHANGED
Binary file
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.3'
4
+ version: 0.4.2
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-18 00:00:00.000000000 Z
11
+ date: 2024-11-19 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.3: Namespace
18
- fix & gemspec etc included'
17
+ center align text in panes. Cursor movement around the terminal. New in 0.4.2: All
18
+ code except the String extension is now in the module Rcurses (thanks to user havenwood).'
19
19
  email: g@isene.com
20
20
  executables: []
21
21
  extensions: