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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ec86e090c75136ef7d6ae7c98ca05f943aded079
4
- data.tar.gz: 703958a133df34d7379e855bc0ca69011bf583e4
3
+ metadata.gz: 442ba70002fba70bca91ba81955e85c7a6205c50
4
+ data.tar.gz: 35cb1e2184a1381bbea5af20a12186df94c86c4e
5
5
  SHA512:
6
- metadata.gz: 298dcc7dc510ff9acee3356c796cec7283842c724763250a2c780467a3bb8ca83fe078d3225d081b855a5332f7d6a3894bdcd5e97c18401daa2b046035287238
7
- data.tar.gz: bd582b45420ad6510449ec11f0a7e9afa6ff8a52b675ee8b0467be47cdfa9cb81908bff3374656789dd4486a4945c2db93c9710b92b730f1af0624857078d58d
6
+ metadata.gz: dd7e866ea43f64da01f75085328350f011ee88c3062626a0b0116007c439c43c7e151203aa967752278491b90df95f533db4172d06147db5af82baa879abb8d2
7
+ data.tar.gz: e6f21ddca839a279544d842cf6beb6bde61de0b3584c41ba2ec24c127b2c780b0d55ad567ab0b944367e63de0b29e6858ae65f51f422e1ab968b1697160e9f23
@@ -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
@@ -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
@@ -1,5 +1,5 @@
1
1
  # encoding: UTF-8
2
2
  module Kafo
3
3
  PARSER_CACHE_VERSION = 1
4
- VERSION = "2.0.1"
4
+ VERSION = "2.0.2"
5
5
  end
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.1
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-04-21 00:00:00.000000000 Z
11
+ date: 2017-06-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler