Skip to content

encoding parameter for Dir.open, Dir.new #3205 #4495#5915

Merged
headius merged 2 commits intojruby:masterfrom
MariuszCwikla:dir-open
Oct 27, 2019
Merged

encoding parameter for Dir.open, Dir.new #3205 #4495#5915
headius merged 2 commits intojruby:masterfrom
MariuszCwikla:dir-open

Conversation

@MariuszCwikla
Copy link
Contributor

Fixes #4495 and partial fix for #3205

@MariuszCwikla
Copy link
Contributor Author

In f5b78ad I've added fix for foreach and more tests

@kares
Copy link
Member

kares commented Oct 24, 2019

looking good, still could we maybe have : Dir.mkdir("./testDir_1") in a test setup
and also do a test teardown part to cleanup all of the created dir's content and remove it.

@kares kares added this to the JRuby 9.2.9.0 milestone Oct 24, 2019
@MariuszCwikla
Copy link
Contributor Author

@kares thanks for hints. Normally I would do like you suggested, but teardown already performs cleanup this in it's own "interesting" ;) way:

  • setup deletes testDir_1 up to testDir_5
  • teardown calls setup ;)

Do you agree to do more refactoring (including setup/teardown and other existing tests not related to my change?)

@kares
Copy link
Member

kares commented Oct 25, 2019

@MariuszCwikla oh I did not check, in that case all 👍 from me

@headius
Copy link
Member

headius commented Oct 27, 2019

The modified open and initialize could be split into one- and two-argument versions, which will usually avoid the args[] boxing, but it's a minor item. I'll make the fix quickly on master since we'd like this in 9.2.9.

@headius
Copy link
Member

headius commented Oct 27, 2019

I notice that one particular piece of logic seems to be lost: in foreach, if an Encoding was passed in instead of an options hash, it would be used without trying to dig it out of options.

Was that behavior in error? It appears to have been there since 1.9.

I will commit a change to remove the [] bits, but we do need confirmation about that logic.

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.

Dir.open missing optional second keyword argument

3 participants