train-core 3.16.3 → 3.16.5

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
  SHA256:
3
- metadata.gz: 5c7ff43a79457e6d900c1e1e293c1e2ad48c6c555863cb816d64ddd96e02f03f
4
- data.tar.gz: b42bdd2900ac7cc3c43f0df0467def0d46906a51ebfa64de3344b35e7504ae7a
3
+ metadata.gz: 26ee1ca7669521f387e6d8197f6938e472c62ac3b2a90455d92601428dbc4567
4
+ data.tar.gz: edee65e63113ad20679fd27ae9bdfb51a4c44f3e6aa956e334d8b4f666976221
5
5
  SHA512:
6
- metadata.gz: 27b1d7e67fed6319322a3928ed0ef0b24a5846bfa32a2998627ece0c943fa712205086fafb0a063214fe6c7659dd7979e8182e2984a41e9d0983590b7d5a9556
7
- data.tar.gz: 13a9e5d5da5bdda8468f95c2bbb1b259c4052c4c6af4e0191038027f3f7ad226b269093e487f593a47418defda016151e33bad08cf0f01b19ae25a5520d5ac5a
6
+ metadata.gz: c3346b3ac6600eaaf7dd35e1eea70e3b3d0a05e8f48fcf68e66d5b56a268ae4db3f71c5a9fb9c5207d500eea7701a070a04d22bf3be3af4db7d8c84e6384acec
7
+ data.tar.gz: fda8990679bb40cd29cd2e2b81bf9b4531e3f79c76b11a5b5114ba25f917862a247e41f3d821a1b9b316e89ce41d15ab71cc09283938a807f18bb18cf336a92b
@@ -244,27 +244,33 @@ module Train::Platforms::Detect::Helpers
244
244
 
245
245
  # Fallback method for reading OS info using cmd-only commands when wmic is not available
246
246
  def read_cmd_os
247
- # Try to get architecture from PROCESSOR_ARCHITECTURE environment variable
247
+ # Try to get architecture from PROCESSOR_ARCHITECTURE environment variable.
248
248
  # This covers the same architectures as wmic CPU detection but uses environment variables
249
- # which are available on all Windows versions since NT
249
+ # which are available on all Windows versions since NT.
250
250
  arch_res = @backend.run_command("echo %PROCESSOR_ARCHITECTURE%")
251
- if arch_res.exit_status == 0
252
- arch_string = arch_res.stdout.strip.downcase
253
- # Only set architecture if we got actual output
254
- unless arch_string.empty?
255
- @platform[:arch] = case arch_string
256
- when "x86"
257
- "i386"
258
- when "amd64", "x64"
259
- "x86_64"
260
- when "ppc", "powerpc"
261
- "powerpc"
262
- else
263
- # For any unknown architecture, preserve the original value
264
- # This handles: arm64, ia64, arm, mips, alpha, and future architectures
265
- arch_string
266
- end
267
- end
251
+ arch_string = arch_res.exit_status == 0 ? arch_res.stdout.strip.downcase : ""
252
+
253
+ # In PowerShell sessions (e.g., WinRM in Test Kitchen), CMD-style variable
254
+ # expansion is not supported — %PROCESSOR_ARCHITECTURE% is returned literally
255
+ # rather than being expanded. Fall back to PowerShell syntax in that case.
256
+ if arch_string.empty? || arch_string == "%processor_architecture%"
257
+ ps_res = @backend.run_command("$env:PROCESSOR_ARCHITECTURE")
258
+ arch_string = ps_res.exit_status == 0 ? ps_res.stdout.strip.downcase : ""
259
+ end
260
+
261
+ unless arch_string.empty?
262
+ @platform[:arch] = case arch_string
263
+ when "x86"
264
+ "i386"
265
+ when "amd64", "x64"
266
+ "x86_64"
267
+ when "ppc", "powerpc"
268
+ "powerpc"
269
+ else
270
+ # For any unknown architecture, preserve the original value
271
+ # This handles: arm64, ia64, arm, mips, alpha, and future architectures
272
+ arch_string
273
+ end
268
274
  end
269
275
  # If PROCESSOR_ARCHITECTURE fails, architecture remains unset (consistent with other methods)
270
276
 
data/lib/train/version.rb CHANGED
@@ -2,5 +2,5 @@
2
2
  # Author:: Dominik Richter (<dominik.richter@gmail.com>)
3
3
 
4
4
  module Train
5
- VERSION = "3.16.3".freeze
5
+ VERSION = "3.16.5".freeze
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: train-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.16.3
4
+ version: 3.16.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chef InSpec Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-04-27 00:00:00.000000000 Z
11
+ date: 2026-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable