test-kitchen 2.7.1 → 2.7.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
  SHA256:
3
- metadata.gz: 6ae69102eac88b3cbb40ad7e39b02fd2a1519e8f9ed9d114fa1c0d4c0ea7319d
4
- data.tar.gz: 48bf850ca5c79fcb0b7af6cc7fce89b05d1c735ad51c80e224285c50581576bd
3
+ metadata.gz: 70a2b4e8550bd740b74b498d123705e34431ccc5d5a7e1fe2d103600f6ced214
4
+ data.tar.gz: 596588c5ab19dd10e06ff8e1ec9781bb79e87d97f9ec55750753302de7ef524d
5
5
  SHA512:
6
- metadata.gz: 9164957f96d9e93b04a4a9e32ac475d9b0e239f1e900d02660fa286d4625e312f7d1b47ab5cfa7136b91e514e826f6c915fb9dcc8a56677915714ce9106b6366
7
- data.tar.gz: 3a0968bbe24c08505b12c8bfe3900c450c5f00bc35c3821db18b3535a891256ac9093f2f472a02bcbc7179d0b24f0c87f3a8237e185e87d39b0d741c98629738
6
+ metadata.gz: c41498d1f5900b67cbee755e7b1e2eb127162bd010dc8c391bb74a34945dc915b7b160361b5344f8d96a53fb254c6415bd01327aa821d3ac1407308eccf1c636
7
+ data.tar.gz: 949dffda64b62446c5de2ed0635c7f17110d4237da2c2ea0419f16bbc58d601ff642fb260e3d641659a82a1476d509e207e4f4b5fe411cd383831090b37ea155
@@ -16,8 +16,6 @@
16
16
  # limitations under the License.
17
17
 
18
18
  require "pathname" unless defined?(Pathname)
19
- require "thread"
20
-
21
19
  require_relative "kitchen/errors"
22
20
  require_relative "kitchen/logger"
23
21
  require_relative "kitchen/logging"
@@ -67,7 +65,7 @@ module Kitchen
67
65
  #
68
66
  # @return [Pathname] root path of gem
69
67
  def source_root
70
- @source_root ||= Pathname.new(File.expand_path("../../", __FILE__))
68
+ @source_root ||= Pathname.new(File.expand_path("..", __dir__))
71
69
  end
72
70
 
73
71
  # Returns a default logger which emits on standard output.
@@ -15,8 +15,6 @@
15
15
  # See the License for the specific language governing permissions and
16
16
  # limitations under the License.
17
17
 
18
- require "thread"
19
-
20
18
  module Kitchen
21
19
  module Command
22
20
  # Base class for CLI commands.
@@ -18,7 +18,7 @@
18
18
  require_relative "../command"
19
19
  require_relative "../diagnostic"
20
20
 
21
- require "yaml" unless defined?(YAML)
21
+ autoload :YAML, "yaml"
22
22
 
23
23
  module Kitchen
24
24
  module Command
@@ -32,9 +32,9 @@ module Kitchen
32
32
 
33
33
  loader = record_failure { load_loader }
34
34
 
35
- puts Kitchen::Diagnostic.new(
35
+ puts YAML.dump(Kitchen::Diagnostic.new(
36
36
  loader: loader, instances: instances, plugins: plugins?
37
- ).read.to_yaml
37
+ ).read)
38
38
  end
39
39
 
40
40
  private
@@ -213,7 +213,7 @@ module Kitchen
213
213
  provisioner: Provisioner::DEFAULT_PLUGIN,
214
214
  verifier: Verifier::DEFAULT_PLUGIN,
215
215
  transport: lambda do |_suite, platform|
216
- platform =~ /^win/i ? "winrm" : Transport::DEFAULT_PLUGIN
216
+ /^win/i.match?(platform) ? "winrm" : Transport::DEFAULT_PLUGIN
217
217
  end,
218
218
  },
219
219
  kitchen_root: kitchen_root,
@@ -110,13 +110,13 @@ module Kitchen
110
110
  # @return [String]
111
111
  # @api private
112
112
  def escape_path(path)
113
- if RbConfig::CONFIG["host_os"] =~ /mswin|mingw/
113
+ if /mswin|mingw/.match?(RbConfig::CONFIG["host_os"])
114
114
  # I know what you're thinking: "just use Shellwords.escape". That
115
115
  # method produces incorrect results on Windows with certain input
116
116
  # which would be a metacharacter in Sh but is not for one or more of
117
117
  # Windows command line parsing libraries. This covers the 99% case of
118
118
  # spaces in the path without breaking other stuff.
119
- if path =~ /[ \t\n\v"]/
119
+ if /[ \t\n\v"]/.match?(path)
120
120
  "\"#{path.gsub(/[ \t\n\v\"\\]/) { |m| '\\' + m[0] }}\""
121
121
  else
122
122
  path
@@ -136,7 +136,7 @@ module Kitchen
136
136
  # @api private
137
137
  def detect_chef_command!(logger)
138
138
  unless ENV["PATH"].split(File::PATH_SEPARATOR).any? do |path|
139
- if RbConfig::CONFIG["host_os"] =~ /mswin|mingw/
139
+ if /mswin|mingw/.match?(RbConfig::CONFIG["host_os"])
140
140
  # Windows could have different extentions: BAT, EXE or NONE
141
141
  %w{chef chef.exe chef.bat}.each do |bin|
142
142
  File.exist?(File.join(path, bin))
@@ -156,7 +156,7 @@ module Kitchen
156
156
  product_name: <chef or chef-workstation>
157
157
  install_strategy: skip
158
158
  MSG
159
- when provisioner[:require_chef_omnibus].to_s.match(/\d/)
159
+ when provisioner[:require_chef_omnibus].to_s.match?(/\d/)
160
160
  Util.outdent!(<<-MSG)
161
161
  The 'require_chef_omnibus' attribute with version values will change
162
162
  to use the new 'product_version' attribute.
@@ -110,7 +110,7 @@ module Kitchen
110
110
  def self.wrap_command(cmd)
111
111
  cmd = "false" if cmd.nil?
112
112
  cmd = "true" if cmd.to_s.empty?
113
- cmd = cmd.sub(/\n\Z/, "") if cmd =~ /\n\Z/
113
+ cmd = cmd.sub(/\n\Z/, "") if /\n\Z/.match?(cmd)
114
114
 
115
115
  "sh -c '\n#{cmd}\n'"
116
116
  end
@@ -168,7 +168,7 @@ module Kitchen
168
168
  # @api private
169
169
  def gem_install_args
170
170
  gem, version = config[:version].split("@")
171
- if gem =~ /^\d+\.\d+\.\d+/
171
+ if /^\d+\.\d+\.\d+/.match?(gem)
172
172
  version = gem
173
173
  gem = "busser"
174
174
  end
@@ -16,5 +16,5 @@
16
16
  # limitations under the License.
17
17
 
18
18
  module Kitchen
19
- VERSION = "2.7.1".freeze
19
+ VERSION = "2.7.2".freeze
20
20
  end
@@ -1,4 +1,4 @@
1
- lib = File.expand_path("../lib", __FILE__)
1
+ lib = File.expand_path("lib", __dir__)
2
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
  require "kitchen/version"
4
4
  require "English"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: test-kitchen
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.1
4
+ version: 2.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fletcher Nichol
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-15 00:00:00.000000000 Z
11
+ date: 2020-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mixlib-shellout