rcurses 6.3.3 → 7.0.0

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: 8da51fe4d11778fce9941e08a03f67ec108f3f09e0625a32335a6ea1a953375d
4
- data.tar.gz: 1379e2f96f8fa20d20e73111ac47df90aab71ecd1897cf3816fb78bb5294c5d1
3
+ metadata.gz: 5fd1bb1d4f965fe2e194fbbf07f967a029374484393685305ebaeb9127b28cc3
4
+ data.tar.gz: 63ceffeb1d7c2ef3ed6d45d5e614349ef6ffe00e5c7f55d32b41f3c2dad7be33
5
5
  SHA512:
6
- metadata.gz: 761fd3c178607f530c6b9fe0ad4bc997fb2c3872e70068b21c913d719c941ed766222d75efc16fa5fcd5de3131fe6f5859b07c269c7c59ea831fa612d9313252
7
- data.tar.gz: 0b110d9d36765c614b01539af2ec38b85cf8237888d297667e736e6711a1d0a68aa10ff107fc05e61f02cbd2c07765df8d15a3cb2adaf442abfe447929a78154
6
+ metadata.gz: 30a678a1cdb2e963ffba154bdf8c557da06aecc22b591f4303e7bc80767eb2ca0ca0ff80a4bfa0069a1dbbb04ce695698af66dfb4806309977ad48a69187fafe
7
+ data.tar.gz: 4f16961b164ffc644d8f3cfc3a05896dbcd44fc593ef4678a6e82a3560e052ba179bfff3fa5f4c7a916f8e42358dfec00a001173a389e3fe46ecc5f541a0c66c
data/README.md CHANGED
@@ -179,13 +179,13 @@ Method | Description
179
179
  fg(fg) | Set text to be printed with the foreground color `fg` (example: `"TEST".fg(84)`)
180
180
  bg(bg) | Set text to be printed with the background color `bg` (example: `"TEST".bg("dd32a9")`)
181
181
  fb(fg, bg) | Set text to be printed with the foreground color `fg` and background color `bg` (example: `"TEST".fb(84,196)`)
182
- b | Set text to be printed in bold (example: `"TEST".b`)
183
- i | Set text to be printed in italic (example: `"TEST".i`)
184
- u | Set text to be printed underlined (example: `"TEST".u`)
182
+ bd | Set text to be printed in bold (example: `"TEST".bd`)
183
+ it | Set text to be printed in italic (example: `"TEST".it`)
184
+ ul | Set text to be printed underlined (example: `"TEST".ul`)
185
185
  l | Set text to be printed blinking (example: `"TEST".l`)
186
- r | Set text to be printed in reverse colors (example: `"TEST".r`)
186
+ rv | Set text to be printed in reverse colors (example: `"TEST".rv`)
187
187
  c(code) | Use coded format like "TEST".c("204,45,bui") to print "TEST" in bold, underline italic, fg=204 and bg=45 (the format is `.c("fg,bg,biulr")`)
