rcurses 2.4.1 → 2.4.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7c231359439921bfa6f6da0d36db67cf20daf67054031b64b1362cf17a121f36
4
- data.tar.gz: 07af990392aca529a25aec404f3a92db948eb64dddd4811c8b9f6f80adca5d55
3
+ metadata.gz: '0242225387152024f958dd6d49e9671626e07589c514910258f8bb092c73eb90'
4
+ data.tar.gz: b745692855fcdd6fae65b1fd82126e006737d2923eaf1d4b4cdcea8c19f98734
5
5
  SHA512:
6
- metadata.gz: c3d9d2f610c73f034474376e98aac7c63180e6ad1d224f8a0f57898ede77c37679548845b1d21e68f18aa59d187b64808ea417a3a1821b14a78041f35703c1f8
7
- data.tar.gz: 006b678e16cd6108fc615cb87e7d7937d88d1e556407e7258a6e6b68a9d0d911652277b8ece6e08f11e6479527b081d994d486dfcd72d9fed592ef6bb5995803
6
+ metadata.gz: 9bf0a7aac4eeaf767aea8d3f3ec3f529cf633184cb9b771b124dcb9236fcbf9ec6cb458db301e870539c79c3bfba80cd4bb9d5eb8f343265d858d0896ed73c5a
7
+ data.tar.gz: 4f792ed8261eea7b65cc17b95333ccc940843cdb77734f840fdbda3b45e8e671ab221c87e38dd6e38c83bcf6cb9d34674815f13843d998a340f5e100cb7acad4
data/README.md CHANGED
@@ -121,8 +121,8 @@ up(n = 1) | Move cursor up by n (default is 1 character up)
121
121
  down(n = 1) | Move cursor down by n (default is 1 character down)
122
122
  left(n = 1) | Move cursor backward by n (default is one character)
123
123
  right(n = 1) | Move cursor forward by n (default is one character)
124
- next_line) | Move cursor down to beginning of next line
125
- prev_line) | Move cursor up to beginning of previous line
124
+ next_line | Move cursor down to beginning of next line
125
+ prev_line | Move cursor up to beginning of previous line
126
126
  clear_char(n = 1) | Erase n characters from the current cursor position (default is one character)
127
127
  clear_line | Erase the entire current line and return to beginning of the line
128
128
  clear_line_before | Erase from the beginning of the line up to and including the current cursor position
@@ -202,6 +202,8 @@ while $stdin.ready?
202
202
  chr += $stdin.getc
203
203
  end
204
204
  ```
205
+ You can also pass two parameters to `getchr` with `getchr(min, time)` where `min` instructs getchr to wait for the minimum number of characters to return (not very useful) - and `time` is the timeout for waiting (can be very useful). You can happily call `getchr` without these parameters.
206
+
205
207
 
206
208
  # Example
207
209
 
data/lib/rcurses/input.rb CHANGED
@@ -1,8 +1,8 @@
1
1
  module Rcurses
2
2
  module Input
3
- def getchr
3
+ def getchr(m = nil, t = nil)
4
4
  # Function to process key presses
5
- c = $stdin.getch
5
+ c = $stdin.getch(min: m, time: t)
6
6
  case c
7
7
  when "\e" # ANSI escape sequences
8
8
  return "ESC" if !$stdin.ready?
data/lib/rcurses.rb CHANGED
@@ -5,7 +5,7 @@
5
5
  # Web_site: http://isene.com/
6
6
  # Github: https://github.com/isene/rcurses
7
7
  # License: Public domain
8
- # Version: 2.4: Show cursor on edit. Changed hide_cursor and show_cursor to hide and show.
8
+ # Version: 2.4.2: Added parameters 'min' and 'time' to getchr
9
9
 
10
10
  require 'io/console' # Basic gem for rcurses
11
11
  require 'io/wait' # stdin handling
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rcurses
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.1
4
+ version: 2.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: 2025-03-12 00:00:00.000000000 Z
11
+ date: 2025-03-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: clipboard
@@ -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.4: Show cursor on edit.
33
- Changed hide_cursor and show_cursor to hide and show. 2.4.1: Minor fixes'
32
+ in panes. Cursor movement around the terminal. New in 2.4.2: Added parameters ''min''
33
+ and ''time'' to getchr'
34
34
  email: g@isene.com
35
35
  executables: []
36
36
  extensions: []