Package: raspell Followup-For: Bug #675114 Dear Maintainer,
I updated the package to include the 1.3 upstream release and make it comply to the Ruby policy. Please find attached the full debdiff. I imported the package in the Ruby team Git repo. git://anonscm.debian.org/pkg-ruby-extras/raspell.git Now you are a member of this team, you can commit directly there. I upload the package to DELAYED/10. Please tell me if you want me to cancel this upload. Cheers, Cédric
diff -Nru raspell-1.2/CHANGELOG raspell-1.3/CHANGELOG --- raspell-1.2/CHANGELOG 2011-03-03 01:17:00.000000000 +0100 +++ raspell-1.3/CHANGELOG 2013-12-25 22:29:02.000000000 +0100 @@ -1,3 +1,6 @@ +v1.3. Enforce argument types better (raskhadafi). + +v1.2.2. Support for some changes from Ruby 1.9.1 to 1.9.2 (dmarkow). v1.2. Ruby 1.9 compatibility (ph7). Les fichiers binaires /tmp/zvDjffTknK/raspell-1.2/data.tar.gz.sig et /tmp/8BDQkEF0sr/raspell-1.3/data.tar.gz.sig sont différents diff -Nru raspell-1.2/debian/changelog raspell-1.3/debian/changelog --- raspell-1.2/debian/changelog 2012-06-18 01:05:47.000000000 +0200 +++ raspell-1.3/debian/changelog 2014-01-15 15:37:15.000000000 +0100 @@ -1,3 +1,20 @@ +raspell (1.3-1) unstable; urgency=medium + + * Adption of the package by the Ruby Extras Maintainers team + * New upstream version 1.3 + * Improve description (Closes: #624242) + * Transition to the new Ruby policy (Closes: #675114, #722374) + * Make libraspell-ruby* transitional packages and provide a raspell + binary package + * Build-Depend on aspell-en and Recommends aspell-dictionary + * Add patches to fix format-security issues and add an explicit + dictionary for tests + * debian/copyright: use copyright-format-1.0 + * Add lintian-overrides about duplicated descriptions of transitional + packages + + -- Cédric Boutillier <[email protected]> Wed, 15 Jan 2014 14:01:19 +0100 + raspell (1.2-2) unstable; urgency=low * Fix "FTBFS: ext/raspell.c:76:9: error: format not a string literal diff -Nru raspell-1.2/debian/clean raspell-1.3/debian/clean --- raspell-1.2/debian/clean 2012-05-30 00:59:21.000000000 +0200 +++ raspell-1.3/debian/clean 1970-01-01 01:00:00.000000000 +0100 @@ -1,5 +0,0 @@ -Makefile - -mkmf.log -raspell.o -raspell.so diff -Nru raspell-1.2/debian/control raspell-1.3/debian/control --- raspell-1.2/debian/control 2012-05-30 00:59:21.000000000 +0200 +++ raspell-1.3/debian/control 2014-01-15 15:28:13.000000000 +0100 @@ -1,27 +1,52 @@ Source: raspell Section: ruby -Priority: extra -Maintainer: Alex Pennace <[email protected]> -Build-Depends: debhelper (>= 7.0.50~), ruby-pkg-tools, cdbs, - ruby1.8, ruby1.8-dev, ruby1.9.1, ruby1.9.1-dev, libaspell-dev -Standards-Version: 3.8.4 -Homepage: https://github.com/fauna/raspell +Priority: optional +Maintainer: Debian Ruby Extras Maintainers <[email protected]> +Uploaders: Alex Pennace <[email protected]>, Cédric Boutillier <[email protected]> +Build-Depends: debhelper (>= 7.0.50~), gem2deb (>= 0.6.1~), libaspell-dev (>= 0.6~), aspell-en +Standards-Version: 3.9.5 +Vcs-Git: git://anonscm.debian.org/pkg-ruby-extras/raspell.git +Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-ruby-extras/raspell.git;a=summary +Homepage: https://github.com/evan/raspell/ +XS-Ruby-Versions: all + +Package: raspell +Architecture: any +XB-Ruby-Versions: ${ruby:Versions} +Depends: ${shlibs:Depends}, ${misc:Depends}, ruby | ruby-interpreter +Replaces: libraspell-ruby (<< 1.3-1~), libraspell-ruby1.8 (<< 1.3-1~), libraspell-ruby1.9.1 (<< 1.3-1~) +Breaks: libraspell-ruby (<< 1.3-1~), libraspell-ruby1.8 (<< 1.3-1~), libraspell-ruby1.9.1 (<< 1.3-1~) +Provides: libraspell-ruby, libraspell-ruby1.8, libraspell-ruby1.9.1 +Recommends: aspell-dictionary +Description: interface binding for the Aspell spelling checker + raspell is an interface binding for the Aspell spelling checker written in + Ruby. It allows one to use the Aspell spelling checker from Ruby source code. +# Transitional packages Package: libraspell-ruby +Section: oldlibs +Priority: extra Architecture: all -Depends: ${shlibs:Depends}, ${misc:Depends} -Description: An interface binding for the Aspell spelling checker. - This is a dummy package to install Raspell for the default version - of Ruby. +Depends: ${misc:Depends}, raspell +Description: Transitional package for raspell + This is a transitional package to ease upgrades to the raspell + package. It can safely be removed. Package: libraspell-ruby1.8 -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} -Description: An interface binding for the Aspell spelling checker. - This package is for ruby1.8. +Section: oldlibs +Priority: extra +Architecture: all +Depends: ${misc:Depends}, raspell +Description: Transitional package for raspell + This is a transitional package to ease upgrades to the raspell + package. It can safely be removed. + +Package: libraspell-ruby1.9.1 +Section: oldlibs +Priority: extra +Architecture: all +Depends: ${misc:Depends}, raspell +Description: Transitional package for raspell + This is a transitional package to ease upgrades to the raspell + package. It can safely be removed. -Package: libraspell-ruby1.9.1 -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} -Description: An interface binding for the Aspell spelling checker. - This package is for ruby1.8. diff -Nru raspell-1.2/debian/copyright raspell-1.3/debian/copyright --- raspell-1.2/debian/copyright 2012-05-30 00:59:21.000000000 +0200 +++ raspell-1.3/debian/copyright 2014-01-15 15:32:47.000000000 +0100 @@ -1,42 +1,35 @@ -This work was packaged for Debian by: - - Alex Pennace <[email protected]> on Wed, 02 Mar 2011 20:51:22 -0500 - -It was downloaded from: - - http://rubygems.org/downloads/raspell-1.2.gem - -Upstream Author(s): - - Evan Weaver <[email protected]> - -Copyright: - - Copyright (C) 2011 Evan Weaver - -License: - - This package 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; either version 2 of the License, or - (at your option) any later version. - - This package 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 General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/> - -On Debian systems, the complete text of the GNU General -Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". - -The Debian packaging is: - - Copyright (C) 2011 Alex Pennace <[email protected]> - -you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: raspell +Source: https://github.com/evan/raspell + +Files: * +Copyright: 2007-2010 Cloudburst, LLC + 2005 Matthias Veit + 2005 Biro Eszter +License: GPL-2 + +Files: debian/* +Copyright: 2011 Alex Pennace <[email protected]> + 2013 Cédric Boutillier <[email protected]> +License: GPL-2 +Comment: the Debian packaging is licensed under the same terms as the original package. + +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. + . + This program 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 General Public License for more + details. + . + You should have received a copy of the GNU General Public + License along with this package; 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 General Public + License version 2 can be found in the file + `/usr/share/common-licenses/GPL-2'. diff -Nru raspell-1.2/debian/docs raspell-1.3/debian/docs --- raspell-1.2/debian/docs 2012-05-30 00:59:21.000000000 +0200 +++ raspell-1.3/debian/docs 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -README diff -Nru raspell-1.2/debian/patches/debian-changes-1.2-2 raspell-1.3/debian/patches/debian-changes-1.2-2 --- raspell-1.2/debian/patches/debian-changes-1.2-2 2012-06-18 01:11:01.000000000 +0200 +++ raspell-1.3/debian/patches/debian-changes-1.2-2 1970-01-01 01:00:00.000000000 +0100 @@ -1,107 +0,0 @@ -Description: Upstream changes introduced in version 1.2-2 - This patch has been created by dpkg-source during the package build. - Here's the last changelog entry, hopefully it gives details on why - those changes were made: - . - raspell (1.2-2) unstable; urgency=low - . - * Fix "FTBFS: ext/raspell.c:76:9: error: format not a string literal - and no format arguments [-Werror=format-security]." Thanks to Lucas - Nussbaum and Andreas Stuhrk. (Closes: #676077) - . - The person named in the Author field signed this changelog entry. -Author: Alex Pennace <[email protected]> -Bug-Debian: http://bugs.debian.org/676077 - ---- -The information above should follow the Patch Tagging Guidelines, please -checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here -are templates for supplementary fields that you might want to add: - -Origin: <vendor|upstream|other>, <url of original patch> -Bug: <url in upstream bugtracker> -Bug-Debian: http://bugs.debian.org/<bugnumber> -Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber> -Forwarded: <no|not-needed|url proving that it has been forwarded> -Reviewed-By: <name and email of someone who approved the patch> -Last-Update: <YYYY-MM-DD> - ---- raspell-1.2.orig/ext/raspell.c -+++ raspell-1.2/ext/raspell.c -@@ -73,7 +73,7 @@ static void aspell_free(void *p) { - */ - static void check_for_error(AspellSpeller * speller) { - if (aspell_speller_error(speller) != 0) { -- rb_raise(cAspellError, aspell_speller_error_message(speller)); -+ rb_raise(cAspellError, "%s", aspell_speller_error_message(speller)); - } - } - -@@ -87,11 +87,11 @@ static void check_for_error(AspellSpelle - static void set_option(AspellConfig *config, char *key, char *value) { - //printf("set option: %s = %s\n", key, value); - if (aspell_config_replace(config, key, value) == 0) { -- rb_raise(cAspellError, aspell_config_error_message(config)); -+ rb_raise(cAspellError, "%s", aspell_config_error_message(config)); - } - //check config: - if (aspell_config_error(config) != 0) { -- rb_raise(cAspellError, aspell_config_error_message(config)); -+ rb_raise(cAspellError, "%s", aspell_config_error_message(config)); - } - } - -@@ -132,7 +132,7 @@ static AspellDocumentChecker* get_checke - AspellDocumentChecker * checker; - ret = new_aspell_document_checker(speller); - if (aspell_error(ret) != 0) -- rb_raise(cAspellError, aspell_error_message(ret)); -+ rb_raise(cAspellError, "%s", aspell_error_message(ret)); - checker = to_aspell_document_checker(ret); - return checker; - } -@@ -214,7 +214,7 @@ static VALUE aspell_s_new(int argc, VALU - if (aspell_error(ret) != 0) { - tmp = strdup(aspell_error_message(ret)); - delete_aspell_can_have_error(ret); -- rb_raise(cAspellError, tmp); -+ rb_raise(cAspellError, "%s", tmp); - } - - speller = to_aspell_speller(ret); -@@ -253,7 +253,7 @@ static VALUE aspell_s_new1(VALUE klass, - if (aspell_error(ret) != 0) { - const char *tmp = strdup(aspell_error_message(ret)); - delete_aspell_can_have_error(ret); -- rb_raise(cAspellError, tmp); -+ rb_raise(cAspellError, "%s", tmp); - } - - speller = to_aspell_speller(ret); -@@ -409,7 +409,7 @@ static VALUE aspell_conf_retrieve(VALUE - AspellConfig *config = aspell_speller_config(speller); - VALUE result = rb_str_new2(aspell_config_retrieve(config, STR2CSTR(key))); - if (aspell_config_error(config) != 0) { -- rb_raise(cAspellError, aspell_config_error_message(config)); -+ rb_raise(cAspellError, "%s", aspell_config_error_message(config)); - } - return result; - } -@@ -433,7 +433,7 @@ static VALUE aspell_conf_retrieve_list(V - if (aspell_config_error(config) != 0) { - char *tmp = strdup(aspell_config_error_message(config)); - delete_aspell_string_list(list); -- rb_raise( cAspellError, tmp); -+ rb_raise( cAspellError, "%s", tmp); - } - - //iterate over list -@@ -480,7 +480,7 @@ static VALUE aspell_check(VALUE self, VA - else if (code == 0) - result = Qfalse; - else -- rb_raise( cAspellError, aspell_speller_error_message(speller)); -+ rb_raise( cAspellError, "%s", aspell_speller_error_message(speller)); - return result; - } - diff -Nru raspell-1.2/debian/patches/fix_test.patch raspell-1.3/debian/patches/fix_test.patch --- raspell-1.2/debian/patches/fix_test.patch 1970-01-01 01:00:00.000000000 +0100 +++ raspell-1.3/debian/patches/fix_test.patch 2014-01-15 15:12:38.000000000 +0100 @@ -0,0 +1,16 @@ +Description: mention an explicit dictionary for the tests +Author: Cédric Boutillier <[email protected]> +Forwarded: no +Last-Update: 2014-01-15 + +--- a/test/simple_test.rb ++++ b/test/simple_test.rb +@@ -6,7 +6,7 @@ + class TestSpell < Test::Unit::TestCase + + def setup +- @aspell = Aspell.new ++ @aspell = Aspell.new("en") + @text = ["Hiere is somthing wrong on the planett. And it was not the Apollo."] + end + diff -Nru raspell-1.2/debian/patches/format-security.patch raspell-1.3/debian/patches/format-security.patch --- raspell-1.2/debian/patches/format-security.patch 1970-01-01 01:00:00.000000000 +0100 +++ raspell-1.3/debian/patches/format-security.patch 2014-01-15 13:59:32.000000000 +0100 @@ -0,0 +1,84 @@ +Description: fix format-security warning/errors +Author: Cédric Boutillier <[email protected]> +Forwarded: no +Last-Update: 2014-01-15 + +--- a/ext/raspell.c ++++ b/ext/raspell.c +@@ -73,7 +73,7 @@ + */ + static void check_for_error(AspellSpeller * speller) { + if (aspell_speller_error(speller) != 0) { +- rb_raise(cAspellError, aspell_speller_error_message(speller)); ++ rb_raise(cAspellError, "%s", aspell_speller_error_message(speller)); + } + } + +@@ -87,11 +87,11 @@ + static void set_option(AspellConfig *config, char *key, char *value) { + //printf("set option: %s = %s\n", key, value); + if (aspell_config_replace(config, key, value) == 0) { +- rb_raise(cAspellError, aspell_config_error_message(config)); ++ rb_raise(cAspellError, "%s", aspell_config_error_message(config)); + } + //check config: + if (aspell_config_error(config) != 0) { +- rb_raise(cAspellError, aspell_config_error_message(config)); ++ rb_raise(cAspellError, "%s", aspell_config_error_message(config)); + } + } + +@@ -132,7 +132,7 @@ + AspellDocumentChecker * checker; + ret = new_aspell_document_checker(speller); + if (aspell_error(ret) != 0) +- rb_raise(cAspellError, aspell_error_message(ret)); ++ rb_raise(cAspellError, "%s", aspell_error_message(ret)); + checker = to_aspell_document_checker(ret); + return checker; + } +@@ -214,7 +214,7 @@ + if (aspell_error(ret) != 0) { + tmp = strdup(aspell_error_message(ret)); + delete_aspell_can_have_error(ret); +- rb_raise(cAspellError, tmp); ++ rb_raise(cAspellError, "%s", tmp); + } + + speller = to_aspell_speller(ret); +@@ -253,7 +253,7 @@ + if (aspell_error(ret) != 0) { + const char *tmp = strdup(aspell_error_message(ret)); + delete_aspell_can_have_error(ret); +- rb_raise(cAspellError, tmp); ++ rb_raise(cAspellError, "%s", tmp); + } + + speller = to_aspell_speller(ret); +@@ -409,7 +409,7 @@ + AspellConfig *config = aspell_speller_config(speller); + VALUE result = rb_str_new2(aspell_config_retrieve(config, StringValuePtr(key))); + if (aspell_config_error(config) != 0) { +- rb_raise(cAspellError, aspell_config_error_message(config)); ++ rb_raise(cAspellError, "%s", aspell_config_error_message(config)); + } + return result; + } +@@ -433,7 +433,7 @@ + if (aspell_config_error(config) != 0) { + char *tmp = strdup(aspell_config_error_message(config)); + delete_aspell_string_list(list); +- rb_raise( cAspellError, tmp); ++ rb_raise( cAspellError, "%s", tmp); + } + + //iterate over list +@@ -480,7 +480,7 @@ + else if (code == 0) + result = Qfalse; + else +- rb_raise( cAspellError, aspell_speller_error_message(speller)); ++ rb_raise( cAspellError, "%s", aspell_speller_error_message(speller)); + return result; + } + diff -Nru raspell-1.2/debian/patches/series raspell-1.3/debian/patches/series --- raspell-1.2/debian/patches/series 2012-06-18 01:11:01.000000000 +0200 +++ raspell-1.3/debian/patches/series 2014-01-15 13:49:02.000000000 +0100 @@ -1 +1,2 @@ -debian-changes-1.2-2 +format-security.patch +fix_test.patch diff -Nru raspell-1.2/debian/raspell.docs raspell-1.3/debian/raspell.docs --- raspell-1.2/debian/raspell.docs 1970-01-01 01:00:00.000000000 +0100 +++ raspell-1.3/debian/raspell.docs 2013-12-25 22:30:13.000000000 +0100 @@ -0,0 +1,2 @@ +# FIXME: READMEs found +# README.rdoc diff -Nru raspell-1.2/debian/ruby-test-files.yaml raspell-1.3/debian/ruby-test-files.yaml --- raspell-1.2/debian/ruby-test-files.yaml 1970-01-01 01:00:00.000000000 +0100 +++ raspell-1.3/debian/ruby-test-files.yaml 2013-12-25 22:30:13.000000000 +0100 @@ -0,0 +1,2 @@ +--- +- test/simple_test.rb diff -Nru raspell-1.2/debian/rules raspell-1.3/debian/rules --- raspell-1.2/debian/rules 2012-05-30 00:59:21.000000000 +0200 +++ raspell-1.3/debian/rules 2014-01-15 13:58:40.000000000 +0100 @@ -1,10 +1,15 @@ #!/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.9.1 ruby2.0 require-rubygems +# +# If you need to specify the .gemspec (eg there is more than one) +#export DH_RUBY_GEMSPEC=gem.gemspec -include /usr/share/cdbs/1/rules/debhelper.mk -#include /usr/share/cdbs/1/class/makefile.mk -include /usr/share/ruby-pkg-tools/1/class/ruby-extconf-rb.mk - -# Add here any variable or target overrides you need. - -DEB_RUBY_SETUP_CMD = ext/extconf.rb -DEB_RUBY_SETUP_ARGS = --srcdir=ext/ +%: + dh $@ --buildsystem=ruby --with ruby diff -Nru raspell-1.2/debian/source/lintian-overrides raspell-1.3/debian/source/lintian-overrides --- raspell-1.2/debian/source/lintian-overrides 1970-01-01 01:00:00.000000000 +0100 +++ raspell-1.3/debian/source/lintian-overrides 2014-01-15 15:35:27.000000000 +0100 @@ -0,0 +1,2 @@ +raspell source: duplicate-short-description libraspell-ruby libraspell-ruby1.8 libraspell-ruby1.9.1 +raspell source: duplicate-long-description libraspell-ruby libraspell-ruby1.8 libraspell-ruby1.9.1 diff -Nru raspell-1.2/debian/watch raspell-1.3/debian/watch --- raspell-1.2/debian/watch 1970-01-01 01:00:00.000000000 +0100 +++ raspell-1.3/debian/watch 2013-12-25 22:30:13.000000000 +0100 @@ -0,0 +1,2 @@ +version=3 +http://pkg-ruby-extras.alioth.debian.org/cgi-bin/gemwatch/raspell .*/raspell-(.*).tar.gz diff -Nru raspell-1.2/ext/raspell.c raspell-1.3/ext/raspell.c --- raspell-1.2/ext/raspell.c 2011-03-03 01:17:00.000000000 +0100 +++ raspell-1.3/ext/raspell.c 2013-12-25 22:29:02.000000000 +0100 @@ -43,7 +43,7 @@ void Init_dictinfo() { //CLASS DEFINITION========================================================= cDictInfo = rb_define_class("AspellDictInfo", rb_cObject); - + //CLASS METHODS============================================================ rb_define_singleton_method(cDictInfo, "new", dictinfo_s_new, 0); @@ -106,7 +106,7 @@ VALUE value = rb_funcall(hash, rb_intern("fetch"), 1, option); if (TYPE(option)!=T_STRING) rb_raise(cAspellError, "Given key must be a string."); if (TYPE(value )!=T_STRING) rb_raise(cAspellError, "Given value must be a string."); - set_option(config, STR2CSTR(option), STR2CSTR(value)); + set_option(config, StringValuePtr(option), StringValuePtr(value)); c++; } } @@ -161,7 +161,7 @@ * @return regular expression, matching exactly the word as whole. */ static VALUE get_wordregexp(VALUE word) { - char *cword = STR2CSTR(word); + char *cword = StringValuePtr(word); char *result = malloc((strlen(cword)+5)*sizeof(char)); *result='\0'; strcat(result, "\\b"); @@ -200,13 +200,13 @@ rb_scan_args(argc, argv, "04", &vlang, &vjargon, &vsize, &vencoding); //language: - if (RTEST(vlang)) set_option(config, "lang", STR2CSTR(vlang)); + if (RTEST(vlang)) set_option(config, "lang", StringValuePtr(vlang)); //jargon: - if (RTEST(vjargon)) set_option(config, "jargon", STR2CSTR(vjargon)); + if (RTEST(vjargon)) set_option(config, "jargon", StringValuePtr(vjargon)); //size: - if (RTEST(vsize)) set_option(config, "size", STR2CSTR(vsize)); + if (RTEST(vsize)) set_option(config, "size", StringValuePtr(vsize)); //encoding: - if (RTEST(vencoding)) set_option(config, "encoding", STR2CSTR(vencoding)); + if (RTEST(vencoding)) set_option(config, "encoding", StringValuePtr(vencoding)); //create speller: ret = new_aspell_speller(config); @@ -289,11 +289,11 @@ } /** - * @see set_option. + * @see set_option. */ static VALUE aspell_set_option(VALUE self, VALUE option, VALUE value) { AspellSpeller *speller = get_speller(self); - set_option(aspell_speller_config(speller), STR2CSTR(option), STR2CSTR(value)); + set_option(aspell_speller_config(speller), StringValuePtr(option), StringValuePtr(value)); return self; } @@ -304,7 +304,7 @@ */ static VALUE aspell_remove_option(VALUE self, VALUE option) { AspellSpeller *speller = get_speller(self); - aspell_config_remove(aspell_speller_config(speller), STR2CSTR(option)); + aspell_config_remove(aspell_speller_config(speller), StringValuePtr(option)); return self; } @@ -314,7 +314,7 @@ */ static VALUE aspell_set_suggestion_mode(VALUE self, VALUE value) { AspellSpeller *speller = get_speller(self); - set_option(aspell_speller_config(speller), "sug-mode", STR2CSTR(value)); + set_option(aspell_speller_config(speller), "sug-mode", StringValuePtr(value)); return self; } @@ -372,7 +372,7 @@ */ static VALUE aspell_suggest(VALUE self, VALUE word) { AspellSpeller *speller = get_speller(self); - return get_list(aspell_speller_suggest(speller, STR2CSTR(word), -1)); + return get_list(aspell_speller_suggest(speller, StringValuePtr(word), -1)); } /** @@ -382,7 +382,7 @@ */ static VALUE aspell_add_to_personal(VALUE self, VALUE word) { AspellSpeller *speller = get_speller(self); - aspell_speller_add_to_personal(speller, STR2CSTR(word), -1); + aspell_speller_add_to_personal(speller, StringValuePtr(word), -1); check_for_error(speller); return self; } @@ -393,21 +393,21 @@ */ static VALUE aspell_add_to_session(VALUE self, VALUE word) { AspellSpeller *speller = get_speller(self); - aspell_speller_add_to_session(speller, STR2CSTR(word), -1); + aspell_speller_add_to_session(speller, StringValuePtr(word), -1); check_for_error(speller); return self; } /** * Retrieve the value of a specific option. - * The options are listed inside + * The options are listed inside * Aspell::[DictionaryOptions|CheckerOptions|FilterOptions|RunTogetherOptions|MiscOptions|UtilityOptions] * @param word the option as string. */ static VALUE aspell_conf_retrieve(VALUE self, VALUE key) { AspellSpeller *speller = get_speller(self); AspellConfig *config = aspell_speller_config(speller); - VALUE result = rb_str_new2(aspell_config_retrieve(config, STR2CSTR(key))); + VALUE result = rb_str_new2(aspell_config_retrieve(config, StringValuePtr(key))); if (aspell_config_error(config) != 0) { rb_raise(cAspellError, aspell_config_error_message(config)); } @@ -428,7 +428,7 @@ const char *option_value; //retrieve list - aspell_config_retrieve_list(config, STR2CSTR(key), container); + aspell_config_retrieve_list(config, StringValuePtr(key), container); //check for error if (aspell_config_error(config) != 0) { char *tmp = strdup(aspell_config_error_message(config)); @@ -474,7 +474,7 @@ static VALUE aspell_check(VALUE self, VALUE word) { AspellSpeller *speller = get_speller(self); VALUE result = Qfalse; - int code = aspell_speller_check(speller, STR2CSTR(word), -1); + int code = aspell_speller_check(speller, StringValuePtr(word), -1); if (code == 1) result = Qtrue; else if (code == 0) @@ -489,7 +489,7 @@ * This method needs a block to work proper. Each misspelled word is yielded, * a correct word as result from the block is assumed. * Common use: - * + * * a = Aspell.new(...) * text = ... * a.correct_lines(text) { |badword| @@ -497,7 +497,7 @@ * puts a.suggest(badword).join(" | ") * gets #the input is returned as right word * } - * + * * @param ary the array of strings to check. * @result an array holding all lines with corrected words. */ @@ -524,7 +524,7 @@ //save line sline = rb_funcall(vline, rb_intern("dup"), 0); //c representation - line = STR2CSTR(vline); + line = StringValuePtr(vline); //process line aspell_document_checker_process(checker, line, -1); //iterate over all misspelled words @@ -540,14 +540,14 @@ //chomp the string rb_funcall(rword, rb_intern("chomp!"), 0); //empty string -> do nothing - if(strlen(STR2CSTR(rword)) == 0) continue; + if(strlen(StringValuePtr(rword)) == 0) continue; //remember word for later suggestion - aspell_speller_store_replacement(speller, STR2CSTR(word), -1, STR2CSTR(rword), -1); + aspell_speller_store_replacement(speller, StringValuePtr(word), -1, StringValuePtr(rword), -1); //substitute the word by replacement rb_funcall(sline, rb_intern("[]="), 3, INT2FIX(token.offset+offset), INT2FIX(token.len), rword); //adjust offset - offset += strlen(STR2CSTR(rword))-strlen(STR2CSTR(word)); - //printf("replace >%s< with >%s< (offset now %d)\n", STR2CSTR(word), STR2CSTR(rword), offset); + offset += strlen(StringValuePtr(rword))-strlen(StringValuePtr(word)); + //printf("replace >%s< with >%s< (offset now %d)\n", StringValuePtr(word), StringValuePtr(rword), offset); } //push the substituted line to result rb_ary_push(result, sline); @@ -570,7 +570,7 @@ */ static VALUE aspell_store_replacement(VALUE self, VALUE badword, VALUE rightword) { AspellSpeller *speller = get_speller(self); - aspell_speller_store_replacement(speller, STR2CSTR(badword), -1, STR2CSTR(rightword), -1); + aspell_speller_store_replacement(speller, StringValuePtr(badword), -1, StringValuePtr(rightword), -1); return self; } @@ -585,7 +585,7 @@ if (rb_block_given_p()) { VALUE content = rb_funcall(rb_cFile, rb_intern("readlines"), 1, filename); VALUE newcontent = aspell_correct_lines(self, content); - VALUE file = rb_file_open(STR2CSTR(filename), "w+"); + VALUE file = rb_file_open(StringValuePtr(filename), "w+"); rb_funcall(file, rb_intern("write"), 1, newcontent); rb_funcall(file, rb_intern("close"), 0); } else { @@ -601,6 +601,7 @@ * @return array of strings: words that are misspelled. */ static VALUE aspell_list_misspelled(VALUE self, VALUE ary) { + Check_Type(ary, T_ARRAY); VALUE result = rb_hash_new(); //create checker AspellSpeller *speller = get_speller(self); @@ -613,7 +614,8 @@ while(c<count) { //process line vline = RARRAY_PTR(ary)[c]; - aspell_document_checker_process(checker, STR2CSTR(vline), -1); + Check_Type(vline, T_STRING); + aspell_document_checker_process(checker, StringValuePtr(vline), -1); //iterate over all misspelled words while (token = aspell_document_checker_next_misspelling(checker), token.len != 0) { //extract word by start/length qualifier diff -Nru raspell-1.2/Manifest raspell-1.3/Manifest --- raspell-1.2/Manifest 1970-01-01 01:00:00.000000000 +0100 +++ raspell-1.3/Manifest 2013-12-25 22:29:02.000000000 +0100 @@ -0,0 +1,10 @@ +CHANGELOG +LICENSE +Manifest +README.rdoc +Rakefile +ext/extconf.rb +ext/raspell.c +ext/raspell.h +lib/raspell_stub.rb +test/simple_test.rb Les fichiers binaires /tmp/zvDjffTknK/raspell-1.2/metadata.gz.sig et /tmp/8BDQkEF0sr/raspell-1.3/metadata.gz.sig sont différents diff -Nru raspell-1.2/metadata.yml raspell-1.3/metadata.yml --- raspell-1.2/metadata.yml 1970-01-01 01:00:00.000000000 +0100 +++ raspell-1.3/metadata.yml 2013-12-25 22:29:02.000000000 +0100 @@ -0,0 +1,103 @@ +--- !ruby/object:Gem::Specification +name: raspell +version: !ruby/object:Gem::Version + version: '1.3' + prerelease: +platform: ruby +authors: +- '' +autorequire: +bindir: bin +cert_chain: +- ! '-----BEGIN CERTIFICATE----- + + MIIDLjCCAhagAwIBAgIBADANBgkqhkiG9w0BAQUFADA9MQ0wCwYDVQQDDARldmFu + + MRgwFgYKCZImiZPyLGQBGRYIY2xvdWRidXIxEjAQBgoJkiaJk/IsZAEZFgJzdDAe + + Fw0wNzA5MTYxMDMzMDBaFw0wODA5MTUxMDMzMDBaMD0xDTALBgNVBAMMBGV2YW4x + + GDAWBgoJkiaJk/IsZAEZFghjbG91ZGJ1cjESMBAGCgmSJomT8ixkARkWAnN0MIIB + + IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5C0Io89nyApnr+PvbNFge9Vs + + yRWAlGBUEMahpXp28VrrfXZT0rAW7JBo4PlCE3jl4nE4dzE6gAdItSycjTosrw7A + + Ir5+xoyl4Vb35adv56TIQQXvNz+BzlqnkAY5JN0CSBRTQb6mxS3hFyD/h4qgDosj + + R2RFVzHqSxCS8xq4Ny8uzOwOi+Xyu4w67fI5JvnPvMxqrlR1eaIQHmxnf76RzC46 + + QO5QhufjAYGGXd960XzbQsQyTDUYJzrvT7AdOfiyZzKQykKt8dEpDn+QPjFTnGnT + + QmgJBX5WJN0lHF2l1sbv3gh4Kn1tZu+kTUqeXY6ShAoDTyvZRiFqQdwh8w2lTQID + + AQABozkwNzAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQU+WqJz3xQ + + XSea1hRvvHWcIMgeeC4wDQYJKoZIhvcNAQEFBQADggEBAGLZ75jfOEW8Nsl26CTt + + JFrWxQTcQT/UljeefVE3xYr7lc9oQjbqO3FOyued3qW7TaNEtZfSHoYeUSMYbpw1 + + XAwocIPuSRFDGM4B+hgQGVDx8PMGiJKom4qLXjO40UZsR7QyN/u869Vj45LURm6h + + MBcPeqCASI+WNprj9+uZa2kmHiitrFqqfMBNlm5IFbn9XeYSta9AHVvs5QQqV2m5 + + hIPfLqCyxsn/YgOGvo6iwyQTWyTswamaAC3HRWZxIS1sfn/Ssqa7E7oQMkv5FAXr + + x5rKePfXINf8XTJczkl9OBEYdE9aNdJsJpXD0asLgGVwBICS5Bjohp6mizJcDC1+ + + yZ0= + + -----END CERTIFICATE----- + +' +date: 2011-12-03 00:00:00.000000000 Z +dependencies: [] +description: An interface binding for the Aspell spelling checker. +email: '' +executables: [] +extensions: +- ext/extconf.rb +extra_rdoc_files: +- CHANGELOG +- LICENSE +- README.rdoc +- lib/raspell_stub.rb +files: +- CHANGELOG +- LICENSE +- Manifest +- README.rdoc +- Rakefile +- ext/extconf.rb +- ext/raspell.c +- ext/raspell.h +- lib/raspell_stub.rb +- test/simple_test.rb +- raspell.gemspec +homepage: http://fauna.github.com/fauna/raspell/ +licenses: [] +post_install_message: +rdoc_options: [] +require_paths: +- lib +- ext +required_ruby_version: !ruby/object:Gem::Requirement + none: false + requirements: + - - ! '>=' + - !ruby/object:Gem::Version + version: '0' +required_rubygems_version: !ruby/object:Gem::Requirement + none: false + requirements: + - - ! '>=' + - !ruby/object:Gem::Version + version: '1.2' +requirements: [] +rubyforge_project: fauna +rubygems_version: 1.8.10 +signing_key: +specification_version: 3 +summary: An interface binding for the Aspell spelling checker. +test_files: +- test/simple_test.rb diff -Nru raspell-1.2/Rakefile raspell-1.3/Rakefile --- raspell-1.2/Rakefile 2011-03-03 01:17:00.000000000 +0100 +++ raspell-1.3/Rakefile 2013-12-25 22:29:02.000000000 +0100 @@ -1,14 +1,10 @@ require 'rubygems' -gem 'echoe', '>=2.3' require 'echoe' -Echoe.new("raspell") do |p| - p.rubyforge_name = "fauna" +Echoe.new("raspell") do |p| + p.project = "fauna" p.summary = "An interface binding for the Aspell spelling checker." - p.url = "http://blog.evanweaver.com/files/doc/fauna/raspell/" - p.docs_host = "blog.evanweaver.com:~/www/bax/public/files/doc/" - p.has_rdoc = false # avoids warnings on gem install p.rdoc_pattern = /CHANGELOG|EXAMPLE|LICENSE|README|lib/ p.rdoc_options = [] # don't want to include the stubbed out source p.require_signed = true diff -Nru raspell-1.2/raspell.gemspec raspell-1.3/raspell.gemspec --- raspell-1.2/raspell.gemspec 2011-03-03 01:17:00.000000000 +0100 +++ raspell-1.3/raspell.gemspec 2013-12-25 22:29:02.000000000 +0100 @@ -1,28 +1,27 @@ # -*- encoding: utf-8 -*- Gem::Specification.new do |s| - s.name = %q{raspell} - s.version = "1.2" + s.name = "raspell" + s.version = "1.3" s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version= s.authors = [""] s.cert_chain = ["/Users/eweaver/p/configuration/gem_certificates/evan_weaver-original-public_cert.pem"] - s.date = %q{2011-01-30} - s.description = %q{An interface binding for the Aspell spelling checker.} - s.email = %q{} + s.date = "2011-12-03" + s.description = "An interface binding for the Aspell spelling checker." + s.email = "" s.extensions = ["ext/extconf.rb"] - s.extra_rdoc_files = ["lib/raspell_stub.rb", "README", "LICENSE", "CHANGELOG"] - s.files = ["test/simple_test.rb", "lib/raspell_stub.rb", "ext/raspell.h", "ext/raspell.c", "ext/extconf.rb", "README", "LICENSE", "CHANGELOG", "raspell.gemspec", "Rakefile"] - s.homepage = %q{http://blog.evanweaver.com/files/doc/fauna/raspell/} + s.extra_rdoc_files = ["CHANGELOG", "LICENSE", "README.rdoc", "lib/raspell_stub.rb"] + s.files = ["CHANGELOG", "LICENSE", "Manifest", "README.rdoc", "Rakefile", "ext/extconf.rb", "ext/raspell.c", "ext/raspell.h", "lib/raspell_stub.rb", "test/simple_test.rb", "raspell.gemspec"] + s.homepage = "http://fauna.github.com/fauna/raspell/" s.require_paths = ["lib", "ext"] - s.rubyforge_project = %q{fauna} - s.rubygems_version = %q{1.3.7} - s.signing_key = %q{/Users/eweaver/p/configuration/gem_certificates/evan_weaver-original-private_key.pem} - s.summary = %q{An interface binding for the Aspell spelling checker.} + s.rubyforge_project = "fauna" + s.rubygems_version = "1.8.10" + s.signing_key = "/Users/eweaver/p/configuration/gem_certificates/evan_weaver-original-private_key.pem" + s.summary = "An interface binding for the Aspell spelling checker." s.test_files = ["test/simple_test.rb"] if s.respond_to? :specification_version then - current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION s.specification_version = 3 if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then diff -Nru raspell-1.2/README raspell-1.3/README --- raspell-1.2/README 2011-03-03 01:17:00.000000000 +0100 +++ raspell-1.3/README 1970-01-01 01:00:00.000000000 +0100 @@ -1,78 +0,0 @@ - -raspell - -An interface binding for the Aspell spelling checker. - -== License - -Copyright 2007-2010 Cloudburst, LLC. Licensed under the GPL 2.0. See included LICENSE file. Portions copyright 2005 Matthias Veit, Biro Eszter and used with permission. - -The public certificate for the gem is here[http://rubyforge.org/frs/download.php/25331/evan_weaver-original-public_cert.pem]. - -If you use this software, please {make a donation}[http://blog.evanweaver.com/donate/], or {recommend Evan}[http://www.workingwithrails.com/person/7739-evan-weaver] at Working with Rails. - -== Requirements - -Raspell requires Aspell version 0.6 (http://www.aspell.net) and at least one Aspell dictionary. - -Mac: - sudo port install aspell aspell-dict-en - -Ubuntu: - sudo apt-get install aspell libaspell-dev aspell-en - -== Installation - -Mac: - sudo gem install raspell -- --with-opt-dir=/opt/local - -Ubuntu: - sudo gem install raspell - -== Usage - -Aspell lets you <tt>check</tt> words and <tt>suggest</tt> corrections. For example: - - require 'rubygems' - require 'raspell' - - speller = Aspell.new("en_US") - speller.suggestion_mode = Aspell::NORMAL - - string = "my haert wil go on" - - string.gsub(/[\w\']+/) do |word| - if !speller.check(word) - # word is wrong - puts "Possible correction for #{word}:" - puts speller.suggest(word).first - end - end - -This outputs: - - Possible correction for haert: - heart - Possible correction for wil: - Will - -Note that <tt>suggest</tt> returns an array of suggestions even for words that are correctly spelled. - -== Options - -The most useful options are <tt>suggestion_mode</tt>, and the passthrough option <tt>ignore_case</tt>. Passthrough options have to be set as so: - - speller.set_option("ignore-case", "true") - -See http://aspell.net/man-html/The-Options.html for a list of the passthrough options. - -== Reporting problems - -The support forum is here[http://rubyforge.org/forum/forum.php?forum_id=13988]. - -Patches and contributions are very welcome. Please note that contributors are required to assign copyright for their additions to Cloudburst, LLC. - -== Futher resources - -* http://blog.evanweaver.com/articles/2007/03/10/add-gud-spelning-to-ur-railz-app-or-wharever - diff -Nru raspell-1.2/README.rdoc raspell-1.3/README.rdoc --- raspell-1.2/README.rdoc 1970-01-01 01:00:00.000000000 +0100 +++ raspell-1.3/README.rdoc 2013-12-25 22:29:02.000000000 +0100 @@ -0,0 +1,78 @@ + +raspell + +An interface binding for the Aspell spelling checker. + +== License + +Copyright 2007-2010 Cloudburst, LLC. Licensed under the GPL 2.0. See included LICENSE file. Portions copyright 2005 Matthias Veit, Biro Eszter and used with permission. + +The public certificate for the gem is here[http://rubyforge.org/frs/download.php/25331/evan_weaver-original-public_cert.pem]. + +If you use this software, please {make a donation}[http://blog.evanweaver.com/donate/], or {recommend Evan}[http://www.workingwithrails.com/person/7739-evan-weaver] at Working with Rails. + +== Requirements + +Raspell requires Aspell version 0.6 (http://www.aspell.net) and at least one Aspell dictionary. + +Mac: + sudo port install aspell aspell-dict-en + +Ubuntu: + sudo apt-get install aspell libaspell-dev aspell-en + +== Installation + +Mac: + sudo gem install raspell -- --with-opt-dir=/opt/local + +Ubuntu: + sudo gem install raspell + +== Usage + +Aspell lets you <tt>check</tt> words and <tt>suggest</tt> corrections. For example: + + require 'rubygems' + require 'raspell' + + speller = Aspell.new("en_US") + speller.suggestion_mode = Aspell::NORMAL + + string = "my haert wil go on" + + string.gsub(/[\w\']+/) do |word| + if !speller.check(word) + # word is wrong + puts "Possible correction for #{word}:" + puts speller.suggest(word).first + end + end + +This outputs: + + Possible correction for haert: + heart + Possible correction for wil: + Will + +Note that <tt>suggest</tt> returns an array of suggestions even for words that are correctly spelled. + +== Options + +The most useful options are <tt>suggestion_mode</tt>, and the passthrough option <tt>ignore_case</tt>. Passthrough options have to be set as so: + + speller.set_option("ignore-case", "true") + +See http://aspell.net/man-html/The-Options.html for a list of the passthrough options. + +== Reporting problems + +The support forum is here[http://rubyforge.org/forum/forum.php?forum_id=13988]. + +Patches and contributions are very welcome. Please note that contributors are required to assign copyright for their additions to Cloudburst, LLC. + +== Futher resources + +* http://blog.evanweaver.com/articles/2007/03/10/add-gud-spelning-to-ur-railz-app-or-wharever + diff -Nru raspell-1.2/test/simple_test.rb raspell-1.3/test/simple_test.rb --- raspell-1.2/test/simple_test.rb 2011-03-03 01:17:00.000000000 +0100 +++ raspell-1.3/test/simple_test.rb 2013-12-25 22:29:02.000000000 +0100 @@ -9,20 +9,20 @@ @aspell = Aspell.new @text = ["Hiere is somthing wrong on the planett. And it was not the Apollo."] end - + def test_correct_lines assert_equal(["<wrong word> is <wrong word> wrong on the <wrong word>. And it was not the Apollo."], - @aspell.correct_lines(@text) { |word| "<wrong word>" }) + @aspell.correct_lines(@text) { |word| "<wrong word>" }) end def test_list_mispelled misspelled = @aspell.list_misspelled(@text).sort assert_equal(3, misspelled.length) end - + def test_suggest suggestions = @aspell.suggest("spel") - assert_equal [], + assert_equal [], ["spell", "spiel", "spew", "Opel", "spec", "sped"] - suggestions end @@ -30,7 +30,15 @@ assert_equal(false, @aspell.check("spel")) assert(@aspell.check("spell")) end - + + def test_argument_checking + assert_raises TypeError do + @aspell.list_misspelled "Not an array" + end + assert_raises TypeError do + @aspell.list_misspelled [123] + end + end end
signature.asc
Description: Digital signature

