rubytext 0.0.72 → 0.0.73

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: b3736e2791cf23d42807517df4cfe769d2ec39a37e1d83f5c821b659f4303927
4
- data.tar.gz: eb10a35201cfb772ed3e305e4810d411a9172804932fdca6bdf0fac6ac4d46c7
3
+ metadata.gz: 8aab3de408243095abccb5ccd7096708f0aff51e5aa27d04fd2e27e8fa1b870c
4
+ data.tar.gz: f3a0c894e21d5e498287942c078b730cc18431d7455e1f8cf1267691419927fc
5
5
  SHA512:
6
- metadata.gz: 9ec76711b390cc2f70b323ec1d22163beb03b56947f5f3b9ab18545968f55cb7aaf7053933430f3bd4512ba20d3f90e23aef8b8a58ba524c154dcd3ce78fd015
7
- data.tar.gz: 9a0603eaee4606b092963aa85b0dd71babbff7ba9304e80a08c315da2a3cf2acb74fb44faa62c9eb264b52f77c84445a24a0a8017d603423dfe9b8cdcba56902
6
+ metadata.gz: 59fdd86f11a6532e19a976b587a163fab2f75b4830e2f37469ec2c48ee621e8f03829198201084d565096bd786581761bc5b59cf36c85d7e12bc07047449093e
7
+ data.tar.gz: 389232176c392a98f8b2a961d3cb9a21496b154f1be949e615720cb8551a8ae132e09e54bb2f4b34872fcf7ad499064e9a1ee1cc716b354fc1dbdd3a2b0096a7
data/examples/ide.rb CHANGED
@@ -7,8 +7,6 @@ require 'rubytext'
7
7
 
8
8
  RubyText.start
9
9
 
10
- # print " " # FIXME - bug requires this?
11
-
12
10
  @lib, @code = ARGV
13
11
 
14
12
  def shell(str)
data/examples/prog20.rb CHANGED
@@ -1,4 +1,4 @@
1
- def fx(*args) # find better way
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", fx(win, Yellow), " another color ",
12
- fx(win, White), "and yet another."
13
- win.puts "We can ", fx(win, :bold), "boldface ",
14
- "and ", fx(win, :reverse), "reverse ",
15
- "and ", fx(win, :under), "underline ",
16
- fx(win, :normal), "text at will.\n "
17
- win.puts "This is ", fx(win, :bold, Red), "bold red ",
18
- fx(win, :normal, fg), "and this is normal again.\n "
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
@@ -8,7 +8,7 @@ Dir.chdir(examples)
8
8
  rc = system("ruby check.rb")
9
9
  exit unless rc
10
10
 
11
- # FIXME
11
+ # FIXME later:
12
12
  # - use names instead of numbers?
13
13
  # - convert showme into a method?
14
14
 
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
- # debug " arg.value = #{arg.value.inspect}, fg = #{arg.fg.inspect}"
41
- self.cwin.attron(arg.value)
42
- # debug " set colors = #{[arg.fg, @bg]}"
43
- self.set_colors(arg.fg, @bg) if arg.fg
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
@@ -1,6 +1,6 @@
1
1
 
2
2
  module RubyText
3
- VERSION = "0.0.72"
3
+ VERSION = "0.0.73"
4
4
 
5
5
  Path = File.expand_path(File.join(File.dirname(__FILE__)))
6
6
  end
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.72
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-03 00:00:00.000000000 Z
11
+ date: 2018-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: curses