mini_portile2 2.6.0 → 2.6.1
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 +8 -3
- data/CHANGELOG.md +14 -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 +1 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1cce9a4c5c119fbab9f241aae304d9aec171a69873a168688132d55e4010ee49
|
4
|
+
data.tar.gz: eb61f44c46b6822aae38027d6c4aecb3c16d6b8d6e7caf008d90110da98c1d69
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c943d0ce63b54f9199426af7658f200054a87d151ff30b66183a5afa10096955733bab9a7ccaa167a9052e3826243d779e0579ded63ed1ea2522d35ab5940512
|
7
|
+
data.tar.gz: 476d783710ca21b2893256f39a34f4f958a289ece0230eb7e364f4b1c0714e39f85c74f5f84783279685953ac179fc899959c0fb7302f41856720ceefdb33436
|
data/.github/workflows/ci.yml
CHANGED
@@ -1,14 +1,19 @@
|
|
1
1
|
name: Continuous Integration
|
2
2
|
|
3
3
|
on:
|
4
|
+
workflow_dispatch:
|
4
5
|
push:
|
5
|
-
branches:
|
6
|
+
branches:
|
7
|
+
- main
|
8
|
+
- v*.*.x
|
9
|
+
tags:
|
10
|
+
- v*.*.*
|
6
11
|
pull_request:
|
7
12
|
types: [opened, synchronize]
|
8
|
-
branches:
|
13
|
+
branches:
|
14
|
+
- "*"
|
9
15
|
schedule:
|
10
16
|
- cron: "0 8 * * 5" # At 08:00 on Friday # https://crontab.guru/#0_8_*_*_5
|
11
|
-
workflow_dispatch:
|
12
17
|
|
13
18
|
jobs:
|
14
19
|
test-unit:
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,19 @@
|
|
1
1
|
## mini_portile changelog
|
2
2
|
|
3
|
+
### 2.6.1 / 2021-05-31
|
4
|
+
|
5
|
+
#### Dependencies
|
6
|
+
|
7
|
+
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.
|
8
|
+
|
9
|
+
|
10
|
+
### 2.5.3 / 2021-05-31
|
11
|
+
|
12
|
+
#### Dependencies
|
13
|
+
|
14
|
+
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.
|
15
|
+
|
16
|
+
|
3
17
|
### 2.6.0 / 2021-05-31
|
4
18
|
|
5
19
|
### Added
|
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'
|
@@ -490,7 +489,6 @@ private
|
|
490
489
|
def download_file_http(url, full_path, count = 3)
|
491
490
|
filename = File.basename(full_path)
|
492
491
|
with_tempfile(filename, full_path) do |temp_file|
|
493
|
-
progress = 0
|
494
492
|
total = 0
|
495
493
|
params = {
|
496
494
|
"Accept-Encoding" => 'identity',
|
@@ -499,7 +497,6 @@ private
|
|
499
497
|
if total
|
500
498
|
new_progress = (bytes * 100) / total
|
501
499
|
message "\rDownloading %s (%3d%%) " % [filename, new_progress]
|
502
|
-
progress = new_progress
|
503
500
|
else
|
504
501
|
# Content-Length is unavailable because Transfer-Encoding is chunked
|
505
502
|
message "\rDownloading %s " % [filename]
|
@@ -547,16 +544,15 @@ private
|
|
547
544
|
end
|
548
545
|
|
549
546
|
def download_file_ftp(uri, full_path)
|
547
|
+
require "net/ftp"
|
550
548
|
filename = File.basename(uri.path)
|
551
549
|
with_tempfile(filename, full_path) do |temp_file|
|
552
|
-
progress = 0
|
553
550
|
total = 0
|
554
551
|
params = {
|
555
552
|
:content_length_proc => lambda{|length| total = length },
|
556
553
|
:progress_proc => lambda{|bytes|
|
557
554
|
new_progress = (bytes * 100) / total
|
558
555
|
message "\rDownloading %s (%3d%%) " % [filename, new_progress]
|
559
|
-
progress = new_progress
|
560
556
|
}
|
561
557
|
}
|
562
558
|
if ENV["ftp_proxy"]
|
@@ -572,6 +568,8 @@ private
|
|
572
568
|
end
|
573
569
|
output
|
574
570
|
end
|
571
|
+
rescue LoadError
|
572
|
+
raise LoadError, "Ruby #{RUBY_VERSION} does not provide the net-ftp gem, please add it as a dependency if you need to use FTP"
|
575
573
|
rescue Net::FTPError
|
576
574
|
return false
|
577
575
|
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.6.
|
4
|
+
version: 2.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luis Lavena
|
@@ -12,20 +12,6 @@ bindir: bin
|
|
12
12
|
cert_chain: []
|
13
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
|