Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quote and Literal subcommands are implemented #34

Merged
merged 3 commits into from
Jun 1, 2024
Merged

Conversation

mslinn
Copy link
Contributor

@mslinn mslinn commented May 2, 2024

Fixes #33

@mslinn
Copy link
Contributor Author

mslinn commented May 3, 2024

The modifications in the pull request have been tested against an IBM z/OS Communications Server. The following code fragment uses FTP to submit a batch job to the mainframe, and collects the results.

def parse_job_number_from(line)
  tokens = line.split('JOB')
  raise StandardError, "Error: The string 'JOB' was not found in the FTP response." unless tokens.length == 2

  job_number = tokens[1].split.first
  job_number.sub(/^0+/, '') # Remove leading zeros
end
    
Net::FTP.open(@ip_or_domain) do |ftp|
  ftp.login @uid, @pwd
  ftp.quote 'site filetype=jes'
  job_info = ftp.puttextfile @local_jcl_filepath
  job_number = parse_job_number_from job_info
  ftp.gettextfile "J#{job_number}", @local_results_file
end

@shugo shugo merged commit d7e97c2 into ruby:master Jun 1, 2024
15 checks passed
@shugo
Copy link
Member

shugo commented Jun 1, 2024

It looks good. Thank you!

headius added a commit to headius/jruby that referenced this pull request Jun 27, 2024
net-ftp 0.3.6+ returns the response from `put` and `puttextfile`.

See ruby/net-ftp#34
@mslinn
Copy link
Contributor Author

mslinn commented Jun 28, 2024

The version of the net-ftp Ruby gem containing this PR was tagged as v0.3.6. Looks like v0.3.6 was not released and there were no change notes. There was no mention of this pull request in v0.3.7 either, although the code from this PR is there. Seems like the credit for my contribution fell through the cracks. Might it be possible to fix that somehow?

@shugo
Copy link
Member

shugo commented Jun 28, 2024

@mslinn
It seems that v0.3.6 release was left as draft.
I've just published it: https://github.com/ruby/net-ftp/releases/tag/v0.3.6

@mslinn
Copy link
Contributor Author

mslinn commented Jun 28, 2024

@shugo Many thanks!

andrykonchin pushed a commit to ruby/spec that referenced this pull request Jul 1, 2024
net-ftp 0.3.6+ returns the response from `put` and `puttextfile`.

See ruby/net-ftp#34
@mslinn
Copy link
Contributor Author

mslinn commented Oct 9, 2024

I noticed that the sample code I showed above from May 3 does not appear in the documentation. How might that be accomplished?

@shugo
Copy link
Member

shugo commented Oct 10, 2024

I noticed that the sample code I showed above from May 3 does not appear in the documentation. How might that be accomplished?

What do you mean by the words "the sample code I showed above from May 3"?
It seems that documentation returned by ri and gem server contains description in your patch, but I couldn't find "sample code" in your patch.

$ ri Net::FTP#quote
= Net::FTP#quote

(from gem net-ftp-0.3.8)
=== Implementation from FTP
------------------------------------------------------------------------
  quote(arguments)

------------------------------------------------------------------------

The "quote" subcommand sends arguments verbatim to the remote ftp
server. The "literal" subcommand is an alias for "quote". @param
arguments Array[String] to be sent verbatim to the remote ftp server

@mslinn
Copy link
Contributor Author

mslinn commented Oct 10, 2024

Here is the documentation again:

The modifications in the pull request have been tested against an IBM z/OS Communications Server. The following code fragment uses FTP to submit a batch job to the mainframe, and collects the results.

def parse_job_number_from(line)
  tokens = line.split('JOB')
  raise StandardError, "Error: The string 'JOB' was not found in the FTP response." unless tokens.length == 2

  job_number = tokens[1].split.first
  job_number.sub(/^0+/, '') # Remove leading zeros
end
    
Net::FTP.open(@ip_or_domain) do |ftp|
  ftp.login @uid, @pwd
  ftp.quote 'site filetype=jes'
  job_info = ftp.puttextfile @local_jcl_filepath
  job_number = parse_job_number_from job_info
  ftp.gettextfile "J#{job_number}", @local_results_file
end

headius pushed a commit to headius/spec that referenced this pull request Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Implement the 'literal' or 'quote' subcommands
2 participants