-
-
Notifications
You must be signed in to change notification settings - Fork 942
Closed
Milestone
Description
Ruby 2.2.2:
Dir.new("/var/empty", encoding: Encoding.find("filesystem")).to_a # => [".", ".."]
Dir.open("/var/empty", encoding: Encoding.find("filesystem")).to_a # => [".", ".."]
Dir.foreach("/var/empty", encoding: Encoding.find("filesystem")).to_a # => [".", ".."]
JRuby 9.0.0.0 yields, respectively:
ArgumentError: wrong number of arguments calling `initialize` (2 for 1)
ArgumentError: wrong number of arguments calling `open` (2 for 1)
TypeError: wrong argument type Hash (expected Encoding)
The following works in JRuby:
Dir.foreach("/var/empty", Encoding.find("filesystem")).to_a # => [".", ".."]
Dir.new("/var/empty").each(Encoding.find("filesystem")).to_a # => [".", ".."]
But in Ruby 2.2.2 these raise:
ArgumentError: wrong number of arguments (2 for 1)
ArgumentError: wrong number of arguments (1 for 0)
It would seem the resolution to #2547 in 26ed114 is incorrect.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels