rubytext 0.0.74 → 0.0.75
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 +4 -4
- data/lib/effects.rb +8 -0
- data/lib/output.rb +17 -5
- data/lib/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a2acea42c858102e0d0981aff34471d14c59fb2d4d62b59f20dc0f90043df6b7
|
4
|
+
data.tar.gz: 6eb49c4aebe900917daa32b677af256d8be771ce2f18d6a85b3c1c36404e15d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 49eeaa10f9ef6ace669de200771ec4419606de81c3bd5c73fd1087af35a0966dcfd2fbfb87bac3aaca53d8b318e40b34f956ce37d1c63e0aaa830f1beb833599
|
7
|
+
data.tar.gz: 74a6745f51c1a62fe2b16679d1e114ede879f10ae51838a6ecdfb597feb42584ef9fbc08b96ff844165f6c93216b21e0ad7f32636f41f1abd520062bd5756e4b
|
data/lib/effects.rb
CHANGED
@@ -31,9 +31,17 @@ class RubyText::Effects # dumb name?
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def set(win)
|
34
|
+
# Save off current state?
|
35
|
+
@old_fg = win.fg
|
34
36
|
attr, fg = self.value, self.fg
|
35
37
|
win.cwin.attron(attr)
|
36
38
|
win.set_colors(fg, win.bg) if fg
|
37
39
|
end
|
40
|
+
|
41
|
+
def reset(win)
|
42
|
+
attr = self.value
|
43
|
+
win.cwin.attroff(attr)
|
44
|
+
win.set_colors(@old_fg, win.bg) if fg
|
45
|
+
end
|
38
46
|
end
|
39
47
|
|
data/lib/output.rb
CHANGED
@@ -8,11 +8,6 @@ class RubyText::Window
|
|
8
8
|
self.puts str
|
9
9
|
end
|
10
10
|
|
11
|
-
def putch(ch) # move to WindowIO?
|
12
|
-
r, c = self.rc
|
13
|
-
self[r, c] = ch[0]
|
14
|
-
end
|
15
|
-
|
16
11
|
# FIXME Please refactor the Hal out of this.
|
17
12
|
|
18
13
|
def effect?(arg)
|
@@ -68,6 +63,20 @@ class RubyText::Window
|
|
68
63
|
self.print *args
|
69
64
|
end
|
70
65
|
|
66
|
+
def putch(ch, r: nil, c: nil, fx: nil)
|
67
|
+
r0, c0 = self.rc
|
68
|
+
r ||= r0
|
69
|
+
c ||= c0
|
70
|
+
go(r, c) do
|
71
|
+
fx.set(self) if fx
|
72
|
+
val = fx.value rescue 0
|
73
|
+
@cwin.addch(ch.ord|val)
|
74
|
+
# @win.refresh
|
75
|
+
end
|
76
|
+
fx.reset(self) if fx
|
77
|
+
# self[r, c] = ch[0]
|
78
|
+
end
|
79
|
+
|
71
80
|
def crlf # Technically not output...
|
72
81
|
r, c = rc
|
73
82
|
if @scrolling
|
@@ -167,5 +176,8 @@ module WindowIO
|
|
167
176
|
str
|
168
177
|
end
|
169
178
|
|
179
|
+
def putch(ch, r: nil, c: nil, fx: nil)
|
180
|
+
$stdscr.putch(ch, r: r, c: c, fx: fx)
|
181
|
+
end
|
170
182
|
end
|
171
183
|
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubytext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.75
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hal Fulton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-12-
|
11
|
+
date: 2018-12-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: curses
|
@@ -102,7 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
102
102
|
version: '0'
|
103
103
|
requirements: []
|
104
104
|
rubyforge_project:
|
105
|
-
rubygems_version: 2.7.
|
105
|
+
rubygems_version: 2.7.8
|
106
106
|
signing_key:
|
107
107
|
specification_version: 4
|
108
108
|
summary: A thick wrapper for Curses
|