janx / chardet2

Universal Encoding Detector
GNU Lesser General Public License v2.1
23 stars 9 forks source link

Remove redefinition of `Enumberable#reduce` #6

Closed fotanus closed 11 years ago

fotanus commented 11 years ago

The code currently refines Enumerable#reduce, which is now standard on ruby 2.0.0. The redefinition is not compatible with the canonical one. Of course, this is causing problems.

For example, running a rails console:

Loading development environment (Rails 3.2.13)
2.0.0dev :001 > [].reduce({}, :merge)
 => {} 
2.0.0dev :002 > require 'UniversalDetector'
 => true 
2.0.0dev :003 > [].reduce({}, :merge)
 => :merge 

This patch remove the redefinition and change the only usage of this method to be compatible with ruby 2.0.0.

If possible, consider pushing a new version for this fix.

janx commented 11 years ago

@fotanus I bumped the version to v1.0.0 and published it on rubygems.org for easier use. I changed the gem name to chardet2 because I have no control to the unmaintained chardet gem. I put you and Hui in authors :smile:

Thanks!

fotanus commented 11 years ago

Great, thank you!