beaker 7.0.1 → 7.1.0

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: 7aac904257f5f7c3605a6139a432f9768a1bf33a476f8069d66566853b31cee4
4
- data.tar.gz: f853066d6563fa82c6e4fc8c66167ac200c6aad5ca49d15b1269771f4d1fd036
3
+ metadata.gz: 4ea7f3f43b306931d7cb6d414af927a1396091dbb90c4c8f8885bada0de6230f
4
+ data.tar.gz: bfd05c6c0d6004ccf971192865fa06c17ead095f5ce6be56504581128bc50728
5
5
  SHA512:
6
- metadata.gz: 63c3f7bc55be648f3dd630065c2db6669a6740c9cdfc5da7bae529587403fc0b7d64edbdc9665c364616cfc47a9eb2a9fc8502693fa8b132e06dd66fb1f7f216
7
- data.tar.gz: 6818daa647d74f067e1ed8c21ef98ae92bd42f69539e864f708e2a51d40e3d1f9d68c82a76517662758d04db18fd37a67287c3d339192d8244f50a2bfe2bcbae
6
+ metadata.gz: 2f7059b1e52018945c234b0f2569637137407bf1d060b72f180feff3ea0ce00a96b4370b02ce81fb9f5119c6d923d4260dd1ed2773f404d10d0ea80cd917b05a
7
+ data.tar.gz: cf11aa915baf2ead800ebaa9994da0a632e3e727dc9abcf525293ff03501f5139f7c337e775815c6433b8091c078d69f397292f45f70dc8f8120567aa17a6040
data/CHANGELOG.md CHANGED
@@ -1,6 +1,18 @@
1
1
  # Changelog
2
2
 
3
- ## [7.0.1](https://github.com/voxpupuli/beaker/tree/7.0.1) (2025-08-14)
3
+ ## [7.1.0](https://github.com/voxpupuli/beaker/tree/7.1.0) (2025-10-01)
4
+
5
+ [Full Changelog](https://github.com/voxpupuli/beaker/compare/7.0.1...7.1.0)
6
+
7
+ **Implemented enhancements:**
8
+
9
+ - \(\#1955\) Implement the powershell tmpfile method with extensions [\#1956](https://github.com/voxpupuli/beaker/pull/1956) ([michael-riddle](https://github.com/michael-riddle))
10
+
11
+ **Closed issues:**
12
+
13
+ - The tmpfile method in pswindows needs to implement the use of the extension parameter [\#1955](https://github.com/voxpupuli/beaker/issues/1955)
14
+
15
+ ## [7.0.1](https://github.com/voxpupuli/beaker/tree/7.0.1) (2025-08-15)
4
16
 
5
17
  [Full Changelog](https://github.com/voxpupuli/beaker/compare/7.0.0...7.0.1)
6
18
 
@@ -1,15 +1,26 @@
1
1
  module PSWindows::File
2
2
  include Beaker::CommandFactory
3
3
 
4
- def tmpfile(_name = '', extension = nil)
4
+ def tmpfile(name = '', extension = nil)
5
+ tmp_path = exec(powershell('[System.IO.Path]::GetTempPath()')).stdout.chomp
6
+
7
+ if name.empty?
8
+ base_name = exec(powershell('[System.IO.Path]::GetRandomFileName()')).stdout.chomp
9
+ else
10
+ base_name = name
11
+ end
12
+
5
13
  if extension
6
- # TODO: I do not have access to Windows, but the internet suggests this
7
- # $newname = [System.IO.Path]::ChangeExtension($filename, "#{extension}") ; MoveItem $filename $newname
8
- raise NotImplementedError, 'Passing an extension is not implemented'
14
+ # Remove existing extension if present and add the new one
15
+ base_name = base_name.sub(/\.[^.]+$/, '')
16
+ final_name = "#{base_name}.#{extension}"
17
+ else
18
+ final_name = base_name
9
19
  end
20
+ file_path = File.join(tmp_path, final_name)
10
21
 
11
- result = exec(powershell('[System.IO.Path]::GetTempFileName()'))
12
- result.stdout.chomp
22
+ exec(powershell("New-Item -Path '#{file_path}' -ItemType 'file' -Force"))
23
+ file_path
13
24
  end
14
25
 
15
26
  def tmpdir(name = '')
@@ -1,5 +1,5 @@
1
1
  module Beaker
2
2
  module Version
3
- STRING = '7.0.1'
3
+ STRING = '7.1.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beaker
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.0.1
4
+ version: 7.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet