rubytext 0.0.16 → 0.0.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/rubytext.rb +20 -10
- data/lib/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 08ffa85b81ca450d7b1df0fba494d0aee54ec671
|
4
|
+
data.tar.gz: 3685f3c683f9009bbff2cc60b0bc716c33d5e892
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f0f9d3b51e1f72efe4d5d581462afa3d8b66f997b2d5a340df311a5cb8041105645cdefad5e7e3a393e6c4f5f38f9e8b62385632426e6407e5042f790d83fed
|
7
|
+
data.tar.gz: 32b5f34ec3ceca5d567309f6111163a3bac396c90710b0af773d71b09c08d14256b7ec6cee670d604bb6accccfb08c2b4b450aa797f8b05c06e79e1200b0efc1
|
data/lib/rubytext.rb
CHANGED
@@ -20,8 +20,8 @@ module RubyText
|
|
20
20
|
Colors.each do |bc|
|
21
21
|
fg = X.const_get("COLOR_#{fc.upcase}")
|
22
22
|
bg = X.const_get("COLOR_#{bc.upcase}")
|
23
|
-
|
24
|
-
ColorPairs[[fg, bg]] =
|
23
|
+
X.init_pair(num+=1, fg, bg) # FIXME backwards?
|
24
|
+
ColorPairs[[fg, bg]] = num
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
@@ -50,8 +50,8 @@ module RubyText
|
|
50
50
|
debug "Entering Window.main"
|
51
51
|
@main_win = X.init_screen
|
52
52
|
X.start_color
|
53
|
-
|
54
|
-
|
53
|
+
# X.init_pair(1, X::COLOR_BLACK, X::COLOR_WHITE)
|
54
|
+
# X.stdscr.bkgd(X.color_pair(1)|X::A_NORMAL)
|
55
55
|
rows, cols = @main_win.maxy, @main_win.maxx
|
56
56
|
debug "About to call .make"
|
57
57
|
@screen = self.make(@main_win, rows, cols, 0, 0, false, "white", "black")
|
@@ -102,14 +102,19 @@ module RubyText
|
|
102
102
|
|
103
103
|
def self.start(*args, log: nil, fg: nil, bg: nil)
|
104
104
|
$debug = File.new(log, "w") if log
|
105
|
-
|
106
|
-
|
105
|
+
# fg ||= :white
|
106
|
+
# bg ||= :black
|
107
|
+
debug "Version = #{RubyText::Version}"
|
108
|
+
$debug.flush
|
107
109
|
debug "fg = #{fg} is not a valid color" unless Colors.include?(fg.to_s)
|
108
110
|
debug "bg = #{bg} is not a valid color" unless Colors.include?(bg.to_s)
|
111
|
+
debug "Colors are: #{fg} on #{bg}"
|
109
112
|
fg = X.const_get("COLOR_#{fg.upcase}")
|
110
113
|
bg = X.const_get("COLOR_#{bg.upcase}")
|
111
|
-
|
112
|
-
|
114
|
+
debug "Curses colors are: #{fg} on #{bg}"
|
115
|
+
cp = ColorPairs[[fg, bg]]
|
116
|
+
debug "cp is: #{cp}"
|
117
|
+
X.stdscr.bkgd(cp|X::A_NORMAL)
|
113
118
|
X.noecho
|
114
119
|
X.stdscr.keypad(true)
|
115
120
|
X.cbreak # by default
|
@@ -160,7 +165,7 @@ class RubyText::Window
|
|
160
165
|
@outer = @win
|
161
166
|
@outer.refresh
|
162
167
|
debug "About to call again: params = #{[high-2, wide-2, r0+1, c0+1]}"
|
163
|
-
@win = X::Window.new(high-2, wide-2, r0+1, c0+1, false, fg, bg) # relative now??
|
168
|
+
@win = X::Window.new(high-2, wide-2, r0+1, c0+1) # , false, fg, bg) # relative now??
|
164
169
|
else
|
165
170
|
@outer = @win
|
166
171
|
end
|
@@ -171,7 +176,7 @@ class RubyText::Window
|
|
171
176
|
|
172
177
|
def delegate_output(sym, *args)
|
173
178
|
args = [""] if args.empty?
|
174
|
-
|
179
|
+
# debug "#{sym}: args = #{args.inspect}"
|
175
180
|
if sym == :p
|
176
181
|
args.map!(&:inspect)
|
177
182
|
else
|
@@ -214,6 +219,11 @@ class RubyText::Window
|
|
214
219
|
end
|
215
220
|
end
|
216
221
|
|
222
|
+
def down
|
223
|
+
r, c = rc
|
224
|
+
go r+1, c
|
225
|
+
end
|
226
|
+
|
217
227
|
def rc
|
218
228
|
[@win.cury, @win.curx]
|
219
229
|
end
|
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.17
|
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-11-
|
11
|
+
date: 2018-11-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: curses
|
@@ -54,7 +54,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
54
54
|
version: '0'
|
55
55
|
requirements: []
|
56
56
|
rubyforge_project:
|
57
|
-
rubygems_version: 2.
|
57
|
+
rubygems_version: 2.2.2
|
58
58
|
signing_key:
|
59
59
|
specification_version: 4
|
60
60
|
summary: A thick wrapper for Curses
|