beaker 4.39.0 → 4.40.0

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: 034ae21eb707ca77a36a13ded6183b148c17565a49949567a79af42e1f11af0d
4
- data.tar.gz: 91d4c0c6e3162c6a92927b40079f266b9e548b96c22bd98ff4585ce9aa73b576
3
+ metadata.gz: 63f687c51eaaca96401643346f8a76a1cbf0e907950f92c29285df20ce713506
4
+ data.tar.gz: d54e2172b6b9d446204dd6fc0ccea5c5d963b411e8a0df536e329de3185ed585
5
5
  SHA512:
6
- metadata.gz: d3ebe45b647af548f4464db48dd0b1cbfdbf25eb37946a190f573b23d7e45bf8a216f1b55c84b3c65582ea2163b3848357ca16c61e319068cb851333e736cb45
7
- data.tar.gz: a4d11a73a5ef9a2bad6920085c2c32abd8117c3085b9d1b9f8c2bda18b2fecd719c7d38175fd861d2472af568a0312972f01f17d0bfbc3bfe1f4ddcbb5f6f148
6
+ metadata.gz: 181a5743faac578d27ed8ebb1068804626cd7e47952792a5ea3d59cb572c91e330efedc6238fd05cdf678396f4e13089cc3017d10a03c50bc444d3b847c2ec5f
7
+ data.tar.gz: 86fbf39233cb4ce3e25fff57b0bff05f09cc6cd387f41465fe269507f7e775ae3ac835069cdf775662db9106554399b81aac63cf0a83baf9e40dcaa60f3d3240
data/CHANGELOG.md CHANGED
@@ -1,6 +1,14 @@
1
1
  # Changelog
2
2
 
