raspell 1.2.2 → 1.3

Sign up to get free protection for your applications and to get access to all the features.
data.tar.gz.sig CHANGED
Binary file
data/CHANGELOG CHANGED
@@ -1,3 +1,5 @@
1
+ v1.3. Enforce argument types better (raskhadafi).
2
+
1
3
  v1.2.2. Support for some changes from Ruby 1.9.1 to 1.9.2 (dmarkow).
2
4
 
3
5
  v1.2. Ruby 1.9 compatibility (ph7).
@@ -0,0 +1,10 @@
1
+ CHANGELOG
2
+ LICENSE
3
+ Manifest
4
+ README.rdoc
5
+ Rakefile
6
+ ext/extconf.rb
7
+ ext/raspell.c
8
+ ext/raspell.h
9
+ lib/raspell_stub.rb
10
+ test/simple_test.rb
File without changes
@@ -43,7 +43,7 @@ static VALUE dictinfo_size_str(VALUE self) {
43
43
  void Init_dictinfo() {
44
44
  //CLASS DEFINITION=========================================================
45
45
  cDictInfo = rb_define_class("AspellDictInfo", rb_cObject);
46
-
46
+
47
47
  //CLASS METHODS============================================================
48
48
  rb_define_singleton_method(cDictInfo, "new", dictinfo_s_new, 0);
49
49
 
@@ -289,7 +289,7 @@ static VALUE aspell_s_list_dicts(VALUE klass) {
289
289
  }
290
290
 
291
291
  /**
292
- * @see set_option.
292
+ * @see set_option.
293
293
  */
294
294
  static VALUE aspell_set_option(VALUE self, VALUE option, VALUE value) {
295
295
  AspellSpeller *speller = get_speller(self);
@@ -400,7 +400,7 @@ static VALUE aspell_add_to_session(VALUE self, VALUE word) {
400
400
 
401
401
  /**
402
402
  * Retrieve the value of a specific option.
403
- * The options are listed inside
403
+ * The options are listed inside
404
404
  * Aspell::[DictionaryOptions|CheckerOptions|FilterOptions|RunTogetherOptions|MiscOptions|UtilityOptions]
405
405
  * @param word the option as string.
406
406
  */
@@ -489,7 +489,7 @@ static VALUE aspell_check(VALUE self, VALUE word) {
489
489
  * This method needs a block to work proper. Each misspelled word is yielded,
490
490
  * a correct word as result from the block is assumed.
491
491
  * Common use:
492
- *
492
+ *
493
493
  * a = Aspell.new(...)
494
494
  * text = ...
495
495
  * a.correct_lines(text) { |badword|
@@ -497,7 +497,7 @@ static VALUE aspell_check(VALUE self, VALUE word) {
497
497
  * puts a.suggest(badword).join(" | ")
498
498
  * gets #the input is returned as right word
499
499
  * }
500
- *
500
+ *
501
501
  * @param ary the array of strings to check.
502
502
  * @result an array holding all lines with corrected words.
503
503
  */
@@ -601,6 +601,7 @@ static VALUE aspell_correct_file(VALUE self, VALUE filename) {
601
601
  * @return array of strings: words that are misspelled.
602
602
  */
603
603
  static VALUE aspell_list_misspelled(VALUE self, VALUE ary) {
604
+ Check_Type(ary, T_ARRAY);
604
605
  VALUE result = rb_hash_new();
605
606
  //create checker
606
607
  AspellSpeller *speller = get_speller(self);
@@ -613,6 +614,7 @@ static VALUE aspell_list_misspelled(VALUE self, VALUE ary) {
613
614
  while(c<count) {
614
615
  //process line
615
616
  vline = RARRAY_PTR(ary)[c];
617
+ Check_Type(vline, T_STRING);
616
618
  aspell_document_checker_process(checker, StringValuePtr(vline), -1);
617
619
  //iterate over all misspelled words
618
620
  while (token = aspell_document_checker_next_misspelling(checker), token.len != 0) {
@@ -1,25 +1,25 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
 
3
3
  Gem::Specification.new do |s|
4
- s.name = %q{raspell}
5
- s.version = "1.2.2"
4
+ s.name = "raspell"
5
+ s.version = "1.3"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
- s.authors = [%q{}]
9
- s.cert_chain = [%q{/Users/eweaver/p/configuration/gem_certificates/evan_weaver-original-public_cert.pem}]
10
- s.date = %q{2011-08-26}
11
- s.description = %q{An interface binding for the Aspell spelling checker.}
12
- s.email = %q{}
13
- s.extensions = [%q{ext/extconf.rb}]
14
- s.extra_rdoc_files = [%q{lib/raspell_stub.rb}, %q{README}, %q{LICENSE}, %q{CHANGELOG}]
15
- s.files = [%q{test/simple_test.rb}, %q{lib/raspell_stub.rb}, %q{ext/raspell.h}, %q{ext/raspell.c}, %q{ext/extconf.rb}, %q{README}, %q{LICENSE}, %q{CHANGELOG}, %q{raspell.gemspec}, %q{Rakefile}]
16
- s.homepage = %q{http://fauna.github.com/fauna/raspell/}
17
- s.require_paths = [%q{lib}, %q{ext}]
18
- s.rubyforge_project = %q{fauna}
19
- s.rubygems_version = %q{1.8.6}
20
- s.signing_key = %q{/Users/eweaver/p/configuration/gem_certificates/evan_weaver-original-private_key.pem}
21
- s.summary = %q{An interface binding for the Aspell spelling checker.}
22
- s.test_files = [%q{test/simple_test.rb}]
8
+ s.authors = [""]
9
+ s.cert_chain = ["/Users/eweaver/p/configuration/gem_certificates/evan_weaver-original-public_cert.pem"]
10
+ s.date = "2011-12-03"
11
+ s.description = "An interface binding for the Aspell spelling checker."
12
+ s.email = ""
13
+ s.extensions = ["ext/extconf.rb"]
14
+ s.extra_rdoc_files = ["CHANGELOG", "LICENSE", "README.rdoc", "lib/raspell_stub.rb"]
15
+ 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"]
16
+ s.homepage = "http://fauna.github.com/fauna/raspell/"
17
+ s.require_paths = ["lib", "ext"]
18
+ s.rubyforge_project = "fauna"
19
+ s.rubygems_version = "1.8.10"
20
+ s.signing_key = "/Users/eweaver/p/configuration/gem_certificates/evan_weaver-original-private_key.pem"
21
+ s.summary = "An interface binding for the Aspell spelling checker."
22
+ s.test_files = ["test/simple_test.rb"]
23
23
 
24
24
  if s.respond_to? :specification_version then
25
25
  s.specification_version = 3
@@ -9,20 +9,20 @@ class TestSpell < Test::Unit::TestCase
9
9
  @aspell = Aspell.new
10
10
  @text = ["Hiere is somthing wrong on the planett. And it was not the Apollo."]
11
11
  end
12
-
12
+
13
13
  def test_correct_lines
14
14
  assert_equal(["<wrong word> is <wrong word> wrong on the <wrong word>. And it was not the Apollo."],
15
- @aspell.correct_lines(@text) { |word| "<wrong word>" })
15
+ @aspell.correct_lines(@text) { |word| "<wrong word>" })
16
16
  end
17
17
 
18
18
  def test_list_mispelled
19
19
  misspelled = @aspell.list_misspelled(@text).sort
20
20
  assert_equal(3, misspelled.length)
21
21
  end
22
-
22
+
23
23
  def test_suggest
24
24
  suggestions = @aspell.suggest("spel")
25
- assert_equal [],
25
+ assert_equal [],
26
26
  ["spell", "spiel", "spew", "Opel", "spec", "sped"] - suggestions
27
27
  end
28
28
 
@@ -30,7 +30,15 @@ class TestSpell < Test::Unit::TestCase
30
30
  assert_equal(false, @aspell.check("spel"))
31
31
  assert(@aspell.check("spell"))
32
32
  end
33
-
33
+
34
+ def test_argument_checking
35
+ assert_raises TypeError do
36
+ @aspell.list_misspelled "Not an array"
37
+ end
38
+ assert_raises TypeError do
39
+ @aspell.list_misspelled [123]
40
+ end
41
+ end
34
42
  end
35
43
 
36
44
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: raspell
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: '1.3'
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -50,7 +50,7 @@ cert_chain:
50
50
  -----END CERTIFICATE-----
51
51
 
52
52
  '
53
- date: 2011-08-26 00:00:00.000000000Z
53
+ date: 2011-12-03 00:00:00.000000000 Z
54
54
  dependencies: []
55
55
  description: An interface binding for the Aspell spelling checker.
56
56
  email: ''
@@ -58,21 +58,22 @@ executables: []
58
58
  extensions:
59
59
  - ext/extconf.rb
60
60
  extra_rdoc_files:
61
- - lib/raspell_stub.rb
62
- - README
63
- - LICENSE
64
61
  - CHANGELOG
65
- files:
66
- - test/simple_test.rb
67
- - lib/raspell_stub.rb
68
- - ext/raspell.h
69
- - ext/raspell.c
70
- - ext/extconf.rb
71
- - README
72
62
  - LICENSE
63
+ - README.rdoc
64
+ - lib/raspell_stub.rb
65
+ files:
73
66
  - CHANGELOG
74
- - raspell.gemspec
67
+ - LICENSE
68
+ - Manifest
69
+ - README.rdoc
75
70
  - Rakefile
71
+ - ext/extconf.rb
72
+ - ext/raspell.c
73
+ - ext/raspell.h
74
+ - lib/raspell_stub.rb
75
+ - test/simple_test.rb
76
+ - raspell.gemspec
76
77
  homepage: http://fauna.github.com/fauna/raspell/
77
78
  licenses: []
78
79
  post_install_message:
@@ -94,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
95
  version: '1.2'
95
96
  requirements: []
96
97
  rubyforge_project: fauna
97
- rubygems_version: 1.8.6
98
+ rubygems_version: 1.8.10
98
99
  signing_key:
99
100
  specification_version: 3
100
101
  summary: An interface binding for the Aspell spelling checker.
metadata.gz.sig CHANGED
Binary file