net-ftp 0.3.4 → 0.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 919adfa147311a5da81bd2b0efc00afe1d79276e393261d24da699da32f69846
4
- data.tar.gz: a6dedebacaf2cf545110471c769481e53e9864e347a07f2a2ce65b900aa90142
3
+ metadata.gz: 461ec5d7ab22ccd0247c0c2743e5eec8e6b98acc45caeb354325853aa726b5e9
4
+ data.tar.gz: c953747819f0742d5749f4ce53b06ff84a49475ecb937266a3fd908bbe04ed09
5
5
  SHA512:
6
- metadata.gz: f69079237f55ac8e9dd7ac501d6542a24591ca8fae70f13e7e903de6d4106fdbb98b2e9aa041e7878782665b5d6dc4a80f1497641e3b1d16ce1abf7b4ec65ce7
7
- data.tar.gz: 8d834ceb84c3a267c517676502a7daa3e3d7f4737783dad2fd298000b64cd86a1b8436dc53765475d00e5a0df02fdd4f3d1c827b3445d744e8143723a24f7444
6
+ metadata.gz: f47c2db4011a98a9ac0c6dba7e313dc8eca773e5aeb2b1a23f049d4a316a79d7eff2551286e291844a9ff0a2000a8fccbdf7a8f34854a273527e3462c67d183e
7
+ data.tar.gz: 6deea76a58d105a7dbbcaab5e46f0b8fe53b80711ea984c7244900d8472d0516bf89540b52b0f9ccf9be67f108d7c1fe567d4241cc91b50ff25aa3783a70247b
@@ -0,0 +1,48 @@
1
+ name: Publish gem to rubygems.org
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*'
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ push:
13
+ if: github.repository == 'ruby/net-ftp'
14
+ runs-on: ubuntu-latest
15
+
16
+ environment:
17
+ name: rubygems.org
18
+ url: https://rubygems.org/gems/net-ftp
19
+
20
+ permissions:
21
+ contents: write
22
+ id-token: write
23
+
24
+ steps:
25
+ # Set up
26
+ - name: Harden Runner
27
+ uses: step-security/harden-runner@f086349bfa2bd1361f7909c78558e816508cdc10 # v2.8.0
28
+ with:
29
+ egress-policy: audit
30
+
31
+ - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
32
+
33
+ - name: Set up Ruby
34
+ uses: ruby/setup-ruby@cacc9f1c0b3f4eb8a16a6bb0ed10897b43b9de49 # v1.176.0
35
+ with:
36
+ bundler-cache: true
37
+ ruby-version: ruby
38
+
39
+ # Release
40
+ - name: Publish to RubyGems
41
+ uses: rubygems/release-gem@612653d273a73bdae1df8453e090060bb4db5f31 # v1
42
+
43
+ - name: Create GitHub release
44
+ run: |
45
+ tag_name="$(git describe --tags --abbrev=0)"
46
+ gh release create "${tag_name}" --verify-tag --draft --generate-notes
47
+ env:
48
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -3,11 +3,18 @@ name: ubuntu
3
3
  on: [push, pull_request]
4
4
 
5
5
  jobs:
6
+ ruby-versions:
7
+ uses: ruby/actions/.github/workflows/ruby_versions.yml@master
8
+ with:
9
+ engine: cruby
10
+ min_version: 2.6
11
+
6
12
  build:
13
+ needs: ruby-versions
7
14
  name: build (${{ matrix.ruby }} / ${{ matrix.os }})
8
15
  strategy:
9
16
  matrix:
10
- ruby: [ head, '3.1', '3.0', '2.7', '2.6' ]
17
+ ruby: ${{ fromJson(needs.ruby-versions.outputs.versions) }}
11
18
  os: [ ubuntu-latest, macos-latest ]
12
19
  runs-on: ${{ matrix.os }}
13
20
  steps:
