themigrator 0.1.14 → 0.1.16

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: 6188fef0eab108a19c231eac874aaa8f0fa50fd1
4
- data.tar.gz: ae45a477ef136e1641f34a15d9f84304026e8e11
3
+ metadata.gz: bdc66f94992c2eae613898a237e2e7c3f695c35f
4
+ data.tar.gz: 8cc703cd8487ef7945513d21178e782e4fecf047
5
5
  SHA512:
6
- metadata.gz: 225f6f0eeb58ab239c4fadd552c29ce31297d54f23c83b7b94a3254a292fde2b31e25d9376e7059ff83974792efc55e6ded1bd59b36935d0dfc144d7d607d15b
7
- data.tar.gz: 76a90c14c5ef81e56b56afc963c7de373d5f2f4697a1de2e58c84ad767341f392d158056d7add2026ed7b501a91ba7004924aa50767b430d935136539ca17765
6
+ metadata.gz: 65a157a879c5d4b822ce0e01d27d54ca050eda2de7693a4e17cd33aca8adc38949fc34244df4a4e4571750099d763d6aadf4b6a22c73cc3aa91361a5b0c1576d
7
+ data.tar.gz: a291a9296de059354c564d632b7602c0de73f42bce54d40eb3e22558409ef9a9d0904f6e93cb137d240ecaaf9730a49dba4b464c07ba3ad8f0ff3db869f6f50d
data/lib/themigrator.rb CHANGED
@@ -1,3 +1,4 @@
1
+
1
2
  require 'themigrator/version'
2
3
  require 'themigrator/logger'
3
4
  require 'themigrator/migration'
@@ -1,5 +1,6 @@
1
1
  require 'curses'
2
2
 
3
+ require 'themigrator/ui/log'
3
4
  require 'themigrator/ui/log_area'
4
5
  require 'themigrator/ui/title_bar'
5
6
  require 'themigrator/ui/progress_window'
@@ -8,22 +9,7 @@ require 'thread'
8
9
 
9
10
  Thread.abort_on_exception = true
10
11
 
11
- UILOG = Logger.new('ui.log')
12
- UILOG.formatter = proc { |_severity, _datetime, _progname, msg|
13
- msg + "\n"
14
- }
15
- UILOGMUTEX = Mutex.new
16
- def ui_log(*args)
17
- UILOGMUTEX.synchronize do
18
- UILOG << args.join("\n\r") + "\n"
19
- end
20
- end
21
12
 
22
- def ui_log_exception(e)
23
- ui_log ''
24
- ui_log e.inspect
25
- ui_log e.backtrace
26
- end
27
13
 
28
14
  module Themigrator
29
15
  class UI
@@ -1,4 +1,5 @@
1
1
 
2
+ require 'themigrator/ui/log'
2
3
  # From: http://www.alecjacobson.com/weblog/?p=75
3
4
  module Themigrator
4
5
  class UI
@@ -30,7 +31,7 @@ module Themigrator
30
31
  extra_thread.kill
31
32
  end
32
33
  rescue => e
33
- log_exception(e)
34
+ ui_log_exception(e)
34
35
  ensure
35
36
  end
36
37
  KEY2SYM[c]
@@ -0,0 +1,19 @@
1
+
2
+ require 'logger'
3
+ UILOG = Logger.new('ui.log')
4
+ UILOG.formatter = proc { |_severity, _datetime, _progname, msg|
5
+ msg + "\n"
6
+ }
7
+ UILOGMUTEX = Mutex.new
8
+
9
+ def ui_log(*args)
10
+ UILOGMUTEX.synchronize do
11
+ UILOG << args.join("\n\r") + "\n"
12
+ end
13
+ end
14
+
15
+ def ui_log_exception(e)
16
+ ui_log ''
17
+ ui_log e.inspect
18
+ ui_log e.backtrace
19
+ end
@@ -1,3 +1,3 @@
1
1
  module Themigrator
2
- VERSION = '0.1.14'.freeze
2
+ VERSION = '0.1.16'.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.14
4
+ version: 0.1.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guillermo Álvarez
@@ -139,6 +139,7 @@ files:
139
139
  - lib/themigrator/script_pool.rb
140
140
  - lib/themigrator/ui.rb
141
141
  - lib/themigrator/ui/getchar.rb
142
+ - lib/themigrator/ui/log.rb
142
143
  - lib/themigrator/ui/log_area.rb
143
144
  - lib/themigrator/ui/progress_window.rb
144
145
  - lib/themigrator/ui/title_bar.rb