hunspell 0.1 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. data/extconf.rb +24 -2
  2. data/hunspell.c +4 -4
  3. metadata +2 -2
data/extconf.rb CHANGED
@@ -1,6 +1,28 @@
1
1
  require 'mkmf'
2
2
 
3
- dir_config("Hunspell")
4
- have_library("hunspell-1.1", "Hunspell_create")
3
+ prefix_list = %w(/usr/local /opt/local)
4
+
5
+ if with_config('prefix')
6
+ prefix_list << with_config('prefix')
7
+ end
8
+
9
+ # try to find hunspell lib
10
+ good_prefix = '/usr/local'
11
+ prefix_list.each do |prefix|
12
+ if find_library('hunspell-1.1', 'Hunspell_create', prefix + "/lib")
13
+ good_prefix = prefix
14
+ break
15
+ end
16
+ end
17
+
18
+ # workaround for FreeBSD where hunspell package does not deploy header files
19
+ # you can add include dir explicitly
20
+ inc_dir = if with_config("include-dir")
21
+ with_config("include-dir")
22
+ else
23
+ good_prefix+"/include"
24
+ end
25
+
26
+ dir_config("Hunspell" , inc_dir, good_prefix+"/lib")
5
27
 
6
28
  create_makefile("Hunspell")
data/hunspell.c CHANGED
@@ -54,7 +54,7 @@ static VALUE mHunspellInitialize(VALUE self, VALUE affPath, VALUE dictPath) {
54
54
  Hunhandle *handler = Hunspell_create(StringValueCStr(affPath), StringValueCStr(dictPath));
55
55
 
56
56
  Hunhandle **ptr;
57
- Data_Get_Struct(self, Hunhandle **, ptr);
57
+ Data_Get_Struct(self, Hunhandle *, ptr);
58
58
 
59
59
  if (!handler) {
60
60
  // crash!
@@ -85,7 +85,7 @@ static VALUE mHunspellSpell(VALUE self, VALUE str) {
85
85
  int result;
86
86
 
87
87
  Hunhandle **ptr;
88
- Data_Get_Struct(self, Hunhandle **, ptr);
88
+ Data_Get_Struct(self, Hunhandle *, ptr);
89
89
 
90
90
  result = Hunspell_spell(*ptr, (const char *)StringValueCStr(str));
91
91
  #ifdef DEBUG
@@ -112,7 +112,7 @@ static VALUE mHunspellSuggest(VALUE self, VALUE str) {
112
112
  VALUE ret;
113
113
 
114
114
  Hunhandle **ptr;
115
- Data_Get_Struct(self, Hunhandle **, ptr);
115
+ Data_Get_Struct(self, Hunhandle *, ptr);
116
116
 
117
117
  n = Hunspell_suggest(*ptr, &lst, (const char *)StringValueCStr(str));
118
118
  if (n > 0) {
@@ -149,7 +149,7 @@ static VALUE mHunspellEncoding(VALUE self) {
149
149
  int result;
150
150
 
151
151
  Hunhandle **ptr;
152
- Data_Get_Struct(self, Hunhandle **, ptr);
152
+ Data_Get_Struct(self, Hunhandle *, ptr);
153
153
 
154
154
  char *enc = Hunspell_get_dic_encoding(*ptr);
155
155
  #ifdef DEBUG
metadata CHANGED
@@ -1,9 +1,9 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.2
2
+ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: hunspell
5
5
  version: !ruby/object:Gem::Version
6
- version: "0.1"
6
+ version: 0.1.1
7
7
  date: 2007-09-06 00:00:00 +02:00
8
8
  summary: Ruby interface to hunspell spell checker
9
9
  require_paths: