debian/0000755000000000000000000000000011772421760007175 5ustar debian/control0000644000000000000000000000154011772404232010573 0ustar Source: ruby-rchardet Section: ruby Priority: optional Maintainer: Debian Ruby Extras Maintainers Uploaders: Ondřej Surý , Paul van Tilburg DM-Upload-Allowed: yes Build-Depends: debhelper (>= 7.0.50~), gem2deb (>= 0.3.0~) Standards-Version: 3.9.3 Vcs-Git: git://git.debian.org/pkg-ruby-extras/ruby-rchardet.git Vcs-Browser: http://git.debian.org/?p=pkg-ruby-extras/ruby-rchardet.git;a=summary Homepage: http://github.com/jmhodges/rchardet/tree/master XS-Ruby-Versions: all Package: ruby-rchardet Architecture: all XB-Ruby-Versions: ${ruby:Versions} Depends: ${shlibs:Depends}, ${misc:Depends}, ruby | ruby-interpreter Description: Character encoding auto-detection for Ruby CharDet is a library to automatically detect character encoding 'as smart as your browser'. debian/changelog0000644000000000000000000000161111772421760011046 0ustar ruby-rchardet (1.3-3) unstable; urgency=low * debian/control: - Bump build dependency on gem2deb to >= 0.3.0~. - Bump standars version to 3.9.3. * debian/copyright: added missing license text for GPL-2+. * debian/patches: added DEP-3 headers to remove-syntax-errors-for-ruby1.9.patch. -- Paul van Tilburg Tue, 26 Jun 2012 23:04:45 +0200 ruby-rchardet (1.3-2) unstable; urgency=low * debian/patches/*: added patch remote-syntax-errors-for-ruby1.9 to ensure that the lib also works for Ruby1.9 (closes: #643770); patch courtesy of Bram Senders . * debian/rules: added myself to the uploaders. -- Paul van Tilburg Tue, 08 Nov 2011 21:23:18 +0100 ruby-rchardet (1.3-1) unstable; urgency=low * Initial release (Closes: #628139) -- Ondřej Surý Fri, 27 May 2011 16:58:22 +0200 debian/source/0000755000000000000000000000000011712612475010474 5ustar debian/source/format0000644000000000000000000000001411712612475011702 0ustar 3.0 (quilt) debian/ruby-rchardet.docs0000644000000000000000000000004011712612475012613 0ustar # FIXME: READMEs found # README debian/watch0000644000000000000000000000014511712612475010225 0ustar version=3 http://pkg-ruby-extras.alioth.debian.org/cgi-bin/gemwatch/rchardet .*/rchardet-(.*).tar.gz debian/copyright0000644000000000000000000000316111772404510011123 0ustar Format: http://anonscm.debian.org/viewvc/dep/web/deps/dep5.mdwn?revision=173 Upstream-Name: rchardet Upstream-Contact: Jeff Hodges Source: https://github.com/jmhodges/rchardet/tree/master/lib/rchardet Files: * Copyright: Copyright 2009 Jeff Hodges License: LGPL-2.1+ This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. . This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. . You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA . On Debian systems, the full text of the GNU Lesser General Public License version 2.1 can be found in the file `/usr/share/common-licenses/LGPL-2.1'. Files: debian/* Copyright: Copyright 2011 Ondřej Surý License: GPL-2+ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License, or (at your opinion) any later version. . On Debian systems, the full text of the GNU General Public License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'. debian/rules0000755000000000000000000000070011712612475010251 0ustar #!/usr/bin/make -f #export DH_VERBOSE=1 # # Uncomment to ignore all test failures (but the tests will run anyway) export DH_RUBY_IGNORE_TESTS=all # # Uncomment to ignore some test failures (but the tests will run anyway). # Valid values: #export DH_RUBY_IGNORE_TESTS=ruby1.8 ruby1.9.1 require-rubygems # # If you need to specify the .gemspec (eg there is more than one) #export DH_RUBY_GEMSPEC=gem.gemspec %: dh $@ --buildsystem=ruby --with ruby debian/compat0000644000000000000000000000000211712612475010372 0ustar 7 debian/patches/0000755000000000000000000000000011712612475010623 5ustar debian/patches/remove-syntax-errors-for-ruby1.9.patch0000644000000000000000000001421611772405006017772 0ustar Description: Removes syntax errors from the source that are relevent for usages with Ruby 1.9.1. Author: Paul van Tilburg Last-Update: 2011-11-08 Index: ruby-rchardet/lib/rchardet/chardistribution.rb =================================================================== --- ruby-rchardet.orig/lib/rchardet/chardistribution.rb 2011-10-31 16:20:34.000000000 +0100 +++ ruby-rchardet/lib/rchardet/chardistribution.rb 2011-11-08 21:16:24.000000000 +0100 @@ -57,8 +57,8 @@ if order >= 0 @_mTotalChars += 1 # order is valid - if order < @_mTableSize: - if 512 > @_mCharToFreqOrder[order]: + if order < @_mTableSize + if 512 > @_mCharToFreqOrder[order] @_mFreqChars += 1 end end @@ -72,7 +72,7 @@ return SURE_NO end - if @_mTotalChars != @_mFreqChars: + if @_mTotalChars != @_mFreqChars r = @_mFreqChars / ((@_mTotalChars - @_mFreqChars) * @_mTypicalDistributionRatio) if r < SURE_YES return r @@ -227,7 +227,7 @@ # first byte range: 0xa0 -- 0xfe # second byte range: 0xa1 -- 0xfe # no validation needed here. State machine has done that - if aStr[0..0] >= "\xA0": + if aStr[0..0] >= "\xA0" return 94 * (aStr[0] - 0xA1) + aStr[1] - 0xa1 else return -1 Index: ruby-rchardet/lib/rchardet/charsetgroupprober.rb =================================================================== --- ruby-rchardet.orig/lib/rchardet/charsetgroupprober.rb 2011-10-31 16:20:34.000000000 +0100 +++ ruby-rchardet/lib/rchardet/charsetgroupprober.rb 2011-11-08 21:16:44.000000000 +0100 @@ -40,7 +40,7 @@ super @_mActiveNum = 0 - for prober in @_mProbers: + for prober in @_mProbers if prober prober.reset() prober.active = true Index: ruby-rchardet/lib/rchardet/escprober.rb =================================================================== --- ruby-rchardet.orig/lib/rchardet/escprober.rb 2011-10-31 16:20:34.000000000 +0100 +++ ruby-rchardet/lib/rchardet/escprober.rb 2011-11-08 21:16:56.000000000 +0100 @@ -41,7 +41,7 @@ def reset super() - for codingSM in @_mCodingSM: + for codingSM in @_mCodingSM next if not codingSM codingSM.active = true codingSM.reset() Index: ruby-rchardet/lib/rchardet/eucjpprober.rb =================================================================== --- ruby-rchardet.orig/lib/rchardet/eucjpprober.rb 2011-10-31 16:20:34.000000000 +0100 +++ ruby-rchardet/lib/rchardet/eucjpprober.rb 2011-11-08 21:17:10.000000000 +0100 @@ -56,7 +56,7 @@ elsif codingState == EItsMe @_mState = EFoundIt break - elsif codingState == EStart: + elsif codingState == EStart charLen = @_mCodingSM.get_current_charlen() if i == 0 @_mLastChar[1] = aBuf[0..0] Index: ruby-rchardet/lib/rchardet/jpcntx.rb =================================================================== --- ruby-rchardet.orig/lib/rchardet/jpcntx.rb 2011-10-31 16:20:34.000000000 +0100 +++ ruby-rchardet/lib/rchardet/jpcntx.rb 2011-11-08 21:17:30.000000000 +0100 @@ -150,9 +150,9 @@ @_mNeedToSkipCharNum = i - aLen @_mLastCharOrder = -1 else - if (order != -1) and (@_mLastCharOrder != -1): + if (order != -1) and (@_mLastCharOrder != -1) @_mTotalRel += 1 - if @_mTotalRel > MAX_REL_THRESHOLD: + if @_mTotalRel > MAX_REL_THRESHOLD @_mDone = true break end @@ -169,7 +169,7 @@ def get_confidence # This is just one way to calculate confidence. It works well for me. - if @_mTotalRel > MINIMUM_DATA_THRESHOLD: + if @_mTotalRel > MINIMUM_DATA_THRESHOLD return (@_mTotalRel - @_mRelSample[0]) / @_mTotalRel else return DONT_KNOW @@ -208,7 +208,7 @@ return -1, 1 unless aStr # find out current char's byte length aStr = aStr[0..1].join if aStr.class == Array - if (aStr[0..0] == "\x8E") or ((aStr[0..0] >= "\xA1") and (aStr[0..0] <= "\xFE")): + if (aStr[0..0] == "\x8E") or ((aStr[0..0] >= "\xA1") and (aStr[0..0] <= "\xFE")) charLen = 2 elsif aStr[0..0] == "\x8F" charLen = 3 Index: ruby-rchardet/lib/rchardet/sjisprober.rb =================================================================== --- ruby-rchardet.orig/lib/rchardet/sjisprober.rb 2011-10-31 16:20:34.000000000 +0100 +++ ruby-rchardet/lib/rchardet/sjisprober.rb 2011-11-08 21:17:45.000000000 +0100 @@ -71,7 +71,7 @@ @_mLastChar[0] = aBuf[aLen - 1.. aLen-1] - if get_state() == EDetecting: + if get_state() == EDetecting if @_mContextAnalyzer.got_enough_data() and (get_confidence() > SHORTCUT_THRESHOLD) @_mState = EFoundIt end Index: ruby-rchardet/lib/rchardet/universaldetector.rb =================================================================== --- ruby-rchardet.orig/lib/rchardet/universaldetector.rb 2011-10-31 16:20:34.000000000 +0100 +++ ruby-rchardet/lib/rchardet/universaldetector.rb 2011-11-08 21:18:00.000000000 +0100 @@ -91,11 +91,11 @@ end @_mGotData = true - if @result['encoding'] and (@result['confidence'] > 0.0): + if @result['encoding'] and (@result['confidence'] > 0.0) @done = true return end - if @_mInputState == EPureAscii: + if @_mInputState == EPureAscii if @_highBitDetector =~ (aBuf) @_mInputState = EHighbyte elsif (@_mInputState == EPureAscii) and @_escDetector =~ (@_mLastChar + aBuf) @@ -138,12 +138,12 @@ end @done = true - if @_mInputState == EPureAscii: + if @_mInputState == EPureAscii @result = {'encoding' => 'ascii', 'confidence' => 1.0} return @result end - if @_mInputState == EHighbyte: + if @_mInputState == EHighbyte confidences = {} @_mCharSetProbers.each{ |prober| confidences[prober] = prober.get_confidence } maxProber = @_mCharSetProbers.max{ |a,b| confidences[a] <=> confidences[b] } Index: ruby-rchardet/lib/rchardet/utf8prober.rb =================================================================== --- ruby-rchardet.orig/lib/rchardet/utf8prober.rb 2011-10-31 16:20:34.000000000 +0100 +++ ruby-rchardet/lib/rchardet/utf8prober.rb 2011-11-08 21:18:13.000000000 +0100 @@ -63,7 +63,7 @@ end end - if get_state() == EDetecting: + if get_state() == EDetecting if get_confidence() > SHORTCUT_THRESHOLD @_mState = EFoundIt end debian/patches/series0000644000000000000000000000004711712612475012041 0ustar remove-syntax-errors-for-ruby1.9.patch