mini_portile2 2.5.2 → 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: a50c7c03eb4dcb7395372836a55084a65dbb7b29fde587cb9a0e795464008e50
4
- data.tar.gz: d6ec7eda8e8e8fec8c50824ec50d25062cfc21ad8f745002d35ddbb31c8f4e7d
3
+ metadata.gz: b4913fc9a77207eb01b12c960a04125fd6517d57d727423af306689b5d5fc833
4
+ data.tar.gz: bc4a0a28a469ce473217fd176094b4e7238064a4f38040f39d7f514544a34842
5
5
  SHA512:
6
- metadata.gz: a5b8423782025822fed3b7ad9b24c3db71791042a510adb90260d40138286090e3bc981671d57da3639dd80a559bdb77bac222551b6a3eef9259cee63aa9d98e
7
- data.tar.gz: 52ec801b7006e8bc74a4ccb87a636e5a9d222d58d18a2c2d609778a45f83a1381e74a16e9065ecff51558781561547ad96ba495c09679c759b893b6a9328bb79
6
+ metadata.gz: 19b7cff7f935399f4b1162240bf0999e4db1a9af53edd0b462174dfcec32a38813afcca1901e95d7a539d4773dc1618e99349075b55181f300f43a1126936802
7
+ data.tar.gz: d872cbd565306b31f8a612fa03fcf1d7fbe2c35307806c8ae7c1099679aac729452567b5970bf7e121bcba05c504b235367acf159b950bebf08a0bd942063b07
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
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
+
3
8
  ### 2.5.2 / 2021-05-28
4
9
 
5
10
  #### 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.2"
2
+ VERSION = "2.5.3"
3
3
  end
@@ -33,8 +33,6 @@ Gem::Specification.new do |spec|
33
33
 
34
34
  spec.required_ruby_version = ">= 2.3.0"
35
35
 
36
- spec.add_dependency "net-ftp", "~> 0.1"
37
-
38
36
  spec.add_development_dependency "bundler", "~> 2.1"
39
37
  spec.add_development_dependency "minitar", "~> 0.7"
40
38
  spec.add_development_dependency "minitest", "~> 5.11"
@@ -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.2
4
+ version: 2.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luis Lavena
@@ -10,22 +10,8 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2021-05-28 00:00:00.000000000 Z
13
+ date: 2021-05-31 00:00:00.000000000 Z
14
14
  dependencies:
15
- - !ruby/object:Gem::Dependency
16
- name: net-ftp
17
- requirement: !ruby/object:Gem::Requirement
18
- requirements:
19
- - - "~>"
20
- - !ruby/object:Gem::Version
21
- version: '0.1'
22
- type: :runtime
23
- prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
- requirements:
26
- - - "~>"
27
- - !ruby/object:Gem::Version
28
- version: '0.1'
29
15
  - !ruby/object:Gem::Dependency
30
16
  name: bundler
31
17
  requirement: !ruby/object:Gem::Requirement