mixlib-shellout 3.2.0-universal-mingw32 → 3.2.6-universal-mingw32

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
  SHA256:
3
- metadata.gz: 00f4730aaa3fe480f46217bfe963ebe9ca037f42a416ed437ae652ad01546991
4
- data.tar.gz: 639bd615824b4f8b5c06e00f092f352f8e8bff6b6f6d58cb38926bccd82dc3bb
3
+ metadata.gz: a6101e032c995a3e14b91912c329ab3af5338e08c0758c48693b876b467f9b87
4
+ data.tar.gz: be4c1ce327bf812475b7d8a66ab804838fa3fa5c4758852a9a8a7a0b39bb0ec2
5
5
  SHA512:
6
- metadata.gz: 43abff4b66af104549f91ae03bd29bbd571b05a5795139fe38896773e9a966fb70bc4214b920ae3ccb7984164e55099205fa50ee105c96c570cb041be84ea396
7
- data.tar.gz: 729981e52f21ddb356a4d530eaabc958502ca2d81c844285050eb7a1808d4f841784b25db072bfb36904daecef9d4bfc40056bb295b8634c4cd9b58fc83b7aaf
6
+ metadata.gz: 854b4511ed779ba3e76e0c8a064664b87001a27953d9c538817c8a8e7bda705e1fb55fe9c3e65f7db760ce7640e2a6292908d78d270981f0d5b61a75c06cd087
7
+ data.tar.gz: 15332de826c4332a37ac229544718bb7333feb8e91a723aae0f0fa8b555e329f1e9540029254ac84b71efdbbd54b8d29163f4bef9ad545882070f6c5ca0ef60f
@@ -157,7 +157,7 @@ module Mixlib
157
157
  end
158
158
 
159
159
  def __io_for_live_stream
160
- if STDOUT.tty? && !__config[:daemon] && __log.debug?
160
+ if !STDOUT.closed? && __log.trace?
161
161
  STDOUT
162
162
  else
163
163
  nil
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: Daniel DeLeo (<dan@chef.io>)
3
- # Copyright:: Copyright (c) 2010-2016 Chef Software, Inc.
3
+ # Copyright:: Copyright (c) Chef Software Inc.
4
4
  # License:: Apache License, Version 2.0
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -370,11 +370,11 @@ module Mixlib
370
370
  return if attempt_reap
371
371
 
372
372
  @terminate_reason = "Command exceeded allowed execution time, process terminated"
373
- logger.error("Command exceeded allowed execution time, sending TERM") if logger
373
+ logger&.error("Command exceeded allowed execution time, sending TERM")
374
374
  Process.kill(:TERM, child_pgid)
375
375
  sleep 3
376
376
  attempt_reap
377
- logger.error("Command exceeded allowed execution time, sending KILL") if logger
377
+ logger&.error("Command exceeded allowed execution time, sending KILL")
378
378
  Process.kill(:KILL, child_pgid)
379
379
  reap
380
380
 
@@ -1,5 +1,5 @@
1
1
  module Mixlib
2
2
  class ShellOut
3
- VERSION = "3.2.0".freeze
3
+ VERSION = "3.2.6".freeze
4
4
  end
5
5
  end
@@ -1,7 +1,7 @@
1
- #--
1
+ #
2
2
  # Author:: Daniel DeLeo (<dan@chef.io>)
3
3
  # Author:: John Keiser (<jkeiser@chef.io>)
4
- # Copyright:: Copyright (c) 2011-2016 Chef Software, Inc.
4
+ # Copyright:: Copyright (c) Chef Software Inc.
5
5
  # License:: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -22,7 +22,6 @@ require "ffi/win32/extensions"
22
22
 
23
23
  # Add new constants for Logon
24
24
  module Process::Constants
25
- private
26
25
 
27
26
  LOGON32_LOGON_INTERACTIVE = 0x00000002
28
27
  LOGON32_LOGON_BATCH = 0x00000004
@@ -157,15 +156,13 @@ module Process
157
156
  si_hash = {}
158
157
 
159
158
  # If the startup_info key is present, validate its subkeys
160
- if hash["startup_info"]
161
- hash["startup_info"].each do |key, val|
162
- key = key.to_s.downcase
163
- unless valid_si_keys.include?(key)
164
- raise ArgumentError, "invalid startup_info key '#{key}'"
165
- end
166
-
167
- si_hash[key] = val
159
+ hash["startup_info"]&.each do |key, val|
160
+ key = key.to_s.downcase
161
+ unless valid_si_keys.include?(key)
162
+ raise ArgumentError, "invalid startup_info key '#{key}'"
168
163
  end
164
+
165
+ si_hash[key] = val
169
166
  end
170
167
 
171
168
  # The +command_line+ key is mandatory unless the +app_name+ key
@@ -2,7 +2,7 @@
2
2
  # Author:: Daniel DeLeo (<dan@chef.io>)
3
3
  # Author:: John Keiser (<jkeiser@chef.io>)
4
4
  # Author:: Ho-Sheng Hsiao (<hosh@chef.io>)
5
- # Copyright:: Copyright (c) 2011-2019, Chef Software Inc.
5
+ # Copyright:: Copyright (c) Chef Software Inc.
6
6
  # License:: Apache License, Version 2.0
7
7
  #
8
8
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -89,7 +89,7 @@ module Mixlib
89
89
  # Start the process
90
90
  #
91
91
  process, profile, token = Process.create3(create_process_args)
92
- logger.debug(format_process(process, app_name, command_line, timeout)) if logger
92
+ logger&.debug(format_process(process, app_name, command_line, timeout))
93
93
  begin
94
94
  # Start pushing data into input
95
95
  stdin_write << input if input
@@ -124,7 +124,7 @@ module Mixlib
124
124
  kill_process_tree(process.process_id, wmi, logger)
125
125
  Process.kill(:KILL, process.process_id)
126
126
  rescue SystemCallError
127
- logger.warn("Failed to kill timed out process #{process.process_id}") if logger
127
+ logger&.warn("Failed to kill timed out process #{process.process_id}")
128
128
  end
129
129
 
130
130
  raise Mixlib::ShellOut::CommandTimeout, [
@@ -398,20 +398,16 @@ module Mixlib
398
398
 
399
399
  def kill_process(instance, logger)
400
400
  child_pid = instance.wmi_ole_object.processid
401
- if logger
402
- logger.debug([
401
+ logger&.debug([
403
402
  "killing child process #{child_pid}::",
404
403
  "#{instance.wmi_ole_object.Name} of parent #{pid}",
405
404
  ].join)
406
- end
407
405
  Process.kill(:KILL, instance.wmi_ole_object.processid)
408
406
  rescue SystemCallError
409
- if logger
410
- logger.debug([
407
+ logger&.debug([
411
408
  "Failed to kill child process #{child_pid}::",
412
409
  "#{instance.wmi_ole_object.Name} of parent #{pid}",
413
410
  ].join)
414
- end
415
411
  end
416
412
 
417
413
  def format_process(process, app_name, command_line, timeout)
@@ -1,6 +1,6 @@
1
1
  #--
2
2
  # Author:: Daniel DeLeo (<dan@chef.io>)
3
- # Copyright:: Copyright (c) 2010-2016 Chef Software, Inc.
3
+ # Copyright:: Copyright (c) Chef Software Inc.
4
4
  # License:: Apache License, Version 2.0
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -28,7 +28,7 @@ module Mixlib
28
28
  READ_SIZE = 4096
29
29
  DEFAULT_READ_TIMEOUT = 600
30
30
 
31
- if RUBY_PLATFORM =~ /mswin|mingw32|windows/
31
+ if RUBY_PLATFORM =~ /mswin|mingw|windows/
32
32
  require_relative "shellout/windows"
33
33
  include ShellOut::Windows
34
34
  else
@@ -248,7 +248,7 @@ module Mixlib
248
248
  # running or died without setting an exit status (e.g., terminated by
249
249
  # `kill -9`).
250
250
  def exitstatus
251
- @status && @status.exitstatus
251
+ @status&.exitstatus
252
252
  end
253
253
 
254
254
  # Run the command, writing the command's standard out and standard error
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mixlib-shellout
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.0
4
+ version: 3.2.6
5
5
  platform: universal-mingw32
6
6
  authors:
7
7
  - Chef Software Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-12 00:00:00.000000000 Z
11
+ date: 2022-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chef-utils
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.8.2
33
+ version: '0.9'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.8.2
40
+ version: '0.9'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: wmi-lite
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -81,7 +81,8 @@ files:
81
81
  - lib/mixlib/shellout/windows.rb
82
82
  - lib/mixlib/shellout/windows/core_ext.rb
83
83
  homepage: https://github.com/chef/mixlib-shellout
84
- licenses: []
84
+ licenses:
85
+ - Apache-2.0
85
86
  metadata: {}
86
87
  post_install_message:
87
88
  rdoc_options: []
@@ -98,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
98
99
  - !ruby/object:Gem::Version
99
100
  version: '0'
100
101
  requirements: []
101
- rubygems_version: 3.0.3
102
+ rubygems_version: 3.1.4
102
103
  signing_key:
103
104
  specification_version: 4
104
105
  summary: Run external commands on Unix or Windows