3
- ## [4.39.0](https://github.com/voxpupuli/beaker/tree/4.39.0) (2023-02-09)
3
+ ## [4.40.0](https://github.com/voxpupuli/beaker/tree/4.40.0) (2023-04-04)
4
+
5
+ [Full Changelog](https://github.com/voxpupuli/beaker/compare/4.39.0...4.40.0)
6
+
7
+ **Implemented enhancements:**
8
+
9
+ - \(maint\) Backport 'Removes open\_uri\_redirections' [\#1798](https://github.com/voxpupuli/beaker/pull/1798) ([joshcooper](https://github.com/joshcooper))
10
+
11
+ ## [4.39.0](https://github.com/voxpupuli/beaker/tree/4.39.0) (2023-02-18)
4
12
 
5
13
  [Full Changelog](https://github.com/voxpupuli/beaker/compare/4.38.1...4.39.0)
6
14
 
@@ -10,9 +18,9 @@
10
18
 
11
19
  **Implemented enhancements:**
12
20
 
13
- - Add RuboCop [\#1761](https://github.com/voxpupuli/beaker/pull/1761) ([ekohl](https://github.com/ekohl))
21
+ - Add Rubocop [\#1761](https://github.com/voxpupuli/beaker/pull/1761) ([ekohl](https://github.com/ekohl))
14
22
  - Update net-scp requirement from >= 1.2, < 4.0 to >= 1.2, < 5.0 [\#1757](https://github.com/voxpupuli/beaker/pull/1757)
15
- - (maint) StringInclude Rubocop corrections [\1765](https://github.com/voxpupuli/beaker/pull/1765) ([mhashizume](https://github.com/mhashizume))
23
+ - \(maint\) StringInclude Rubocop corrections [\#1765](https://github.com/voxpupuli/beaker/pull/1765) ([mhashizume](https://github.com/mhashizume))
16
24
 
17
25
  **Closed issues:**
18
26
 
data/beaker.gemspec CHANGED
@@ -41,7 +41,6 @@ Gem::Specification.new do |s|
41
41
  s.add_runtime_dependency 'net-ssh', '>= 5.0'
42
42
 
43
43
  s.add_runtime_dependency 'in-parallel', '~> 0.1'
44
- s.add_runtime_dependency 'open_uri_redirections', '~> 0.2.1'
45
44
  s.add_runtime_dependency 'rsync', '~> 1.0.9'
46
45
  s.add_runtime_dependency 'thor', ['>= 1.0.1', '< 2.0']
47
46
 
@@ -52,7 +52,6 @@ module Beaker
52
52
  # @!visibility private
53
53
  def fetch_http_file(base_url, file_name, dst_dir)
54
54
  require 'open-uri'
55
- require 'open_uri_redirections'
56
55
  FileUtils.makedirs(dst_dir)
57
56
  base_url.chomp!('/')
58
57
  src = "#{base_url}/#{file_name}"
@@ -63,7 +62,7 @@ module Beaker
63
62
  logger.notify "Fetching: #{src}"
64
63
  logger.notify " and saving to #{dst}"
65
64
  begin
66
- open(src, :allow_redirections => :all) do |remote|
65
+ uri_open(src) do |remote|
67
66
  File.open(dst, "w") do |file|
68
67
  FileUtils.copy_stream(remote, file)
69
68
  end
@@ -79,6 +78,19 @@ module Beaker
79
78
  return dst
80
79
  end
81
80
 
81
+ def uri_open(src)
82
+ if RUBY_VERSION.to_f < 2.5
83
+ URI.send(:open, src) do |remote|
84
+ yield remote
85
+ end
86
+ else
87
+ URI.open(src) do |remote|
88
+ yield remote
89
+ end
90
+ end
91
+ end
92
+ private :uri_open
93
+
82
94
  # Recursively fetch the contents of the given http url, ignoring
83
95
  # `index.html` and `*.gif` files.
84
96
  #
@@ -1,5 +1,5 @@
1
1
  module Beaker
2
2
  module Version
3
- STRING = '4.39.0'
3
+ STRING = '4.40.0'
4
4
  end
5
5
  end
@@ -14,7 +14,7 @@ end
14
14
 
15
15
  describe ClassMixedWithDSLHelpers do
16
16
  let( :logger ) { double("Beaker::Logger", :notify => nil , :debug => nil ) }
17
- let( :url ) { "http://beaker.tool" }
17
+ let( :url ) { "http://example.com" }
18
18
  let( :name ) { "name" }
19
19
  let( :destdir ) { "destdir" }
20
20
 
@@ -37,7 +37,7 @@ describe ClassMixedWithDSLHelpers do
37
37
  concat_path = "#{destdir}/#{name}"
38
38
  create_files([concat_path])
39
39
  allow(logger).to receive(:notify)
40
- allow(subject).to receive(:open)
40
+ allow(URI).to receive(:open).with("#{url}/#{name}").and_return(status: 200)
41
41
  result = subject.fetch_http_file url, name, destdir
42
42
  expect(result).to eq(concat_path)
43
43
  end
@@ -45,7 +45,8 @@ describe ClassMixedWithDSLHelpers do
45
45
  it 'doesn\'t cache by default' do
46
46
  expect( logger ).to receive( :notify ).with( /^Fetching/ ).ordered
47
47
  expect( logger ).to receive( :notify ).with( /^\ \ and\ saving\ to\ / ).ordered
48
- expect( subject ).to receive( :open )
48
+ allow(URI).to receive(:open).with("#{url}/#{name}").and_return(status: 200)
49
+ expect(URI).to receive(:open)
49
50
 
50
51
  subject.fetch_http_file( url, name, destdir )
51
52
  end
@@ -67,7 +68,8 @@ describe ClassMixedWithDSLHelpers do
67
68
 
68
69
  expect( logger ).to receive( :notify ).with( /^Fetching/ ).ordered
69
70
  expect( logger ).to receive( :notify ).with( /^\ \ and\ saving\ to\ / ).ordered
70
- expect( subject ).to receive( :open )
71
+ allow(URI).to receive(:open).with("#{url}/#{name}").and_return(status: 200)
72
+ expect(URI).to receive(:open)
71
73
 
72
74
  subject.fetch_http_file( url, name, destdir )
73
75
  end
@@ -78,8 +80,9 @@ describe ClassMixedWithDSLHelpers do
78
80
  describe 'given invalid arguments' do
79
81
 
80
82
  it 'chomps correctly when given a URL ending with a / character' do
81
- expect( subject ).to receive( :open ).with( "#{url}/#{name}", anything )
82
- subject.fetch_http_file( url, name, destdir )
83
+ allow(URI).to receive(:open).with("#{url}/#{name}").and_return(status: 200)
84
+ expect( URI ).to receive( :open ).with( "#{url}/#{name}" )
85
+ subject.fetch_http_file( "#{url}/", name, destdir )
83
86
  end
84
87
 
85
88
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beaker
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.39.0
4
+ version: 4.40.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-02-18 00:00:00.000000000 Z
11
+ date: 2023-04-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fakefs
@@ -212,20 +212,6 @@ dependencies:
212
212
  - - "~>"
213
213
  - !ruby/object:Gem::Version
214
214
  version: '0.1'
215
- - !ruby/object:Gem::Dependency
216
- name: open_uri_redirections
217
- requirement: !ruby/object:Gem::Requirement
218
- requirements:
219
- - - "~>"
220
- - !ruby/object:Gem::Version
221
- version: 0.2.1
222
- type: :runtime
223
- prerelease: false
224
- version_requirements: !ruby/object:Gem::Requirement
225
- requirements:
226
- - - "~>"
227
- - !ruby/object:Gem::Version
228
- version: 0.2.1
229
215
  - !ruby/object:Gem::Dependency
230
216
  name: rsync
231
217
  requirement: !ruby/object:Gem::Requirement