Skip to content

Remove FileList#is_a? and FileList#kind_of? overrides - #788

Open
tenderlove wants to merge 1 commit into
ruby:masterfrom
tenderlove:remove-isa
Open

tenderlove wants to merge 1 commit into
ruby:masterfrom
tenderlove:remove-isa

Conversation

@tenderlove

Copy link
Copy Markdown
Member

FileList#is_a? (and its alias #kind_of?) was added in commit 0c5500a (Rake 0.7.3, April 2007) so that FileList would claim to be an Array for compatibility with Ruby 1.8's FileUtils module, which checked src.is_a?(Array) in fu_each_src_dest0.

Since Ruby 1.9, FileUtils uses Array.try_convert(src) and [arg].flatten, both of which rely on FileList#to_ary rather than is_a?(Array). Because FileList implements #to_ary and #to_a, overriding #is_a? to lie about its class hierarchy is no longer needed.

FileList#is_a? (and its alias #kind_of?) was added in commit 0c5500a
(Rake 0.7.3, April 2007) so that FileList would claim to be an Array for
compatibility with Ruby 1.8's FileUtils module, which checked
`src.is_a?(Array)` in `fu_each_src_dest0`.

Since Ruby 1.9, FileUtils uses `Array.try_convert(src)` and `[arg].flatten`,
both of which rely on `FileList#to_ary` rather than `is_a?(Array)`.
Because FileList implements `#to_ary` and `#to_a`, overriding `#is_a?` to
lie about its class hierarchy is no longer needed.

This branch has not been deployed

No deployments
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.

1 participant