curses-extension 2.1 → 2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/curses-extension.rb +5 -0
- data/lib/curses-template.rb +6 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '04280f3b09961bca34f139e055228c7206b28dcae370c22ae0417dca8fbb5fc2'
|
4
|
+
data.tar.gz: 063e86ad7733dd4c5ee83664a59a3a3dbf59e45bdfda09a8efc1bc4e09cfd392
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 65c963c468c4b9101e59f9208815b58bb4d9f7bb07c34298aa1628a3f783de61cf9de186bed60f6b0246bd1f20be7eb9d4bfbb7cede62e7952e33fa17aa6f1bf
|
7
|
+
data.tar.gz: c80f69f856b9a4faacdabf5a3bc8b8f69293b463f1b6f9b308319b98146d7ba6a0516387bb2e65cec4a121bfc96d2b06682851b1fb2b84ef293994e49e170198
|
data/lib/curses-extension.rb
CHANGED
@@ -75,6 +75,11 @@ class Curses::Window # CLASS EXTENSION
|
|
75
75
|
self.attron(color_pair(cp) | attr) { self << text }
|
76
76
|
self.refresh
|
77
77
|
end
|
78
|
+
def nl(bg = self.bg)
|
79
|
+
bg = 232 if bg == nil
|
80
|
+
f = " " * (self.maxx - self.curx)
|
81
|
+
self.p(self.fg, bg, self.attr, f)
|
82
|
+
end
|
78
83
|
def pclr(fg = self.fg, bg = self.bg, attr = self.attr, text) # Puts text to window with full set of attributes and clears rest of window
|
79
84
|
self.p(fg, bg, attr, text)
|
80
85
|
self.clr_from_cur_line
|
data/lib/curses-template.rb
CHANGED
@@ -103,10 +103,15 @@ class Curses::Window # CLASS EXTENSION
|
|
103
103
|
fg = 255 if fg == nil
|
104
104
|
bg = 0 if bg == nil
|
105
105
|
attr = 0 if attr == nil
|
106
|
-
cp
|
106
|
+
cp = Curses::Window.pair(fg, bg)
|
107
107
|
self.attron(color_pair(cp) | attr) { self << text }
|
108
108
|
self.refresh
|
109
109
|
end
|
110
|
+
def nl(bg = self.bg)
|
111
|
+
bg = 232 if bg == nil
|
112
|
+
f = " " * (self.maxx - self.curx)
|
113
|
+
self.p(self.fg, bg, self.attr, f)
|
114
|
+
end
|
110
115
|
def pclr(fg = self.fg, bg = self.bg, attr = self.attr, text) # Puts text to window with full set of attributes and clears rest of window
|
111
116
|
self.p(fg, bg, attr, text)
|
112
117
|
self.clr_from_cur_line
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: curses-extension
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '2.
|
4
|
+
version: '2.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: 2023-07-
|
11
|
+
date: 2023-07-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: curses
|
@@ -35,7 +35,8 @@ description: 'The Ruby curses library is sorely lacking some important features.
|
|
35
35
|
terminal curses applications in Ruby. See the Github page for information on what
|
36
36
|
properties and functions are included: https://github.com/isene/Ruby-Curses-Class-Extension.
|
37
37
|
The curses_template.rb is also installed in the lib directory and serves as the
|
38
|
-
basis for my own curses applications. New in 2.
|
38
|
+
basis for my own curses applications. New in 2.2: "Added the method `nl`, an effective
|
39
|
+
newline"'
|
39
40
|
email: g@isene.com
|
40
41
|
executables: []
|
41
42
|
extensions: []
|