188
- pure | Strip text of any "dressing" (example: with `text = "TEST".b`, you will have bold text in the variable `text`, then with `text.pure` it will show "uncoded" or pure text)
188
+ pure | Strip text of any "dressing" (example: with `text = "TEST".bd`, you will have bold text in the variable `text`, then with `text.pure` it will show "uncoded" or pure text)
189
189
  clean_ansi | Strip seemingly uncolored strings of ansi code (those that are enclosed in "\e[0m"
190
190
  shorten(n) | Shorten the pure version of the string to 'n' characters, preserving any ANSI coding
191
191
  inject("chars",pos) | Inject "chars" at position 'pos' in the pure version of the string (if 'pos' is '-1', then append at end). Preserves any ANSI code
@@ -416,10 +416,9 @@ end
416
416
  **Problem:** `wait_readable` method not found.
417
417
  **Solution:** Always include `require 'io/wait'` for stdin flush.
418
418
 
419
- ### 5. `String#b` Overrides Ruby's Built-in Binary Method
420
- **Problem:** rcurses defines `String#b` for bold formatting, but Ruby's built-in `String#b` returns a binary-encoded copy of the string. Any code using `''.b` or `str.b` for binary I/O will silently get ANSI bold codes instead.
421
- **Impact:** Binary protocol parsers, socket readers, and encoding-sensitive code will break when rcurses is loaded.
422
- **Workaround:** Use `String.new(encoding: 'ASCII-8BIT')` instead of `''.b` when you need binary strings in code that coexists with rcurses.
419
+ ### 5. String formatting methods renamed in 7.0.0
420
+ **Change:** In version 7.0.0, the short method names were renamed to avoid conflicts with Ruby built-ins: `.b` became `.bd` (bold), `.i` became `.it` (italic), `.u` became `.ul` (underline), `.r` became `.rv` (reverse). The old `.b` method conflicted with Ruby's built-in `String#b` which returns a binary-encoded copy of the string.
421
+ **Migration:** Replace `.b` with `.bd`, `.i` with `.it`, `.u` with `.ul`, `.r` with `.rv` in your code.
423
422
 
424
423
  ### 6. Border Changes Not Visible
425
424
  **Problem:** Changing pane border property doesn't show visual changes.
@@ -450,7 +449,7 @@ require 'rcurses'
450
449
  @max_h, @max_w = IO.console.winsize
451
450
  mypane = Rcurses::Pane.new(@max_w/2, 30, 30, 10, 19, 229)
452
451
  mypane.border = true
453
- mypane.text = "Hello".i + " World!".b.i + "\n \n" + "rcurses".r + " " + "is cool".c("16,212")
452
+ mypane.text = "Hello".it + " World!".bd.it + "\n \n" + "rcurses".rv + " " + "is cool".c("16,212")
454
453
  mypane.refresh
455
454
  mypane.edit
456
455
  ```
@@ -14,10 +14,10 @@ pane_right = Rcurses::Pane.new(@max_w/2 + 1, 2, @max_w/2, @max_h - 2,
14
14
  pane_left.border = true # Adding a border to the left pane
15
15
 
16
16
  # Add content to the panes
17
- pane_top.text = Time.now.to_s[0..15].b + " Welcome to the rcurses example program"
17
+ pane_top.text = Time.now.to_s[0..15].bd + " Welcome to the rcurses example program"
18
18
  pane_left.text = `ls --color`
19
19
  pane_right.text = "Output of free:\n\n" + `free`
20
- pane_bottom.prompt = "Enter any text and press ENTER: ".b # The prompt text before the user starts writing content
20
+ pane_bottom.prompt = "Enter any text and press ENTER: ".bd # The prompt text before the user starts writing content
21
21
 
22
22
  pane_top.refresh # This is the order of drawing/refreshing the panes
23
23
  pane_left.refresh # ...then the left pane
@@ -27,7 +27,7 @@ pane_bottom.editline # Do not use a refresh before editline
27
27
  # Then create a "pop-up" pane in the middle of the screen
28
28
  pane_mid = Rcurses::Pane.new(@max_w/2 - 10, @max_h/2 - 5, 20, 10, 18, 254)
29
29
  pane_mid.border = true
30
- pane_mid.text = "You wrote:" + "\n" + pane_bottom.text.i
30
+ pane_mid.text = "You wrote:" + "\n" + pane_bottom.text.it
31
31
  pane_mid.align = "c"
32
32
  pane_mid.refresh
33
33
 
data/lib/rcurses/emoji.rb CHANGED
@@ -197,13 +197,13 @@ module Rcurses
197
197
  tab_rows << []
198
198
  row_w = 0
199
199
  end
200
- tab_rows.last << (i == cat_idx ? tab.b.r : tab)
200
+ tab_rows.last << (i == cat_idx ? tab.bd.rv : tab)
201
201
  row_w += tw
202
202
  end
203
203
  tab_rows.each { |tr| lines << tr.join("") }
204
204
  header_lines = tab_rows.size
205
205
  else
206
- lines << " Search: #{search}".b
206
+ lines << " Search: #{search}".bd
207
207
  header_lines = 1
208
208
  end
209
209
  lines << ""
data/lib/rcurses/pane.rb CHANGED
@@ -477,10 +477,10 @@ module Rcurses
477
477
  end
478
478
 
479
479
  def parse(cont)
480
- cont.gsub!(/\*(.+?)\*/, '\1'.b)
481
- cont.gsub!(/\/(.+?)\//, '\1'.i)
482
- cont.gsub!(/_(.+?)_/, '\1'.u)
483
- cont.gsub!(/#(.+?)#/, '\1'.r)
480
+ cont.gsub!(/\*(.+?)\*/, '\1'.bd)
481
+ cont.gsub!(/\/(.+?)\//, '\1'.it)
482
+ cont.gsub!(/_(.+?)_/, '\1'.ul)
483
+ cont.gsub!(/#(.+?)#/, '\1'.rv)
484
484
  cont.gsub!(/<([^|]+)\|([^>]+)>/) do
485
485
  text = $2; codes = $1
486
486
  text.c(codes)
@@ -45,11 +45,11 @@ class String
45
45
  end
46
46
 
47
47
  # bold, italic, underline, blink, reverse
48
- def b; color(self, "\e[1m", "\e[22m"); end
49
- def i; color(self, "\e[3m", "\e[23m"); end
50
- def u; color(self, "\e[4m", "\e[24m"); end
48
+ def bd; color(self, "\e[1m", "\e[22m"); end
49
+ def it; color(self, "\e[3m", "\e[23m"); end
50
+ def ul; color(self, "\e[4m", "\e[24m"); end
51
51
  def l; color(self, "\e[5m", "\e[25m"); end
52
- def r; color(self, "\e[7m", "\e[27m"); end
52
+ def rv; color(self, "\e[7m", "\e[27m"); end
53
53
 
54
54
  # Internal helper - wraps +text+ in start/end sequences,
55
55
  # and re-applies start on every newline.
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: 6.3.3
4
+ version: 7.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geir Isene
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-03-29 00:00:00.000000000 Z
11
+ date: 2026-04-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: clipboard