Skip to content

Net::FTP support pathnames #828

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

Closed
wants to merge 3 commits into from

Conversation

jrafanie
Copy link
Contributor

@jrafanie jrafanie commented Feb 9, 2015

Pathname support was added to Net::FTP list and getbinaryfile methods by @shugo in 613a324.

This pull request fixes the following error when calling String#+ with a Pathname:
TypeError: no implicit conversion of Pathname into String

Found in the following Net::FTP instance methods:
chdir
delete
gettextfile
mdtm
mkdir
nlst
putbinaryfile
puttextfile
rename
rmdir
size

Note, this pull request normalizes the changes from 613a324 so each of these methods support Pathnames in the same way, via String interpolation (see the second commit). It's my opinion this is more readable and seems to creates less String objects.

The third commit adds commented tests that I used to recreate the TypeError but don't actually test the methods correctly. I can either do correct tests with someone's help (nlst with returning filelists was not easy to test), remove the commented tests, or leave them commented.

I wasn't sure if I should add a ChangeLog entry or if someone on ruby-core is supposed to do that.

Please advise.

Thanks in advance for your review!

cc @tenderlove

Pathname support was added to list and getbinaryfile in 613a324.

Fixes the following error when calling String#+ with a Pathname:
  TypeError: no implicit conversion of Pathname into String

Found in the following Net::FTP instance methods:
chdir
delete
gettextfile
mdtm
mkdir
nlst
putbinaryfile
puttextfile
rename
rmdir
size
Pathname support was added to list and getbinaryfile in 613a324.

This commit normalizes these two methods to follow the pattern in the prior commit.
I believe the interpolation form is more readable and creates less String objects.
@jrafanie jrafanie force-pushed the net_ftp_support_pathnames branch from fe419b2 to b0d0952 Compare February 9, 2015 15:55
@jrafanie
Copy link
Contributor Author

jrafanie commented Feb 9, 2015

I'm not quite sure why the CI tests are failing. I tried amending and force-pushing but a different test failed.

@zzak
Copy link
Member

zzak commented Feb 9, 2015

LGTM

@shugo shugo closed this in cd29e5f Feb 10, 2015
@jrafanie
Copy link
Contributor Author

Thank you @zzak and @shugo !!! 😄

@jrafanie jrafanie deleted the net_ftp_support_pathnames branch February 10, 2015 16:22
mmasaki pushed a commit to mmasaki/ruby that referenced this pull request May 30, 2015
  putbinaryfile, puttextfile, rename, rmdir, size): support
  Pathname. Patch by Joe Rafaniello. [fix rubyGH-828]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
matzbot pushed a commit that referenced this pull request Sep 3, 2021
Also flattens `@options.template_stylesheets` when parsing the
command lines.

Fixes #205
Fixes #828 too

ruby/rdoc@857002a763
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants