net-ftp 0.2.0 → 0.3.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: cf9d2560e8bb495195915b83e2fa701ff039c328b06934515ac50f1309025769
4
- data.tar.gz: 2231a3b5311f57b6fee02282e8cb41fd717b79cc1f2186d76483db8fd873ff47
3
+ metadata.gz: cbc758bc303474886e8c40fc3acf98ca44e634f4c25c97e6963e13a2ad0cee71
4
+ data.tar.gz: c9a574f98c3e4e9e6f917a67908df8d89d0c773b817995b60540212868e56a5b
5
5
  SHA512:
6
- metadata.gz: 52f5676aecc77cc97286bbbe6c6649ff9a966e7e161674643593db4cdb1aacdd6080fa25d8f8e3e379b9649125a5dd1167b3292401268141f0924bf618e4e0ad
7
- data.tar.gz: 19212687975c12da4fee59c30e620ead52ad0e5a8beccf178de4c74809e43fc662c6cf5a5e084d3b222c19d5bacc4c352bdebb7b2d18939f9762600f9c43b60d
6
+ metadata.gz: 6cea95f58bdfa8fa8e35bbc6976bb786446da71e1b2931acc1619ee9a6d1a267ccc0e1cf1784c6f3520bd213fe7f056ddb09c6b9749023da65112b4f3bf34f0f
7
+ data.tar.gz: 1c5140e079cb82af2705d0403dcf85c11fb61a848ceb7b284b07f5014210df67dab148df78ad5a3057f2f81762be7cab33c4de5db4eef718c96c32ead39028db
@@ -11,7 +11,7 @@ jobs:
11
11
  os: [ ubuntu-latest, macos-latest ]
12
12
  runs-on: ${{ matrix.os }}
13
13
  steps:
14
- - uses: actions/checkout@v3
14
+ - uses: actions/checkout@v4
15
15
  - name: Set up Ruby
16
16
  uses: ruby/setup-ruby@v1
17
17
  with:
data/lib/net/ftp.rb CHANGED
@@ -85,7 +85,7 @@ module Net
85
85
  end
86
86
 
87
87
  # :stopdoc:
88
- VERSION = "0.2.0"
88
+ VERSION = "0.3.1"
89
89
  FTP_PORT = 21
90
90
  CRLF = "\r\n"
91
91
  DEFAULT_BLOCKSIZE = BufferedIO::BUFSIZE
@@ -356,19 +356,14 @@ module Net
356
356
  # SOCKS_SERVER, then a SOCKSSocket is returned, else a Socket is
357
357
  # returned.
358
358
  def open_socket(host, port) # :nodoc:
359
- if defined? SOCKSSocket and ENV["SOCKS_SERVER"]
360
- @passive = true
361
- Timeout.timeout(@open_timeout, OpenTimeout) do
359
+ return Timeout.timeout(@open_timeout, OpenTimeout) {
360
+ if defined? SOCKSSocket and ENV["SOCKS_SERVER"]
361
+ @passive = true
362
362
  SOCKSSocket.open(host, port)
363
+ else
364
+ Socket.tcp(host, port)
363
365
  end
364
- else
365
- begin
366
- Socket.tcp host, port, nil, nil, connect_timeout: @open_timeout
367
- rescue Errno::ETIMEDOUT #raise Net:OpenTimeout instead for compatibility with previous versions
368
- raise Net::OpenTimeout, "Timeout to open TCP connection to "\
369
- "#{host}:#{port} (exceeds #{@open_timeout} seconds)"
370
- end
371
- end
366
+ }
372
367
  end
373
368
  private :open_socket
374
369
 
@@ -582,8 +577,9 @@ module Net
582
577
  if !resp.start_with?("1")
583
578
  raise FTPReplyError, resp
584
579
  end
585
- ensure
586
- conn.close if conn && $!
580
+ rescue
581
+ conn&.close
582
+ raise
587
583
  end
588
584
  else
589
585
  sock = makeport
@@ -1401,7 +1397,7 @@ module Net
1401
1397
  if !resp.start_with?("227")
1402
1398
  raise FTPReplyError, resp
1403
1399
  end
1404
- if m = /\((?<host>\d+(?:,\d+){3}),(?<port>\d+,\d+)\)/.match(resp)
1400
+ if m = /(?<host>\d+(?:,\d+){3}),(?<port>\d+,\d+)/.match(resp)
1405
1401
  if @use_pasv_ip
1406
1402
  host = parse_pasv_ipv4_host(m["host"])
1407
1403
  else
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: net-ftp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shugo Maeda
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-07 00:00:00.000000000 Z
11
+ date: 2023-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-protocol
@@ -61,7 +61,7 @@ licenses:
61
61
  metadata:
62
62
  homepage_uri: https://github.com/ruby/net-ftp
63
63
  source_code_uri: https://github.com/ruby/net-ftp
64
- post_install_message:
64
+ post_install_message:
65
65
  rdoc_options: []
66
66
  require_paths:
67
67
  - lib
@@ -76,8 +76,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
76
76
  - !ruby/object:Gem::Version
77
77
  version: '0'
78
78
  requirements: []
79
- rubygems_version: 3.4.0.dev
80
- signing_key:
79
+ rubygems_version: 3.5.0.dev
80
+ signing_key:
81
81
  specification_version: 4
82
82
  summary: Support for the File Transfer Protocol.
83
83
  test_files: []