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 +4 -4
- data/.github/workflows/ci.yml +1 -1
- data/CHANGELOG.md +12 -0
- data/Gemfile +2 -0
- data/lib/mini_portile2/mini_portile.rb +3 -5
- data/lib/mini_portile2/version.rb +1 -1
- data/mini_portile2.gemspec +2 -2
- data/test/test_download.rb +6 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b4913fc9a77207eb01b12c960a04125fd6517d57d727423af306689b5d5fc833
|
4
|
+
data.tar.gz: bc4a0a28a469ce473217fd176094b4e7238064a4f38040f39d7f514544a34842
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19b7cff7f935399f4b1162240bf0999e4db1a9af53edd0b462174dfcec32a38813afcca1901e95d7a539d4773dc1618e99349075b55181f300f43a1126936802
|
7
|
+
data.tar.gz: d872cbd565306b31f8a612fa03fcf1d7fbe2c35307806c8ae7c1099679aac729452567b5970bf7e121bcba05c504b235367acf159b950bebf08a0bd942063b07
|
data/.github/workflows/ci.yml
CHANGED
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,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
|
data/mini_portile2.gemspec
CHANGED
@@ -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
|
data/test/test_download.rb
CHANGED
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.
|
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-
|
13
|
+
date: 2021-05-31 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|