rubytext 0.1.22 → 0.1.26

Sign up to get free protection for your applications and to get access to all the features.
data/lib/widgets.rb CHANGED
@@ -1,3 +1,5 @@
1
+ require 'stringio'
2
+
1
3
  module RubyText
2
4
  def self.ticker(row: STDSCR.rows-1, col: 0, width: STDSCR.cols,
3
5
  fg: White, bg: Blue, text:, delay: 0.1)
@@ -35,14 +37,20 @@ module RubyText
35
37
  ret
36
38
  end
37
39
 
38
- def self.splash(msg)
40
+ def self.splash(msg = nil)
41
+ io = StringIO.new("")
42
+ if msg.nil?
43
+ yield io
44
+ msg = io.string
45
+ end
46
+
39
47
  lines = msg.split("\n")
40
48
  high = lines.size + 4
41
49
  wide = lines.map {|x| x.length }.max + 4
42
50
  r0 = (STDSCR.rows - high)/2
43
51
  c0 = (STDSCR.cols - wide)/2
44
52
  STDSCR.saveback(high, wide, r0, c0)
45
- win = RubyText.window(high, wide, r: r0, c: c0,
53
+ win = RubyText.window(high, wide, r: r0, c: c0, scroll: true,
46
54
  fg: White, bg: Red, title: "[Press any key]")
47
55
  win.print "\n "
48
56
  win.puts msg
data/lib/window.rb CHANGED
@@ -6,6 +6,7 @@ module RubyText
6
6
  c ||= (STDSCR.cols - wide)/2
7
7
  win = RubyText::Window.new(high, wide, r, c, border, fg, bg, scroll)
8
8
  win.add_title(title) if title
9
+ 0.upto(high) {|row| 0.upto(wide) {|col| win[row, col] = " " } }
9
10
  win
10
11
  end
11
12
  end
data/rubytext.gemspec CHANGED
@@ -15,7 +15,8 @@ Gem::Specification.new do |s|
15
15
  s.authors = ["Hal Fulton"]
16
16
  s.email = 'rubyhacker@gmail.com'
17
17
  s.executables << "rubytext"
18
- s.add_runtime_dependency 'curses', "~> 1.2", ">= 1.2.5"
18
+ s.add_runtime_dependency 'curses', "~> 1.3.2" # , ">= 1.3.2"
19
+ # NOTE: curses 1.4.3 does not cooperate for reasons as yet unknown
19
20
 
20
21
  # Files...
21
22
  main = Find.find("lib").to_a
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.1.22
4
+ version: 0.1.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hal Fulton
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-06 00:00:00.000000000 Z
11
+ date: 2022-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: curses
@@ -16,20 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.2'
20
- - - ">="
21
- - !ruby/object:Gem::Version
22
- version: 1.2.5
19
+ version: 1.3.2
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
24
  - - "~>"
28
25
  - !ruby/object:Gem::Version
29
- version: '1.2'
30
- - - ">="
31
- - !ruby/object:Gem::Version
32
- version: 1.2.5
26
+ version: 1.3.2
33
27
  description: Uses the curses gem and extends functionality and ease of use in Ruby.
34
28
  email: rubyhacker@gmail.com
35
29
  executables:
@@ -72,11 +66,38 @@ files:
72
66
  - examples/sym_navigate.rb
73
67
  - examples/ticker_threads.rb
74
68
  - examples/topbottom.rb
69
+ - examples/topmenu.rb
75
70
  - examples/udlr_bang.rb
76
71
  - examples/updown_etc.rb
77
72
  - examples/win_centering.rb
78
73
  - examples/window_full.rb
74
+ - lib/.yardoc/checksums
75
+ - lib/.yardoc/complete
76
+ - lib/.yardoc/object_types
77
+ - lib/.yardoc/objects/root.dat
78
+ - lib/.yardoc/proxy_types
79
79
  - lib/color.rb
80
+ - lib/doc/RubyText.html
81
+ - lib/doc/RubyText/Color.html
82
+ - lib/doc/RubyText/Effects.html
83
+ - lib/doc/RubyText/Keys.html
84
+ - lib/doc/RubyText/Settings.html
85
+ - lib/doc/RubyText/Window.html
86
+ - lib/doc/RubyText/Window/GetString.html
87
+ - lib/doc/WindowIO.html
88
+ - lib/doc/_index.html
89
+ - lib/doc/class_list.html
90
+ - lib/doc/css/common.css
91
+ - lib/doc/css/full_list.css
92
+ - lib/doc/css/style.css
93
+ - lib/doc/file_list.html
94
+ - lib/doc/frames.html
95
+ - lib/doc/index.html
96
+ - lib/doc/js/app.js
97
+ - lib/doc/js/full_list.js
98
+ - lib/doc/js/jquery.js
99
+ - lib/doc/method_list.html
100
+ - lib/doc/top-level-namespace.html
80
101
  - lib/effects.rb
81
102
  - lib/keys.rb
82
103
  - lib/menu.rb
@@ -119,7 +140,7 @@ homepage: https://github.com/Hal9000/rubytext
119
140
  licenses:
120
141
  - Ruby
121
142
  metadata: {}
122
- post_install_message:
143
+ post_install_message:
123
144
  rdoc_options: []
124
145
  require_paths:
125
146
  - lib
@@ -134,8 +155,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
134
155
  - !ruby/object:Gem::Version
135
156
  version: '0'
136
157
  requirements: []
137
- rubygems_version: 3.0.4
138
- signing_key:
158
+ rubygems_version: 3.1.2
159
+ signing_key:
139
160
  specification_version: 4
140
161
  summary: A thick wrapper for Curses
141
162
  test_files: []