rubytext 0.0.72 → 0.0.73
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/examples/ide.rb +0 -2
- data/examples/prog20.rb +9 -9
- data/examples/slides +1 -1
- data/lib/output.rb +7 -11
- data/lib/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8aab3de408243095abccb5ccd7096708f0aff51e5aa27d04fd2e27e8fa1b870c
|
4
|
+
data.tar.gz: f3a0c894e21d5e498287942c078b730cc18431d7455e1f8cf1267691419927fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59fdd86f11a6532e19a976b587a163fab2f75b4830e2f37469ec2c48ee621e8f03829198201084d565096bd786581761bc5b59cf36c85d7e12bc07047449093e
|
7
|
+
data.tar.gz: 389232176c392a98f8b2a961d3cb9a21496b154f1be949e615720cb8551a8ae132e09e54bb2f4b34872fcf7ad499064e9a1ee1cc716b354fc1dbdd3a2b0096a7
|
data/examples/ide.rb
CHANGED
data/examples/prog20.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
def
|
1
|
+
def effect(*args) # find better way
|
2
2
|
RubyText::Effects.new(*args)
|
3
3
|
end
|
4
4
|
|
@@ -8,11 +8,11 @@ win = RubyText.window(9, 65, 2, 26, fg: fg, bg: bg)
|
|
8
8
|
win.puts "This is EXPERIMENTAL (and BUGGY)."
|
9
9
|
win.puts "Use an \"effect\" to change the text color or \"look\":"
|
10
10
|
|
11
|
-
win.puts "This is",
|
12
|
-
|
13
|
-
win.puts "We can ",
|
14
|
-
"and ",
|
15
|
-
"and ",
|
16
|
-
|
17
|
-
win.puts "This is ",
|
18
|
-
|
11
|
+
win.puts "This is", effect(win, Yellow), " another color ",
|
12
|
+
effect(win, White), "and yet another."
|
13
|
+
win.puts "We can ", effect(win, :bold), "boldface ",
|
14
|
+
"and ", effect(win, :reverse), "reverse ",
|
15
|
+
"and ", effect(win, :under), "underline ",
|
16
|
+
effect(win, :normal), "text at will.\n "
|
17
|
+
win.puts "This is ", effect(win, :bold, Red), "bold red ",
|
18
|
+
effect(win, :normal, fg), "and this is normal again.\n "
|
data/examples/slides
CHANGED
data/lib/output.rb
CHANGED
@@ -23,33 +23,29 @@ class RubyText::Window
|
|
23
23
|
self.cwin.attrset(0)
|
24
24
|
args = [""] if args.empty?
|
25
25
|
args += ["\n"] if sym == :puts
|
26
|
-
# debug "\ndelegate_output:"
|
27
|
-
# debug " 1. args = #{args.inspect}"
|
28
26
|
set_colors(@fg, @bg)
|
29
27
|
debug " set colors: #{[@fg, @bg].inspect}"
|
30
28
|
if sym == :p
|
31
29
|
args.map! {|x| effect?(x) ? x : x.inspect }
|
32
|
-
# debug " 2. args = #{args.inspect}"
|
33
30
|
else
|
34
31
|
args.map! {|x| effect?(x) ? x : x.to_s }
|
35
|
-
# debug " 3. args = #{args.inspect}"
|
36
32
|
end
|
37
33
|
args.each do |arg|
|
38
|
-
# debug " loop: arg = #{arg.inspect}"
|
39
34
|
if arg.is_a?(RubyText::Effects)
|
40
|
-
|
41
|
-
self.cwin.attron(
|
42
|
-
|
43
|
-
|
35
|
+
attr, fg = arg.value, arg.fg
|
36
|
+
self.cwin.attron(attr)
|
37
|
+
self.set_colors(fg, @bg) if fg
|
38
|
+
elsif arg.respond_to? :effect
|
39
|
+
attr, fg = arg.effect.value, arg.effect.fg
|
40
|
+
self.cwin.attron(attr)
|
41
|
+
self.set_colors(fg, @bg) if fg
|
44
42
|
else
|
45
|
-
# debug " printing arg = #{arg.inspect}"
|
46
43
|
arg.each_char {|ch| ch == "\n" ? crlf : @cwin.addch(ch) }
|
47
44
|
@cwin.refresh
|
48
45
|
end
|
49
46
|
end
|
50
47
|
crlf if sym == :p
|
51
48
|
set_colors(@fg, @bg)
|
52
|
-
# debug " set colors: #{[@fg, @bg].inspect}"
|
53
49
|
@cwin.refresh
|
54
50
|
end
|
55
51
|
|
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.73
|
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-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: curses
|