data/BSDL ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (C) 1993-2013 Yukihiro Matsumoto. All rights reserved.
2
+
3
+ Redistribution and use in source and binary forms, with or without
4
+ modification, are permitted provided that the following conditions
5
+ are met:
6
+ 1. Redistributions of source code must retain the above copyright
7
+ notice, this list of conditions and the following disclaimer.
8
+ 2. Redistributions in binary form must reproduce the above copyright
9
+ notice, this list of conditions and the following disclaimer in the
10
+ documentation and/or other materials provided with the distribution.
11
+
12
+ THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
13
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
14
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
15
+ ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
16
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
17
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
18
+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
19
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
20
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
21
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
22
+ SUCH DAMAGE.
data/COPYING ADDED
@@ -0,0 +1,56 @@
1
+ Ruby is copyrighted free software by Yukihiro Matsumoto <matz@netlab.jp>.
2
+ You can redistribute it and/or modify it under either the terms of the
3
+ 2-clause BSDL (see the file BSDL), or the conditions below:
4
+
5
+ 1. You may make and give away verbatim copies of the source form of the
6
+ software without restriction, provided that you duplicate all of the
7
+ original copyright notices and associated disclaimers.
8
+
9
+ 2. You may modify your copy of the software in any way, provided that
10
+ you do at least ONE of the following:
11
+
12
+ a. place your modifications in the Public Domain or otherwise
13
+ make them Freely Available, such as by posting said
14
+ modifications to Usenet or an equivalent medium, or by allowing
15
+ the author to include your modifications in the software.
16
+
17
+ b. use the modified software only within your corporation or
18
+ organization.
19
+
20
+ c. give non-standard binaries non-standard names, with
21
+ instructions on where to get the original software distribution.
22
+
23
+ d. make other distribution arrangements with the author.
24
+
25
+ 3. You may distribute the software in object code or binary form,
26
+ provided that you do at least ONE of the following:
27
+
28
+ a. distribute the binaries and library files of the software,
29
+ together with instructions (in the manual page or equivalent)
30
+ on where to get the original distribution.
31
+
32
+ b. accompany the distribution with the machine-readable source of
33
+ the software.
34
+
35
+ c. give non-standard binaries non-standard names, with
36
+ instructions on where to get the original software distribution.
37
+
38
+ d. make other distribution arrangements with the author.
39
+
40
+ 4. You may modify and include the part of the software into any other
41
+ software (possibly commercial). But some files in the distribution
42
+ are not written by the author, so that they are not under these terms.
43
+
44
+ For the list of those files and their copying conditions, see the
45
+ file LEGAL.
46
+
47
+ 5. The scripts and library files supplied as input to or produced as
48
+ output from the software do not automatically fall under the
49
+ copyright of the software, but belong to whomever generated them,
50
+ and may be sold commercially, and may be aggregated with this
51
+ software.
52
+
53
+ 6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
54
+ IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
55
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
56
+ PURPOSE.
data/LICENSE.txt CHANGED
@@ -1,22 +1,2 @@
1
- Copyright (C) 1993-2013 Yukihiro Matsumoto. All rights reserved.
2
-
3
- Redistribution and use in source and binary forms, with or without
4
- modification, are permitted provided that the following conditions
5
- are met:
6
- 1. Redistributions of source code must retain the above copyright
7
- notice, this list of conditions and the following disclaimer.
8
- 2. Redistributions in binary form must reproduce the above copyright
9
- notice, this list of conditions and the following disclaimer in the
10
- documentation and/or other materials provided with the distribution.
11
-
12
- THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
13
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
14
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
15
- ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
16
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
17
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
18
- OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
19
- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
20
- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
21
- OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
22
- SUCH DAMAGE.
1
+ All the files in this distribution are covered under either the Ruby license or
2
+ the BSD-2-Clause license (see the file COPYING).
data/lib/net/ftp.rb CHANGED
@@ -77,6 +77,10 @@ module Net
77
77
  # - #rename
78
78
  # - #delete
79
79
  #
