beaker 4.39.0 → 4.40.1

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: 772b30c85d3406390ceba9e0df29f7911dc990a579da87e3d520b8fd6a5deff5
4
+ data.tar.gz: bb5721411884d7876ade5bc04c6304308faf0e4090d3153126367943ccf6d4f2
5
5
  SHA512:
6
- metadata.gz: d3ebe45b647af548f4464db48dd0b1cbfdbf25eb37946a190f573b23d7e45bf8a216f1b55c84b3c65582ea2163b3848357ca16c61e319068cb851333e736cb45
7
- data.tar.gz: a4d11a73a5ef9a2bad6920085c2c32abd8117c3085b9d1b9f8c2bda18b2fecd719c7d38175fd861d2472af568a0312972f01f17d0bfbc3bfe1f4ddcbb5f6f148
6
+ metadata.gz: 48814c53dada3769d467a63f15817f07b4c94139b7127aa5befe42b1cce4e3d186baa620a88a9156ccc1ac35170530a1bf6036b4951b3e1adf66d69e628788ed
7
+ data.tar.gz: ca25c8a16952c3af5f9415ded1b30fe76ff9ea37bf7892a264b41b6c86432a1fcc787ce3d9e1be05407cfa7a502828a059b6d97d00cbe886024a249e301bf8ff
data/CHANGELOG.md CHANGED
@@ -1,6 +1,20 @@
1
1
  # Changelog
2
2
 
3
- ## [4.39.0](https://github.com/voxpupuli/beaker/tree/4.39.0) (2023-02-09)
3
+ ## [4.40.1](https://github.com/voxpupuli/beaker/tree/4.40.1) (2023-05-05)
4
+
5
+ **Merged Changes:**
6
+
7
+ - in-parallel: Allow 1.x [\#1813](https://github.com/voxpupuli/beaker/pull/1813) ([bastelfreak](https://github.com/bastelfreak))
8
+
9
+ ## [4.40.0](https://github.com/voxpupuli/beaker/tree/4.40.0) (2023-04-04)
10
+
11
+ [Full Changelog](https://github.com/voxpupuli/beaker/compare/4.39.0...4.40.0)
12
+
13
+ **Implemented enhancements:**
14
+
15
+ - \(maint\) Backport 'Removes open\_uri\_redirections' [\#1798](https://github.com/voxpupuli/beaker/pull/1798) ([joshcooper](https://github.com/joshcooper))
16
+
17
+ ## [4.39.0](https://github.com/voxpupuli/beaker/tree/4.39.0) (2023-02-18)
4
18
 
5
19
  [Full Changelog](https://github.com/voxpupuli/beaker/compare/4.38.1...4.39.0)
6
20
 
@@ -10,9 +24,9 @@
10
24
 
11
25
  **Implemented enhancements:**
12
26
 
13
- - Add RuboCop [\#1761](https://github.com/voxpupuli/beaker/pull/1761) ([ekohl](https://github.com/ekohl))
27
+ - Add Rubocop [\#1761](https://github.com/voxpupuli/beaker/pull/1761) ([ekohl](https://github.com/ekohl))
14
28
  - 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))
29
+ - \(maint\) StringInclude Rubocop corrections [\#1765](https://github.com/voxpupuli/beaker/pull/1765) ([mhashizume](https://github.com/mhashizume))
16
30
 
17
31
  **Closed issues:**
18
32
 
data/beaker.gemspec CHANGED
@@ -40,8 +40,7 @@ Gem::Specification.new do |s|
40
40
  s.add_runtime_dependency 'net-scp', '>= 1.2', '< 5.0'
41
41
  s.add_runtime_dependency 'net-ssh', '>= 5.0'
42
42
 
43
- s.add_runtime_dependency 'in-parallel', '~> 0.1'
44
- s.add_runtime_dependency 'open_uri_redirections', '~> 0.2.1'
43
+ s.add_runtime_dependency 'in-parallel', '>= 0.1', '< 2'
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.1'
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.1
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-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fakefs
@@ -202,30 +202,22 @@ dependencies:
202
202
  name: in-parallel
203
203
  requirement: !ruby/object:Gem::Requirement
204
204
  requirements:
205
- - - "~>"
205
+ - - ">="
206
206
  - !ruby/object:Gem::Version
207
207
  version: '0.1'
208
+ - - "<"
209
+ - !ruby/object:Gem::Version
210
+ version: '2'
208
211
  type: :runtime
209
212
  prerelease: false
210
213
  version_requirements: !ruby/object:Gem::Requirement
211
214
  requirements:
212
- - - "~>"
215
+ - - ">="
213
216
  - !ruby/object:Gem::Version
214
217
  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
- - - "~>"
218
+ - - "<"
227
219
  - !ruby/object:Gem::Version
228
- version: 0.2.1
220
+ version: '2'
229
221
  - !ruby/object:Gem::Dependency
230
222
  name: rsync
231
223
  requirement: !ruby/object:Gem::Requirement