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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cead22320fb80bbc4e46f568f422211dd8a6af92006edc220e1320019cc52676
4
- data.tar.gz: d4b5deaa502e5ae66526eb2b23978a4ef52996a100a64f224664927dca0658b2
3
+ metadata.gz: 1cce9a4c5c119fbab9f241aae304d9aec171a69873a168688132d55e4010ee49
4
+ data.tar.gz: eb61f44c46b6822aae38027d6c4aecb3c16d6b8d6e7caf008d90110da98c1d69
5
5
  SHA512:
6
- metadata.gz: 7dbd446271e3b0c26cf39504b6b1af53faee8a212ba7451af76f17e1f8858b3f329c5e281f753d1731fe27a3d9121c9f7328188ead52aaf63c1d4728c44fcd99
7
- data.tar.gz: a6b17cd4c01588c86d70a4e18c713cc5c13c16922ac64cc38e7c77fac416b1a9e1fa4eeee502dd23f13ece5a16d8b364033169de0e8e4612012544599a692c03
6
+ metadata.gz: c943d0ce63b54f9199426af7658f200054a87d151ff30b66183a5afa10096955733bab9a7ccaa167a9052e3826243d779e0579ded63ed1ea2522d35ab5940512
7
+ data.tar.gz: 476d783710ca21b2893256f39a34f4f958a289ece0230eb7e364f4b1c0714e39f85c74f5f84783279685953ac179fc899959c0fb7302f41856720ceefdb33436
@@ -1,14 +1,19 @@
1
1
  name: Continuous Integration
2
2
 
3
3
  on:
4
+ workflow_dispatch:
4
5
  push:
5
- branches: [main]
6
+ branches:
7
+ - main
8
+ - v*.*.x
9
+ tags:
10
+ - v*.*.*
6
11
  pull_request:
7
12
  types: [opened, synchronize]
8
- branches: [main]
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,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'
@@ -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
@@ -1,3 +1,3 @@
1
1
  class MiniPortile
2
- VERSION = "2.6.0"
2
+ VERSION = "2.6.1"
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.6.0
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