mini_portile2 2.5.1 → 2.5.3

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: 1f30e371678c82b2de1219ec842fa298bf1e6acc47b2f210ebfda77939aed190
4
- data.tar.gz: 7ac927dc6453bf1532db4e55677cebefa115b17fffc43358ef68b8d80c967210
3
+ metadata.gz: b4913fc9a77207eb01b12c960a04125fd6517d57d727423af306689b5d5fc833
4
+ data.tar.gz: bc4a0a28a469ce473217fd176094b4e7238064a4f38040f39d7f514544a34842
5
5
  SHA512:
6
- metadata.gz: df62e128fdb0a950c7f6eb45ba97bdab7793b6e8b6e4a139dd5fe93913bffee194a5505114dfe421f6d64efb25ad17215eb8f1ecd8fdc1d40969aa2b888bebee
7
- data.tar.gz: c05f9262bdbb32fcdcda598c8ae0f16962219f39306ae9d4433b1e13af6e2c2ec181c33864ee99284ebe5f82828940ce3d96a9bb9a4ce00947ab56b7d3699252
6
+ metadata.gz: 19b7cff7f935399f4b1162240bf0999e4db1a9af53edd0b462174dfcec32a38813afcca1901e95d7a539d4773dc1618e99349075b55181f300f43a1126936802
7
+ data.tar.gz: d872cbd565306b31f8a612fa03fcf1d7fbe2c35307806c8ae7c1099679aac729452567b5970bf7e121bcba05c504b235367acf159b950bebf08a0bd942063b07
@@ -17,7 +17,7 @@ jobs:
17
17
  strategy:
18
18
  matrix:
19
19
  platform: [ubuntu-latest, windows-latest]
20
- ruby: ["2.5", "2.6", "2.7", "3.0"]
20
+ ruby: ["2.3", "2.4", "2.5", "2.6", "2.7", "3.0", "head"]
21
21
  runs-on: ${{ matrix.platform }}
22
22
  steps:
23
23
  - name: configure git crlf on windows
data/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  ## mini_portile changelog
2
2
 
3
+ ### 2.5.3 / 2021-05-31
4
+
5
+ Make `net-ftp` an optional dependency, since requiring it as a hard dependency in v2.5.2 caused warnings to be emitted by Ruby 2.7 and earlier. A warning message is emitted if FTP functionality is called and `net-ftp` isn't available; this should only happen in Ruby 3.1 and later.
6
+
7
+
8
+ ### 2.5.2 / 2021-05-28
9
+
10
+ #### Dependencies
11
+
12
+ Add `net-ftp` as an explicit dependency to accommodate the upcoming Ruby 3.1 changes that move this and other gems out of the "default" gem set and into the "bundled" gem set. See https://bugs.ruby-lang.org/issues/17873 [#101]
13
+
14
+
3
15
  ### 2.5.1 / 2021-04-28
4
16
 
5
17
  #### Dependencies
data/Gemfile CHANGED
@@ -1,4 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
+ gem "net-ftp" if Gem::Requirement.new("> 3.1.0.dev").satisfied_by?(Gem::Version.new(RUBY_VERSION))
4
+
3
5
  # Specify your gem's dependencies in mini_portile2.gemspec
4
6
  gemspec
@@ -1,7 +1,6 @@
1
1
  require 'rbconfig'
2
2
  require 'net/http'
3
3
  require 'net/https'
4
- require 'net/ftp'
5
4
  require 'fileutils'
6
5
  require 'tempfile'
7
6
  require 'digest'
@@ -473,7 +472,6 @@ private
473
472
  def download_file_http(url, full_path, count = 3)
474
473
  filename = File.basename(full_path)
475
474
  with_tempfile(filename, full_path) do |temp_file|
476
- progress = 0
477
475
  total = 0
478
476
  params = {
479
477
  "Accept-Encoding" => 'identity',
@@ -482,7 +480,6 @@ private
482
480
  if total
483
481
  new_progress = (bytes * 100) / total
484
482
  message "\rDownloading %s (%3d%%) " % [filename, new_progress]
485
- progress = new_progress
486
483
  else
487
484
  # Content-Length is unavailable because Transfer-Encoding is chunked
488
485
  message "\rDownloading %s " % [filename]
@@ -530,16 +527,15 @@ private
530
527
  end
531
528
 
532
529
  def download_file_ftp(uri, full_path)
530
+ require "net/ftp"
533
531
  filename = File.basename(uri.path)
534
532
  with_tempfile(filename, full_path) do |temp_file|
535
- progress = 0
536
533
  total = 0
537
534
  params = {
538
535
  :content_length_proc => lambda{|length| total = length },
539
536
  :progress_proc => lambda{|bytes|
540
537
  new_progress = (bytes * 100) / total
541
538
  message "\rDownloading %s (%3d%%) " % [filename, new_progress]
542
- progress = new_progress
543
539
  }
544
540
  }
545
541
  if ENV["ftp_proxy"]
@@ -555,6 +551,8 @@ private
555
551
  end
556
552
  output
557
553
  end
554
+ rescue LoadError
555
+ raise LoadError, "Ruby #{RUBY_VERSION} does not provide the net-ftp gem, please add it as a dependency if you need to use FTP"
558
556
  rescue Net::FTPError
559
557
  return false
560
558
  end
@@ -1,3 +1,3 @@
1
1
  class MiniPortile
2
- VERSION = "2.5.1"
2
+ VERSION = "2.5.3"
3
3
  end
@@ -31,12 +31,12 @@ Gem::Specification.new do |spec|
31
31
  spec.test_files = spec.files.grep(%r{^(test|spec|features|examples)/})
32
32
  spec.require_paths = ["lib"]
33
33
 
34
+ spec.required_ruby_version = ">= 2.3.0"
35
+
34
36
  spec.add_development_dependency "bundler", "~> 2.1"
35
37
  spec.add_development_dependency "minitar", "~> 0.7"
36
38
  spec.add_development_dependency "minitest", "~> 5.11"
37
39
  spec.add_development_dependency "minitest-hooks", "~> 1.5.0"
38
40
  spec.add_development_dependency "rake", "~> 13.0"
39
41
  spec.add_development_dependency "webrick", "~> 1.0"
40
-
41
- spec.required_ruby_version = ">= 2.3.0"
42
42
  end
@@ -18,10 +18,12 @@ describe "recipe download" do
18
18
  end
19
19
  end
20
20
 
21
- block.call
22
-
23
- thread.kill
24
- server.close
21
+ begin
22
+ block.call
23
+ ensure
24
+ thread.kill
25
+ server.close
26
+ end
25
27
 
26
28
  request_count.must_be :>, 0
27
29
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mini_portile2
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.1
4
+ version: 2.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luis Lavena
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2021-04-28 00:00:00.000000000 Z
13
+ date: 2021-05-31 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler