Permalink
Browse files

the CharDet module should not be included

  • Loading branch information...
1 parent cdbfd0d commit c6a152c6f14031bcdbaff3313a1bdcd2177cb488 @jmhodges committed Aug 22, 2008
Showing with 13 additions and 8 deletions.
  1. +13 −8 lib/rchardet.rb
View
@@ -14,6 +14,9 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA
######################### END LICENSE BLOCK #########################
+
+$LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__))
+
require 'rchardet/charsetprober'
require 'rchardet/mbcharsetprober'
@@ -51,11 +54,13 @@
require 'rchardet/sjisprober'
require 'rchardet/universaldetector'
require 'rchardet/utf8prober'
-include CharDet
-def CharDet.detect(aBuf)
- u = UniversalDetector.new
- u.reset
- u.feed(aBuf)
- u.close
- return u.result
-end
+
+module CharDet
+ def CharDet.detect(aBuf)
+ u = UniversalDetector.new
+ u.reset
+ u.feed(aBuf)
+ u.close
+ u.result
+ end
+end

0 comments on commit c6a152c

Please sign in to comment.