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 +4 -4
- data/CHANGELOG.md +5 -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 +0 -2
- data/test/test_download.rb +6 -4
- metadata +2 -16
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/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,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
@@ -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"
|
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,22 +10,8 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2021-05-
|
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
|