kafo 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/kafo/configuration.rb +1 -1
- data/lib/kafo/kafo_configure.rb +11 -0
- data/lib/kafo/puppet_log_parser.rb +0 -11
- data/lib/kafo/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 442ba70002fba70bca91ba81955e85c7a6205c50
|
4
|
+
data.tar.gz: 35cb1e2184a1381bbea5af20a12186df94c86c4e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd7e866ea43f64da01f75085328350f011ee88c3062626a0b0116007c439c43c7e151203aa967752278491b90df95f533db4172d06147db5af82baa879abb8d2
|
7
|
+
data.tar.gz: e6f21ddca839a279544d842cf6beb6bde61de0b3584c41ba2ec24c127b2c780b0d55ad567ab0b944367e63de0b29e6858ae65f51f422e1ab968b1697160e9f23
|
data/lib/kafo/configuration.rb
CHANGED
@@ -111,7 +111,7 @@ module Kafo
|
|
111
111
|
end
|
112
112
|
|
113
113
|
def module_dirs
|
114
|
-
[app[:module_dirs] || (app[:installer_dir] + '/modules')].flatten.map { |dir| File.expand_path(dir) }
|
114
|
+
[app[:module_dirs] || (app[:installer_dir] + '/modules')].flatten.map { |dir| File.expand_path(dir) }.uniq
|
115
115
|
end
|
116
116
|
|
117
117
|
def gem_root
|
data/lib/kafo/kafo_configure.rb
CHANGED
@@ -451,6 +451,7 @@ module Kafo
|
|
451
451
|
PTY.spawn(command) do |stdin, stdout, pid|
|
452
452
|
begin
|
453
453
|
stdin.each do |line|
|
454
|
+
line = normalize_encoding(line)
|
454
455
|
progress_log(*log_parser.parse(line))
|
455
456
|
@progress_bar.update(line) if @progress_bar
|
456
457
|
end
|
@@ -513,5 +514,15 @@ module Kafo
|
|
513
514
|
:background => config.app[:color_of_background],
|
514
515
|
:colors => use_colors?).setup
|
515
516
|
end
|
517
|
+
|
518
|
+
private
|
519
|
+
|
520
|
+
def normalize_encoding(line)
|
521
|
+
if line.respond_to?(:encode) && line.respond_to?(:valid_encoding?)
|
522
|
+
line.valid_encoding? ? line : line.encode('UTF-16be', :invalid => :replace, :replace => '?').encode('UTF-8')
|
523
|
+
else # Ruby 1.8.7, doesn't worry about invalid encodings
|
524
|
+
line
|
525
|
+
end
|
526
|
+
end
|
516
527
|
end
|
517
528
|
end
|
@@ -5,7 +5,6 @@ module Kafo
|
|
5
5
|
end
|
6
6
|
|
7
7
|
def parse(line)
|
8
|
-
line = normalize_encoding(line)
|
9
8
|
method, message = case
|
10
9
|
when line =~ /^Error:(.*)/i || line =~ /^Err:(.*)/i
|
11
10
|
[:error, $1]
|
@@ -22,15 +21,5 @@ module Kafo
|
|
22
21
|
@last_level = method
|
23
22
|
return [method, message.chomp]
|
24
23
|
end
|
25
|
-
|
26
|
-
private
|
27
|
-
|
28
|
-
def normalize_encoding(line)
|
29
|
-
if line.respond_to?(:encode) && line.respond_to?(:valid_encoding?)
|
30
|
-
line.valid_encoding? ? line : line.encode('UTF-16be', :invalid => :replace, :replace => '?').encode('UTF-8')
|
31
|
-
else # Ruby 1.8.7, doesn't worry about invalid encodings
|
32
|
-
line
|
33
|
-
end
|
34
|
-
end
|
35
24
|
end
|
36
25
|
end
|
data/lib/kafo/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kafo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marek Hulan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-06-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|