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

Removed definition of Array#all? from core_ext.rb #33

Merged
merged 1 commit into from
Dec 12, 2011
Merged

Removed definition of Array#all? from core_ext.rb #33

merged 1 commit into from
Dec 12, 2011

Conversation

ronen
Copy link
Contributor

@ronen ronen commented Dec 11, 2011

I don't know why core_ext defines Array#all? since Enumerable#all? does the same thing (in MRI 1.8.7 and 1.9.3)

Except that this extension doesn't support the behaviour that "If the block is not given, Ruby adds an implicit block of {|obj| obj} (that is all? will return true only if none of the collection members are false or nil.)" http://www.ruby-doc.org/core-1.9.3/Enumerable.html#method-i-all-3F

So with this definition, including ruby-graphviz breaks any existing code that calls an_array.all? without a block. (Not hypothetical -- I updated my project to the latest version of ruby-graphviz and my project broke!)

And without this local extension, the tests seem to pass anyway (again, in MRI 1.8.7 and 1.9.3).

I don't know why core_ext defines Array#all? since Enumerable#all? does the same thing (in MRI 1.8.7 and 1.9.3)

Except that this extension doesn't support the behaviour that "If the block is not given, Ruby adds an implicit block of {|obj| obj} (that is all? will return true only if none of the collection members are false or nil.)" http://www.ruby-doc.org/core-1.9.3/Enumerable.html#method-i-all-3F 

So with this definition, including ruby-graphviz breaks any existing code that calls an_array.all? without a block.

And without this local extension, the tests seem to pass anyway (again, in MRI 1.8.7 and 1.9.3).
glejeune added a commit that referenced this pull request Dec 12, 2011
Removed definition of Array#all? from core_ext.rb
@glejeune glejeune merged commit ebfd840 into glejeune:master Dec 12, 2011
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