80
+ # == Mainframe User Support
81
+ # - #literal
82
+ # - #quote
83
+ #
80
84
  class FTP < Protocol
81
85
  include MonitorMixin
82
86
  if defined?(OpenSSL::SSL)
@@ -85,7 +89,7 @@ module Net
85
89
  end
86
90
 
87
91
  # :stopdoc:
88
- VERSION = "0.3.4"
92
+ VERSION = "0.3.6"
89
93
  FTP_PORT = 21
90
94
  CRLF = "\r\n"
91
95
  DEFAULT_BLOCKSIZE = BufferedIO::BUFSIZE
@@ -758,7 +762,7 @@ module Net
758
762
  ensure
759
763
  conn.close if conn
760
764
  end
761
- voidresp
765
+ getresp # The response might be important when connected to a mainframe
762
766
  end
763
767
  end
764
768
  rescue Errno::EPIPE
@@ -880,13 +884,18 @@ module Net
880
884
  # in +remotefile+. If callback or an associated block is supplied, calls it,
881
885
  # passing in the transmitted data one line at a time.
882
886
  #
887
+ # Returns the response which will contain a job number if the user was communicating with a mainframe in ASCII mode
888
+ # after issuing 'quote site filetype=jes'
889
+ #
883
890
  def puttextfile(localfile, remotefile = File.basename(localfile), &block) # :yield: line
884
891
  f = File.open(localfile)
892
+ response = ''
885
893
  begin
886
- storlines("STOR #{remotefile}", f, &block)
894
+ response = storlines("STOR #{remotefile}", f, &block)
887
895
  ensure
888
896
  f.close
889
897
  end
898
+ response
890
899
  end
891
900
 
892
901
  #
@@ -1226,6 +1235,16 @@ module Net
1226
1235
  return parse257(resp)
1227
1236
  end
1228
1237
 
1238
+ #
1239
+ # The "quote" subcommand sends arguments verbatim to the remote ftp server.
1240
+ # The "literal" subcommand is an alias for "quote".
1241
+ # @param arguments Array[String] to be sent verbatim to the remote ftp server
1242
+ #
1243
+ def quote(arguments)
1244
+ sendcmd(arguments)
1245
+ end
1246
+ alias literal quote
1247
+
1229
1248
  #
1230
1249
  # Removes a remote directory.
1231
1250
  #
@@ -1343,7 +1362,7 @@ module Net
1343
1362
  end
1344
1363
 
1345
1364
  feats = []
1346
- resp.split("\n").each do |line|
1365
+ resp.each_line do |line|
1347
1366
  next if !line.start_with?(' ') # skip status lines
1348
1367
 
1349
1368
  feats << line.strip
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.3.4
4
+ version: 0.3.6
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: 2024-01-05 00:00:00.000000000 Z
11
+ date: 2024-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-protocol
@@ -46,8 +46,11 @@ extensions: []
46
46
  extra_rdoc_files: []
47
47
  files:
48
48
  - ".github/dependabot.yml"
49
+ - ".github/workflows/push_gem.yml"
49
50
  - ".github/workflows/test.yml"
50
51
  - ".gitignore"
52
+ - BSDL
53
+ - COPYING
51
54
  - Gemfile
52
55
  - LICENSE.txt
53
56
  - README.md
@@ -61,7 +64,7 @@ licenses:
61
64
  metadata:
62
65
  homepage_uri: https://github.com/ruby/net-ftp
63
66
  source_code_uri: https://github.com/ruby/net-ftp
64
- post_install_message:
67
+ post_install_message:
65
68
  rdoc_options: []
66
69
  require_paths:
67
70
  - lib
@@ -76,8 +79,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
76
79
  - !ruby/object:Gem::Version
77
80
  version: '0'
78
81
  requirements: []
79
- rubygems_version: 3.4.19
80
- signing_key:
82
+ rubygems_version: 3.5.9
83
+ signing_key:
81
84
  specification_version: 4
82
85
  summary: Support for the File Transfer Protocol.
83
86
  test_files: []