rcurses 0.6 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 02aaa11077f953d10cfe450fe382a7817973f98a7e3fc91900725c2f342e30b6
4
- data.tar.gz: 902263c2f6483d593ec46753db12278f33968b9c8c8ef5880df693a88b7c38da
3
+ metadata.gz: d559e267a289fc428719cfd673b66255a4a0a36423c53f553c56df2b419a3328
4
+ data.tar.gz: 1760613584e7129426647938030f0ab45425abad33385dfe1e16110fc1c7bcfd
5
5
  SHA512:
6
- metadata.gz: '097902cfdc45e823d02d48fbd4d833be5f966d223b92bfcf0e341fb1b02afb33d63f1fd3e7f45a3c41cc841890020c7ff1326aec56515433d9892382cf9e7572'
7
- data.tar.gz: c98d18052e60dae21e66571c35aa70ac672189c7df1382bb1bac309d5d421884ad7750d0181b15e6840bae8b42c4cc0b1228d08318a2ccbd90ca3421ea43ee61
6
+ metadata.gz: cc095f91cee0f2feaa902051489c6b6dbd261f4cc5ab2a1c8ae386a17d271d7da98ec02cda05b518c5dbf20b3bbac30678b2e7d945deaf99d90965c96dcd7221
7
+ data.tar.gz: ace7718d478179d8d6a0afe48c7efd1959c190ea3d2cb06958f51c717165cd13df3631ca0e9a6218f918ea5339e3d552718d8ac0abb5c7d323c257b579649f80
data/README.md CHANGED
@@ -44,7 +44,7 @@ The format for creating a pane is:
44
44
  ```
45
45
  Rcurses::Pane.new(startx, starty, width, height, foregroundcolor, backgroundcolor)
46
46
  ```
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.
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 "Rcurses::MAXh/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 `Rcurses::MAXh` for terminal height and `Rcurses::MAXw` for terminal width.
48
48
 
49
49
  Avaliable properties/variables:
50
50
 
@@ -196,7 +196,7 @@ end
196
196
  Try this in `irb`:
197
197
  ```
198
198
  require 'rcurses'
199
- mypane = Pane.new("@maxcol/2", 30, 30, 10, 19, 229)
199
+ mypane = Pane.new(Rcurses::MAXw/2, 30, 30, 10, 19, 229)
200
200
  mypane.border = true
201
201
  mypane.text = "Hello".i + " World!".b.i + "\n \n" + "rcurses".r + " " + "is cool".c("16,212")
202
202
  mypane.refresh
@@ -204,6 +204,8 @@ mypane.edit
204
204
  ```
205
205
  ... and then try to add some bold text by enclosing it in '*' and italics by enclosing text in '/'. Then press 'ctrl-s' to save your edited text - and then type `mypane.refresh` to see the result.
206
206
 
207
+ And - try running the example file `rcurses_example.rb`.
208
+
207
209
  # Not yet implemented
208
210
  Let me know what other features you like to see.
209
211
 
data/lib/rcurses.rb CHANGED
Binary file
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'rcurses'
4
+
5
+ # pane = Rcurses::Pane.new( startx, starty, width, height, fg, bg)
6
+ pane_top = Rcurses::Pane.new( 1, 1, Rcurses::MAXw, 1, 255, 236)
7
+ pane_bottom = Rcurses::Pane.new( 1, Rcurses::MAXh, Rcurses::MAXw, 1, 236, 254)
8
+ pane_left = Rcurses::Pane.new( 1, 2, Rcurses::MAXw/2, Rcurses::MAXh - 2, 17, 117)
9
+ pane_right = Rcurses::Pane.new(Rcurses::MAXw/2 + 1, 2, Rcurses::MAXw/2, Rcurses::MAXh - 2, 255, 52)
10
+
11
+ pane_left.align = "c"
12
+ pane_right.align = "r"
13
+
14
+ pane_top.text = "This is an information line at the top".b.i
15
+ pane_left.text = "\n\n" + "Here is a pane to be reckoned with".b
16
+ pane_right.text = "\n\n" + "And here is the right pane. "
17
+ pane_bottom.prompt = "Enter any text and press ENTER: ".b
18
+
19
+ pane_top.refresh
20
+ pane_left.refresh
21
+ pane_right.refresh
22
+ 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.6'
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geir Isene
@@ -14,8 +14,7 @@ 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.6: Better
18
- edit function.'
17
+ center align text in panes. Cursor movement around the terminal. New in 0.7.1: Bugfixes.'
19
18
  email: g@isene.com
20
19
  executables: []
21
20
  extensions:
@@ -25,6 +24,7 @@ files:
25
24
  - README.md
26
25
  - extconf.rb
27
26
  - lib/rcurses.rb
27
+ - rcurses_example.rb
28
28
  homepage: https://isene.com/
29
29
  licenses:
30
30
  - Unlicense