net-ftp 0.3.5 → 0.3.7

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: fc210c3f3c6a2f8cd50bd5704277d2590898711478f4a1cea342933889fb5a7d
4
- data.tar.gz: 5a8d1524c1c9462c5dcd36f8352ab12d04262422c6663c513c7a44c5b97619b4
3
+ metadata.gz: c8659ce2bc51a97837fbb5090015c4e137845744cf2fcb676dffb347cbf7522b
4
+ data.tar.gz: ce205d52a5e6aa63b17453fa0ba5f1a2a7ef8cea65d90b5f2669ff99560cf432
5
5
  SHA512:
6
- metadata.gz: 48e21c370c1b2f4f92c153bcf47765862658f866ec2995ba17fa042ad7ebbfb7213c1ea825f11c434078a8cab0fc15c5a5d77f19f314a2ed2040c9a104c73397
7
- data.tar.gz: cdfc5632c8f9736ab9f597d0a3f7b9e02277edc96e338ef8a0f514210a1fec8363868f0fa35e8d3aaacf15427e29d8e8c593d8851175743026048ebeea16cbda
6
+ metadata.gz: ef464a215293288224cf7209f1209f32f5cc0e62b98d6a11b13e6f76c1b1d7a66aca5ed0a2da7b86b81108bc2696870c9aa33ac0ee9e69eeb9701adc02583fe2
7
+ data.tar.gz: d2d60b116f1b2bf9b8ecfd7003701fd5df7285be006256b4705b6974cdd4f8998f73c4f35840f98dcf7097a418b8b1f82573bc82159ac137dc691b5077900d54
@@ -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@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
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/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.5"
92
+ VERSION = "0.3.7"
89
93
  FTP_PORT = 21
90
94
  CRLF = "\r\n"
91
95
  DEFAULT_BLOCKSIZE = BufferedIO::BUFSIZE
@@ -245,10 +249,15 @@ module Net
245
249
  if defined?(VerifyCallbackProc)
246
250
  @ssl_context.verify_callback = VerifyCallbackProc
247
251
  end
248
- @ssl_context.session_cache_mode =
249
- OpenSSL::SSL::SSLContext::SESSION_CACHE_CLIENT |
250
- OpenSSL::SSL::SSLContext::SESSION_CACHE_NO_INTERNAL_STORE
251
- @ssl_context.session_new_cb = proc {|sock, sess| @ssl_session = sess }
252
+
253
+ # jruby-openssl does not support session caching
254
+ unless RUBY_ENGINE == "jruby"
255
+ @ssl_context.session_cache_mode =
256
+ OpenSSL::SSL::SSLContext::SESSION_CACHE_CLIENT |
257
+ OpenSSL::SSL::SSLContext::SESSION_CACHE_NO_INTERNAL_STORE
258
+ @ssl_context.session_new_cb = proc {|sock, sess| @ssl_session = sess }
259
+ end
260
+
252
261
  @ssl_session = nil
253
262
  if options[:private_data_connection].nil?
254
263
  @private_data_connection = true
@@ -758,7 +767,7 @@ module Net
758
767
  ensure
759
768
  conn.close if conn
760
769
  end
761
- voidresp
770
+ getresp # The response might be important when connected to a mainframe
762
771
  end
763
772
  end
764
773
  rescue Errno::EPIPE
@@ -880,13 +889,18 @@ module Net
880
889
  # in +remotefile+. If callback or an associated block is supplied, calls it,
881
890
  # passing in the transmitted data one line at a time.
882
891
  #
892
+ # Returns the response which will contain a job number if the user was communicating with a mainframe in ASCII mode
893
+ # after issuing 'quote site filetype=jes'
894
+ #
883
895
  def puttextfile(localfile, remotefile = File.basename(localfile), &block) # :yield: line
884
896
  f = File.open(localfile)
897
+ response = ''
885
898
  begin
886
- storlines("STOR #{remotefile}", f, &block)
899
+ response = storlines("STOR #{remotefile}", f, &block)
887
900
  ensure
888
901
  f.close
889
902
  end
903
+ response
890
904
  end
891
905
 
892
906
  #
@@ -1226,6 +1240,16 @@ module Net
1226
1240
  return parse257(resp)
1227
1241
  end
1228
1242
 
1243
+ #
1244
+ # The "quote" subcommand sends arguments verbatim to the remote ftp server.
1245
+ # The "literal" subcommand is an alias for "quote".
1246
+ # @param arguments Array[String] to be sent verbatim to the remote ftp server
1247
+ #
1248
+ def quote(arguments)
1249
+ sendcmd(arguments)
1250
+ end
1251
+ alias literal quote
1252
+
1229
1253
  #
1230
1254
  # Removes a remote directory.
1231
1255
  #
@@ -1343,7 +1367,7 @@ module Net
1343
1367
  end
1344
1368
 
1345
1369
  feats = []
1346
- resp.split("\n").each do |line|
1370
+ resp.each_line do |line|
1347
1371
  next if !line.start_with?(' ') # skip status lines
1348
1372
 
1349
1373
  feats << line.strip
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: net-ftp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shugo Maeda
8
+ autorequire:
8
9
  bindir: bin
9
10
  cert_chain: []
10
- date: 2024-06-01 00:00:00.000000000 Z
11
+ date: 2024-06-26 00:00:00.000000000 Z
11
12
  dependencies:
12
13
  - !ruby/object:Gem::Dependency
13
14
  name: net-protocol
@@ -45,6 +46,7 @@ extensions: []
45
46
  extra_rdoc_files: []
46
47
  files:
47
48
  - ".github/dependabot.yml"
49
+ - ".github/workflows/push_gem.yml"
48
50
  - ".github/workflows/test.yml"
49
51
  - ".gitignore"
50
52
  - BSDL
@@ -62,6 +64,7 @@ licenses:
62
64
  metadata:
63
65
  homepage_uri: https://github.com/ruby/net-ftp
64
66
  source_code_uri: https://github.com/ruby/net-ftp
67
+ post_install_message:
65
68
  rdoc_options: []
66
69
  require_paths:
67
70
  - lib
@@ -76,7 +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.6.0.dev
82
+ rubygems_version: 3.5.9
83
+ signing_key:
80
84
  specification_version: 4
81
85
  summary: Support for the File Transfer Protocol.
82
86
  test_files: []