rcurses 2.5 → 2.6

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -0
  3. data/lib/rcurses/pane.rb +12 -0
  4. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d761408b4f05dc23d8ce7bbccee6e205f197a7121755ecda26a12f07cf1c3270
4
- data.tar.gz: 0abd1a9a7b67cb96a9a00c537d17c414f8ceb78e78747627cd49305bf22bf57f
3
+ metadata.gz: 85c679d06754d9afd2c33e55e44d700d37333f197ffb1d753ef3ff8bbdf15e1b
4
+ data.tar.gz: 5f2c74a5a789c93c6406bb761fffc769d13ab8e0723b743f408e264cfd61614a
5
5
  SHA512:
6
- metadata.gz: 641587c5622dee1f388f027a3bbec71f5072a74cdbe0ed7dc26fcc33e17fc112a22422d81785f32ca3d46398130809d44cd6f6f3f831819fd005bee791735b77
7
- data.tar.gz: e6b7d6ccb2024490326d3a2452a361b8886b5518f0c9a2d8015f79345911cbc7898b64ecf228333dd6099631c9214aa09a56ea9a8d089fa30d02494f802a85fa
6
+ metadata.gz: 19854a5865cfe09fcdcad1c8e9540ac5eb29a704f1b8e0b9626e6c69e8b51f5991411ea5f60bf8f9eb6a67725b89f3c3debfe2fc0af0857e3a770e103603ffae
7
+ data.tar.gz: 22f2e416110f65bdedad83a967464d6072affa79b45facf5c38abf3ae80cbe22ec1a0d2041c57f295082e98a0529994f4b8c352443e578853a27792009a02f18
data/README.md CHANGED
@@ -81,6 +81,8 @@ edit | An editor for the Pane. When this is invoked, all existing font
81
81
  editline | Used for one-line Panes. It will print the content of the property `prompt` and then the property `text` that can then be edited by the user. Hitting `ESC` will disregard the edits, while `ENTER` will save the edited text
82
82
  puts(text) | Short form for setting panel.text, then doing a refresh of that panel
83
83
  ask(prompt,text) | Short form of setting panel.prompt, then panel.text, doing a panel.editline and then returning panel.text
84
+ pagedown | Go down one page height in the text (minus one line), but not longer than the length of the text
85
+ pageup | Go up one page height in the text (minus one line)
84
86
 
85
87
  # class String extensions
86
88
  Method extensions provided for the class String:
data/lib/rcurses/pane.rb CHANGED
@@ -38,6 +38,18 @@ module Rcurses
38
38
  refresh
39
39
  end
40
40
 
41
+ def pageup
42
+ @ix = @ix - @h + 1
43
+ @ix = 0 if @ix < 0
44
+ refresh
45
+ end
46
+
47
+ def pagedown
48
+ @ix = @ix + @h - 1
49
+ @ix = @text.length - 1 if @ix > @text.length - 1
50
+ refresh
51
+ end
52
+
41
53
  def refresh(cont = @text)
42
54
  @max_h, @max_w = IO.console.winsize
43
55
 
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: '2.5'
4
+ version: '2.6'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geir Isene
@@ -29,8 +29,8 @@ description: 'Create curses applications for the terminal easier than ever. Crea
29
29
  up text (in panes or anywhere in the terminal) in bold, italic, underline, reverse
30
30
  color, blink and in any 256 terminal colors for foreground and background. Use a
31
31
  simple editor to let users edit text in panes. Left, right or center align text
32
- in panes. Cursor movement around the terminal. New in 2.5: Simplified the over-engineering,
33
- removing startx, starty, width and height of pane creation.'
32
+ in panes. Cursor movement around the terminal. New in 2.6: Added methods ''pagedown''
33
+ and ''pageup'' to panes enabling text scrolling.'
34
34
  email: g@isene.com
35
35
  executables: []
36
36
  extensions: []