themigrator 0.1.16 → 0.1.17

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bdc66f94992c2eae613898a237e2e7c3f695c35f
4
- data.tar.gz: 8cc703cd8487ef7945513d21178e782e4fecf047
3
+ metadata.gz: 986992dd32eefaeded344d5ae323a53dff537b4d
4
+ data.tar.gz: ac6e6168850a5cb8918908126cfe47c4217dee2e
5
5
  SHA512:
6
- metadata.gz: 65a157a879c5d4b822ce0e01d27d54ca050eda2de7693a4e17cd33aca8adc38949fc34244df4a4e4571750099d763d6aadf4b6a22c73cc3aa91361a5b0c1576d
7
- data.tar.gz: a291a9296de059354c564d632b7602c0de73f42bce54d40eb3e22558409ef9a9d0904f6e93cb137d240ecaaf9730a49dba4b464c07ba3ad8f0ff3db869f6f50d
6
+ metadata.gz: 845509ce6a558b8525d12589ef26e1d5d520d52a3a51b658b744277d3735cb623358053389e3019c25fdd7874460c9588f41a6de473cb3283a50233710654e6d
7
+ data.tar.gz: 6ea768b08ec3dd42e7fa4f1831eb220566ad91f5f13664a8d1965e106e7d4f07e8a711e2fb55e01b5b68645ca6c595f2cc9bfb42d4bb06df03946febca8519e2
@@ -22,7 +22,7 @@ module Themigrator
22
22
 
23
23
  init_logger(main_log_path(@dir, run_id)) unless @options[:log_stdout]
24
24
 
25
- log "start PID=#{$PROCESS_ID}"
25
+ log "start PID=#{$$}"
26
26
  log "roles: #{@migration.roles.join(' ')}"
27
27
  did_it_work = true
28
28
  each_action do |action|
@@ -24,6 +24,8 @@ module Themigrator
24
24
  @pm = progress_monitor
25
25
  @roles = []
26
26
  @current_action = ''
27
+
28
+ trap "WINCH", ->(_) { resize }
27
29
  end
28
30
 
29
31
  def start
@@ -36,6 +38,19 @@ module Themigrator
36
38
 
37
39
  private
38
40
 
41
+ def get_size
42
+ @cols = cols
43
+ @lines = lines
44
+ end
45
+
46
+ def resize
47
+ get_size
48
+ end
49
+
50
+ def redraw
51
+
52
+ end
53
+
39
54
  def render_loop
40
55
  loop do
41
56
  sleep ENV['SLEEP'] ? ENV['SLEEP'].to_f : 0.2
@@ -54,12 +69,10 @@ module Themigrator
54
69
  next_action
55
70
  when :c_c, 'q'
56
71
  exit 0
57
- when :npage
72
+ when :npage,:down
58
73
  la_npage
59
- say 'next_page'
60
- when :ppage
74
+ when :ppage,:up
61
75
  la_ppage
62
- say 'previous_page'
63
76
  else
64
77
  keys.unshift(e)
65
78
  say keys.map(&:inspect).join(' ')
@@ -143,7 +156,6 @@ module Themigrator
143
156
  end
144
157
 
145
158
  def init_screen
146
- super
147
159
  # crmode
148
160
  # cbreak
149
161
  raw
@@ -151,13 +163,12 @@ module Themigrator
151
163
  noecho
152
164
  curs_set(0)
153
165
  ObjectSpace.define_finalizer(self, proc do
154
- # close_screen
166
+ close_screen
155
167
  end)
168
+ get_size
156
169
  end
157
170
 
158
171
  def render
159
- @cols = cols
160
- @lines = lines
161
172
  la_render if la_initialize?
162
173
  render_title
163
174
  render_progress
@@ -12,8 +12,8 @@ module Themigrator
12
12
  KEY2SYM["\e[6~"] = :npage
13
13
  KEY2SYM["\e[5~"] = :ppage
14
14
  KEY2SYM["\u0003"] = :c_c
15
- KEY2SYM["\e[B"] = :scroll_down
16
- KEY2SYM["\e[A"] = :scroll_up
15
+ KEY2SYM["\e[B"] = :down
16
+ KEY2SYM["\e[A"] = :up
17
17
 
18
18
  def getchar
19
19
  begin
@@ -39,3 +39,4 @@ module Themigrator
39
39
  end
40
40
  end
41
41
  end
42
+
@@ -127,11 +127,11 @@ module Themigrator
127
127
  end
128
128
 
129
129
  def la_npage
130
- la_each_window(&:nextpage)
130
+ la_each_window { |w,_role| w.nextpage }
131
131
  end
132
132
 
133
133
  def la_ppage
134
- la_each_window(&:prevpage)
134
+ la_each_window { |w,_role| w.prevpage }
135
135
  end
136
136
 
137
137
  def la_switch_action(action)
@@ -4,7 +4,6 @@ module Themigrator
4
4
  module ProgressWindow
5
5
  include Curses
6
6
  def render_progress
7
- progress_window.clear
8
7
  progress_window.setpos(0, 0)
9
8
  progress_window.addstr(build_status_line)
10
9
  progress_window.setpos(1, 0)
@@ -11,6 +11,14 @@ module Themigrator
11
11
  time_window.setpos(0, 0)
12
12
  time_window.addstr(now_str)
13
13
  time_window.refresh
14
+ title_window.attrset(A_BOLD)
15
+ title_window.setpos(0,0)
16
+ title_window.addstr("The migrator")
17
+ title_window.attrset(A_NORMAL)
18
+ dir = Dir.pwd
19
+ project = File.basename dir
20
+ title_window.addstr(" #{project}")
21
+ title_window.refresh
14
22
  end
15
23
 
16
24
  def title_window
@@ -1,3 +1,3 @@
1
1
  module Themigrator
2
- VERSION = '0.1.16'.freeze
2
+ VERSION = '0.1.17'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: themigrator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.16
4
+ version: 0.1.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guillermo Álvarez