dialog_tui 0.1.2 → 0.1.3

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
  SHA1:
3
- metadata.gz: 0910fad969d36fb4dae62b0cc4eda1381c478f94
4
- data.tar.gz: 0c94e240249f1ddccb6b4c294c7e09450594436b
3
+ metadata.gz: 334de068b0809e031d9dd605cedf2e9f42dcad9d
4
+ data.tar.gz: 0c532a0b59ae9f16d1824766c8051ddb667216ea
5
5
  SHA512:
6
- metadata.gz: 3a9eabc75a05bf3863ee1b83f4ac58e0e88cfdb4a5d3b8e93c77cab4eb4cc15b890c3a897b18df371a360695c66fcd3b451b97ea97200ebe60173301099c8d18
7
- data.tar.gz: 32295a1394687422ba983c7ad664eeee7f0c8de1c8ade7320cf12035a115d7050fab2077e42de1a6b145d93139b2dd42888b851b0de614436b65f5b93c74ab31
6
+ metadata.gz: 14c3ea581f35feb4b64221ee80312be48576f9f6486796351581597ff1d43ea6e5db86cfd6e3c188a608b9de81fc14af779e787085cf95336427cb7f2ddd7349
7
+ data.tar.gz: bdb6b2f3b5766e0d8980a9ef2606a874d7d4ff0d29632865d6a04c7aadf644f75391a0208775a4389b9af406813db38b31af796deb3cd29d74c51998105c9c64
@@ -55,6 +55,7 @@ module DialogTui
55
55
  def run
56
56
  begin
57
57
  # print_usage #...
58
+ before_draw! # like controller method here...
58
59
  print_options # would be nice to have a printer...
59
60
 
60
61
  done = false
@@ -99,6 +100,15 @@ module DialogTui
99
100
  @ctrl_c << block
100
101
  end
101
102
 
103
+ def before_draw &block
104
+ @before_draw ||= []
105
+ @before_draw << block
106
+ end
107
+ def before_draw!
108
+ @before_draw.each &:call if @before_draw
109
+ end
110
+ # third => to DRY I guess
111
+
102
112
  private
103
113
  def print_options
104
114
  puts '-'*10
@@ -177,6 +187,15 @@ if __FILE__ == $0
177
187
  exit 0
178
188
  end
179
189
 
190
+ before_draw do
191
+ system 'clear'
192
+ puts
193
+ puts ?_*10
194
+ puts 'manual testing here - use arrows and enter'
195
+ puts 'no way to fail it - just look at behavior'
196
+ puts 'ctrl+c when finished'
197
+ end
198
+
180
199
  }.
181
200
  tap { |result|
182
201
  raise unless result.nil?
@@ -186,10 +205,8 @@ if __FILE__ == $0
186
205
  end
187
206
  end
188
207
 
189
- puts
190
- puts ?_*10
191
- puts 'manual testing here - use arrows and enter'
192
- puts 'no way to fail it - just look at behavior'
193
- puts 'ctrl+c when finished'
194
- My.new.act
208
+ loop {
209
+ My.new.act
210
+ gets
211
+ }
195
212
  end
@@ -1,3 +1,3 @@
1
1
  module DialogTui
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dialog_tui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander K