rroonga 0.9.5-x86-mingw32 → 1.0.1-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (421) hide show
  1. data/NEWS.ja.rdoc +24 -0
  2. data/NEWS.rdoc +24 -0
  3. data/README.ja.rdoc +3 -2
  4. data/README.rdoc +3 -2
  5. data/Rakefile +15 -6
  6. data/ext/groonga/extconf.rb +25 -25
  7. data/ext/groonga/groonga.def +2 -0
  8. data/ext/groonga/rb-grn-array.c +1 -1
  9. data/ext/groonga/rb-grn-exception.c +14 -0
  10. data/ext/groonga/rb-grn-hash.c +1 -1
  11. data/ext/groonga/rb-grn-index-column.c +13 -1
  12. data/ext/groonga/rb-grn-object.c +2 -2
  13. data/ext/groonga/rb-grn-patricia-trie.c +394 -1
  14. data/ext/groonga/rb-grn-table.c +33 -2
  15. data/ext/groonga/rb-grn.h +3 -3
  16. data/html/index.html +1 -1
  17. data/lib/1.8/groonga.so +0 -0
  18. data/lib/1.9/groonga.so +0 -0
  19. data/lib/groonga/record.rb +32 -2
  20. data/lib/groonga/schema.rb +1 -1
  21. data/rroonga-build.rb +3 -3
  22. data/test/test-patricia-trie.rb +172 -1
  23. data/test/test-record.rb +7 -0
  24. data/test/test-remote.rb +2 -1
  25. data/test/test-table-cursor.rb +35 -1
  26. data/test/test-table-select-normalize.rb +7 -3
  27. data/vendor/local/bin/grntest.exe +0 -0
  28. data/vendor/local/bin/groonga.exe +0 -0
  29. data/vendor/local/bin/libgroonga-0.dll +0 -0
  30. data/vendor/local/etc/groonga/groonga.conf +11 -0
  31. data/vendor/local/etc/groonga/init.d/redhat/groonga +168 -0
  32. data/vendor/local/etc/groonga/init.d/redhat/sysconfig/groonga +8 -0
  33. data/vendor/local/include/groonga/groonga.h +38 -12
  34. data/vendor/local/lib/groonga/modules/suggest/suggest.a +0 -0
  35. data/vendor/local/lib/groonga/modules/suggest/suggest.dll +0 -0
  36. data/vendor/local/lib/groonga/modules/suggest/suggest.dll.a +0 -0
  37. data/vendor/local/lib/groonga/modules/{functions/cast.la → suggest/suggest.la} +6 -6
  38. data/vendor/local/lib/libgroonga.a +0 -0
  39. data/vendor/local/lib/libgroonga.dll.a +0 -0
  40. data/vendor/local/lib/pkgconfig/groonga.pc +1 -1
  41. data/vendor/local/share/groonga/admin_html/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
  42. data/vendor/local/share/groonga/admin_html/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
  43. data/vendor/local/share/groonga/admin_html/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
  44. data/vendor/local/share/groonga/admin_html/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
  45. data/vendor/local/share/groonga/admin_html/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
  46. data/vendor/local/share/groonga/admin_html/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  47. data/vendor/local/share/groonga/admin_html/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
  48. data/vendor/local/share/groonga/admin_html/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
  49. data/vendor/local/share/groonga/admin_html/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
  50. data/vendor/local/share/groonga/admin_html/css/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
  51. data/vendor/local/share/groonga/admin_html/css/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
  52. data/vendor/local/share/groonga/admin_html/css/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
  53. data/vendor/local/share/groonga/admin_html/css/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
  54. data/vendor/local/share/groonga/admin_html/css/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
  55. data/vendor/local/share/groonga/admin_html/images/groonga.png +0 -0
  56. data/vendor/local/share/groonga/admin_html/images/loading.gif +0 -0
  57. data/vendor/local/share/groonga/admin_html/js/jquery.json-2.2.min.js +31 -0
  58. data/vendor/local/share/groonga/doc/ja/html/.buildinfo +4 -0
  59. data/vendor/local/share/groonga/doc/ja/html/_sources/characteristic.txt +56 -0
  60. data/vendor/local/share/groonga/doc/ja/html/_sources/commands.txt +10 -0
  61. data/vendor/local/share/groonga/doc/ja/html/_sources/commands/cache_limit.txt +52 -0
  62. data/vendor/local/share/groonga/doc/ja/html/_sources/commands/check.txt +164 -0
  63. data/vendor/local/share/groonga/doc/ja/html/_sources/commands/clearlock.txt +61 -0
  64. data/vendor/local/share/groonga/doc/ja/html/_sources/commands/column_create.txt +93 -0
  65. data/vendor/local/share/groonga/doc/ja/html/_sources/commands/column_list.txt +97 -0
  66. data/vendor/local/share/groonga/doc/ja/html/_sources/commands/column_remove.txt +58 -0
  67. data/vendor/local/share/groonga/doc/ja/html/_sources/commands/define_selector.txt +114 -0
  68. data/vendor/local/share/groonga/doc/ja/html/_sources/commands/defrag.txt +57 -0
  69. data/vendor/local/share/groonga/doc/ja/html/_sources/commands/delete.txt +68 -0
  70. data/vendor/local/share/groonga/doc/ja/html/_sources/commands/dump.txt +62 -0
  71. data/vendor/local/share/groonga/doc/ja/html/_sources/commands/load.txt +98 -0
  72. data/vendor/local/share/groonga/doc/ja/html/_sources/commands/log_level.txt +65 -0
  73. data/vendor/local/share/groonga/doc/ja/html/_sources/commands/log_put.txt +69 -0
  74. data/vendor/local/share/groonga/doc/ja/html/_sources/commands/log_reopen.txt +66 -0
  75. data/vendor/local/share/groonga/doc/ja/html/_sources/commands/quit.txt +38 -0
  76. data/vendor/local/share/groonga/doc/ja/html/_sources/commands/select.txt +247 -0
  77. data/vendor/local/share/groonga/doc/ja/html/_sources/commands/shutdown.txt +38 -0
  78. data/vendor/local/share/groonga/doc/ja/html/_sources/commands/status.txt +59 -0
  79. data/vendor/local/share/groonga/doc/ja/html/_sources/commands/suggest.txt +79 -0
  80. data/vendor/local/share/groonga/doc/ja/html/_sources/commands/table_create.txt +111 -0
  81. data/vendor/local/share/groonga/doc/ja/html/_sources/commands/table_list.txt +87 -0
  82. data/vendor/local/share/groonga/doc/ja/html/_sources/commands/table_remove.txt +50 -0
  83. data/vendor/local/share/groonga/doc/ja/html/_sources/commands/view_add.txt +53 -0
  84. data/vendor/local/share/groonga/doc/ja/html/_sources/commands_not_implemented/add.txt +102 -0
  85. data/vendor/local/share/groonga/doc/ja/html/_sources/commands_not_implemented/get.txt +78 -0
  86. data/vendor/local/share/groonga/doc/ja/html/_sources/commands_not_implemented/set.txt +103 -0
  87. data/vendor/local/share/groonga/doc/ja/html/_sources/developer.txt +10 -0
  88. data/vendor/local/share/groonga/doc/ja/html/_sources/developer/com.txt +18 -0
  89. data/vendor/local/share/groonga/doc/ja/html/_sources/developer/document.txt +38 -0
  90. data/vendor/local/share/groonga/doc/ja/html/_sources/developer/query.txt +212 -0
  91. data/vendor/local/share/groonga/doc/ja/html/_sources/developer/test.txt +114 -0
  92. data/vendor/local/share/groonga/doc/ja/html/_sources/execfile.txt +226 -0
  93. data/vendor/local/share/groonga/doc/ja/html/_sources/expr.txt +43 -0
  94. data/vendor/local/share/groonga/doc/ja/html/_sources/functions.txt +10 -0
  95. data/vendor/local/share/groonga/doc/ja/html/_sources/functions/edit_distance.txt +48 -0
  96. data/vendor/local/share/groonga/doc/ja/html/_sources/functions/geo_distance.txt +51 -0
  97. data/vendor/local/share/groonga/doc/ja/html/_sources/functions/geo_in_circle.txt +54 -0
  98. data/vendor/local/share/groonga/doc/ja/html/_sources/functions/geo_in_rectangle.txt +55 -0
  99. data/vendor/local/share/groonga/doc/ja/html/_sources/functions/now.txt +34 -0
  100. data/vendor/local/share/groonga/doc/ja/html/_sources/functions/rand.txt +41 -0
  101. data/vendor/local/share/groonga/doc/ja/html/_sources/grnslap.txt +64 -0
  102. data/vendor/local/share/groonga/doc/ja/html/_sources/grntest.txt +259 -0
  103. data/vendor/local/share/groonga/doc/ja/html/_sources/http.txt +52 -0
  104. data/vendor/local/share/groonga/doc/ja/html/_sources/index.txt +21 -0
  105. data/vendor/local/share/groonga/doc/ja/html/_sources/install.txt +114 -0
  106. data/vendor/local/share/groonga/doc/ja/html/_sources/news.txt +199 -0
  107. data/vendor/local/share/groonga/doc/ja/html/_sources/process.txt +12 -0
  108. data/vendor/local/share/groonga/doc/ja/html/_sources/pseudo_column.txt +38 -0
  109. data/vendor/local/share/groonga/doc/ja/html/_sources/reference.txt +14 -0
  110. data/vendor/local/share/groonga/doc/ja/html/_sources/tutorial.txt +10 -0
  111. data/vendor/local/share/groonga/doc/ja/html/_sources/tutorial/tutorial01.txt +293 -0
  112. data/vendor/local/share/groonga/doc/ja/html/_sources/tutorial/tutorial02.txt +100 -0
  113. data/vendor/local/share/groonga/doc/ja/html/_sources/tutorial/tutorial03.txt +72 -0
  114. data/vendor/local/share/groonga/doc/ja/html/_sources/tutorial/tutorial04.txt +111 -0
  115. data/vendor/local/share/groonga/doc/ja/html/_sources/tutorial/tutorial05.txt +65 -0
  116. data/vendor/local/share/groonga/doc/ja/html/_sources/tutorial/tutorial06.txt +91 -0
  117. data/vendor/local/share/groonga/doc/ja/html/_sources/tutorial/tutorial07.txt +92 -0
  118. data/vendor/local/share/groonga/doc/ja/html/_sources/tutorial/tutorial08.txt +53 -0
  119. data/vendor/local/share/groonga/doc/ja/html/_sources/tutorial/tutorial09.txt +9 -0
  120. data/vendor/local/share/groonga/doc/ja/html/_sources/tutorial/tutorial10.txt +486 -0
  121. data/vendor/local/share/groonga/doc/ja/html/_sources/type.txt +118 -0
  122. data/vendor/local/share/groonga/doc/ja/html/_static/basic.css +509 -0
  123. data/vendor/local/share/groonga/doc/ja/html/_static/default.css +277 -0
  124. data/vendor/local/share/groonga/doc/ja/html/_static/doctools.js +247 -0
  125. data/vendor/local/share/groonga/doc/ja/html/_static/file.png +0 -0
  126. data/vendor/local/share/groonga/doc/ja/html/_static/jquery.js +6240 -0
  127. data/vendor/local/share/groonga/doc/ja/html/_static/minus.png +0 -0
  128. data/vendor/local/share/groonga/doc/ja/html/_static/plus.png +0 -0
  129. data/vendor/local/share/groonga/doc/ja/html/_static/pygments.css +61 -0
  130. data/vendor/local/share/groonga/doc/ja/html/_static/searchtools.js +518 -0
  131. data/vendor/local/share/groonga/doc/ja/html/_static/sidebar.js +147 -0
  132. data/vendor/local/share/groonga/doc/ja/html/_static/underscore.js +16 -0
  133. data/vendor/local/share/groonga/doc/ja/html/characteristic.html +162 -0
  134. data/vendor/local/share/groonga/doc/ja/html/commands.html +139 -0
  135. data/vendor/local/share/groonga/doc/ja/html/commands/cache_limit.html +173 -0
  136. data/vendor/local/share/groonga/doc/ja/html/commands/check.html +285 -0
  137. data/vendor/local/share/groonga/doc/ja/html/commands/clearlock.html +180 -0
  138. data/vendor/local/share/groonga/doc/ja/html/commands/column_create.html +210 -0
  139. data/vendor/local/share/groonga/doc/ja/html/commands/column_list.html +220 -0
  140. data/vendor/local/share/groonga/doc/ja/html/commands/column_remove.html +183 -0
  141. data/vendor/local/share/groonga/doc/ja/html/commands/define_selector.html +221 -0
  142. data/vendor/local/share/groonga/doc/ja/html/commands/defrag.html +177 -0
  143. data/vendor/local/share/groonga/doc/ja/html/commands/delete.html +182 -0
  144. data/vendor/local/share/groonga/doc/ja/html/commands/dump.html +177 -0
  145. data/vendor/local/share/groonga/doc/ja/html/commands/load.html +208 -0
  146. data/vendor/local/share/groonga/doc/ja/html/commands/log_level.html +187 -0
  147. data/vendor/local/share/groonga/doc/ja/html/commands/log_put.html +190 -0
  148. data/vendor/local/share/groonga/doc/ja/html/commands/log_reopen.html +188 -0
  149. data/vendor/local/share/groonga/doc/ja/html/commands/quit.html +156 -0
  150. data/vendor/local/share/groonga/doc/ja/html/commands/select.html +331 -0
  151. data/vendor/local/share/groonga/doc/ja/html/commands/shutdown.html +156 -0
  152. data/vendor/local/share/groonga/doc/ja/html/commands/status.html +179 -0
  153. data/vendor/local/share/groonga/doc/ja/html/commands/suggest.html +191 -0
  154. data/vendor/local/share/groonga/doc/ja/html/commands/table_create.html +222 -0
  155. data/vendor/local/share/groonga/doc/ja/html/commands/table_list.html +202 -0
  156. data/vendor/local/share/groonga/doc/ja/html/commands/table_remove.html +173 -0
  157. data/vendor/local/share/groonga/doc/ja/html/commands/view_add.html +175 -0
  158. data/vendor/local/share/groonga/doc/ja/html/commands_not_implemented/add.html +180 -0
  159. data/vendor/local/share/groonga/doc/ja/html/commands_not_implemented/get.html +161 -0
  160. data/vendor/local/share/groonga/doc/ja/html/commands_not_implemented/set.html +182 -0
  161. data/vendor/local/share/groonga/doc/ja/html/developer.html +118 -0
  162. data/vendor/local/share/groonga/doc/ja/html/developer/com.html +136 -0
  163. data/vendor/local/share/groonga/doc/ja/html/developer/document.html +159 -0
  164. data/vendor/local/share/groonga/doc/ja/html/developer/query.html +336 -0
  165. data/vendor/local/share/groonga/doc/ja/html/developer/test.html +220 -0
  166. data/vendor/local/share/groonga/doc/ja/html/execfile.html +370 -0
  167. data/vendor/local/share/groonga/doc/ja/html/expr.html +157 -0
  168. data/vendor/local/share/groonga/doc/ja/html/functions.html +122 -0
  169. data/vendor/local/share/groonga/doc/ja/html/functions/edit_distance.html +162 -0
  170. data/vendor/local/share/groonga/doc/ja/html/functions/geo_distance.html +170 -0
  171. data/vendor/local/share/groonga/doc/ja/html/functions/geo_in_circle.html +173 -0
  172. data/vendor/local/share/groonga/doc/ja/html/functions/geo_in_rectangle.html +172 -0
  173. data/vendor/local/share/groonga/doc/ja/html/functions/now.html +152 -0
  174. data/vendor/local/share/groonga/doc/ja/html/functions/rand.html +159 -0
  175. data/vendor/local/share/groonga/doc/ja/html/genindex.html +227 -0
  176. data/vendor/local/share/groonga/doc/ja/html/grnslap.html +183 -0
  177. data/vendor/local/share/groonga/doc/ja/html/grntest.html +368 -0
  178. data/vendor/local/share/groonga/doc/ja/html/http.html +163 -0
  179. data/vendor/local/share/groonga/doc/ja/html/index.html +291 -0
  180. data/vendor/local/share/groonga/doc/ja/html/install.html +228 -0
  181. data/vendor/local/share/groonga/doc/ja/html/news.html +310 -0
  182. data/vendor/local/share/groonga/doc/ja/html/objects.inv +0 -0
  183. data/vendor/local/share/groonga/doc/ja/html/process.html +120 -0
  184. data/vendor/local/share/groonga/doc/ja/html/pseudo_column.html +147 -0
  185. data/vendor/local/share/groonga/doc/ja/html/reference.html +174 -0
  186. data/vendor/local/share/groonga/doc/ja/html/search.html +96 -0
  187. data/vendor/local/share/groonga/doc/ja/html/searchindex.js +1 -0
  188. data/vendor/local/share/groonga/doc/ja/html/tutorial.html +172 -0
  189. data/vendor/local/share/groonga/doc/ja/html/tutorial/tutorial01.html +388 -0
  190. data/vendor/local/share/groonga/doc/ja/html/tutorial/tutorial02.html +214 -0
  191. data/vendor/local/share/groonga/doc/ja/html/tutorial/tutorial03.html +183 -0
  192. data/vendor/local/share/groonga/doc/ja/html/tutorial/tutorial04.html +212 -0
  193. data/vendor/local/share/groonga/doc/ja/html/tutorial/tutorial05.html +169 -0
  194. data/vendor/local/share/groonga/doc/ja/html/tutorial/tutorial06.html +209 -0
  195. data/vendor/local/share/groonga/doc/ja/html/tutorial/tutorial07.html +212 -0
  196. data/vendor/local/share/groonga/doc/ja/html/tutorial/tutorial08.html +139 -0
  197. data/vendor/local/share/groonga/doc/ja/html/tutorial/tutorial09.html +114 -0
  198. data/vendor/local/share/groonga/doc/ja/html/tutorial/tutorial10.html +458 -0
  199. data/vendor/local/share/groonga/doc/ja/html/type.html +217 -0
  200. data/vendor/local/share/groonga/doc/ja/source/__init__.py +0 -0
  201. data/vendor/local/share/groonga/doc/ja/source/characteristic.txt +56 -0
  202. data/vendor/local/share/groonga/doc/ja/source/commands.txt +10 -0
  203. data/vendor/local/share/groonga/doc/ja/source/commands/cache_limit.txt +52 -0
  204. data/vendor/local/share/groonga/doc/ja/source/commands/check.txt +164 -0
  205. data/vendor/local/share/groonga/doc/ja/source/commands/clearlock.txt +61 -0
  206. data/vendor/local/share/groonga/doc/ja/source/commands/column_create.txt +93 -0
  207. data/vendor/local/share/groonga/doc/ja/source/commands/column_list.txt +97 -0
  208. data/vendor/local/share/groonga/doc/ja/source/commands/column_remove.txt +58 -0
  209. data/vendor/local/share/groonga/doc/ja/source/commands/define_selector.txt +114 -0
  210. data/vendor/local/share/groonga/doc/ja/source/commands/defrag.txt +57 -0
  211. data/vendor/local/share/groonga/doc/ja/source/commands/delete.txt +68 -0
  212. data/vendor/local/share/groonga/doc/ja/source/commands/dump.txt +62 -0
  213. data/vendor/local/share/groonga/doc/ja/source/commands/load.txt +98 -0
  214. data/vendor/local/share/groonga/doc/ja/source/commands/log_level.txt +65 -0
  215. data/vendor/local/share/groonga/doc/ja/source/commands/log_put.txt +69 -0
  216. data/vendor/local/share/groonga/doc/ja/source/commands/log_reopen.txt +66 -0
  217. data/vendor/local/share/groonga/doc/ja/source/commands/quit.txt +38 -0
  218. data/vendor/local/share/groonga/doc/ja/source/commands/select.txt +247 -0
  219. data/vendor/local/share/groonga/doc/ja/source/commands/shutdown.txt +38 -0
  220. data/vendor/local/share/groonga/doc/ja/source/commands/status.txt +59 -0
  221. data/vendor/local/share/groonga/doc/ja/source/commands/table_create.txt +111 -0
  222. data/vendor/local/share/groonga/doc/ja/source/commands/table_list.txt +87 -0
  223. data/vendor/local/share/groonga/doc/ja/source/commands/table_remove.txt +50 -0
  224. data/vendor/local/share/groonga/doc/ja/source/commands/view_add.txt +53 -0
  225. data/vendor/local/share/groonga/doc/ja/source/commands_not_implemented/add.txt +102 -0
  226. data/vendor/local/share/groonga/doc/ja/source/commands_not_implemented/get.txt +78 -0
  227. data/vendor/local/share/groonga/doc/ja/source/commands_not_implemented/set.txt +103 -0
  228. data/vendor/local/share/groonga/doc/ja/source/conf.py +265 -0
  229. data/vendor/local/share/groonga/doc/ja/source/developer.txt +10 -0
  230. data/vendor/local/share/groonga/doc/ja/source/developer/com.txt +18 -0
  231. data/vendor/local/share/groonga/doc/ja/source/developer/document.txt +38 -0
  232. data/vendor/local/share/groonga/doc/ja/source/developer/query.txt +212 -0
  233. data/vendor/local/share/groonga/doc/ja/source/developer/test.txt +114 -0
  234. data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-1.log +6 -0
  235. data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-10.log +5 -0
  236. data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-11.log +5 -0
  237. data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-12.log +5 -0
  238. data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-13.log +5 -0
  239. data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-14.log +9 -0
  240. data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-15.log +5 -0
  241. data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-16.log +5 -0
  242. data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-17.log +5 -0
  243. data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-2.log +5 -0
  244. data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-3.log +5 -0
  245. data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-4.log +7 -0
  246. data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-5.log +5 -0
  247. data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-6.log +5 -0
  248. data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-7.log +16 -0
  249. data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-8.log +5 -0
  250. data/vendor/local/share/groonga/doc/ja/source/example/tutorial01-9.log +5 -0
  251. data/vendor/local/share/groonga/doc/ja/source/example/tutorial02-1.log +8 -0
  252. data/vendor/local/share/groonga/doc/ja/source/example/tutorial02-2.log +6 -0
  253. data/vendor/local/share/groonga/doc/ja/source/example/tutorial02-3.log +12 -0
  254. data/vendor/local/share/groonga/doc/ja/source/example/tutorial03-1.log +18 -0
  255. data/vendor/local/share/groonga/doc/ja/source/example/tutorial03-2.log +10 -0
  256. data/vendor/local/share/groonga/doc/ja/source/example/tutorial03-3.log +10 -0
  257. data/vendor/local/share/groonga/doc/ja/source/example/tutorial04-1.log +5 -0
  258. data/vendor/local/share/groonga/doc/ja/source/example/tutorial04-2.log +7 -0
  259. data/vendor/local/share/groonga/doc/ja/source/example/tutorial04-3.log +7 -0
  260. data/vendor/local/share/groonga/doc/ja/source/example/tutorial04-4.log +13 -0
  261. data/vendor/local/share/groonga/doc/ja/source/example/tutorial04-5.log +5 -0
  262. data/vendor/local/share/groonga/doc/ja/source/example/tutorial04-6.log +5 -0
  263. data/vendor/local/share/groonga/doc/ja/source/example/tutorial04-7.log +5 -0
  264. data/vendor/local/share/groonga/doc/ja/source/example/tutorial05-1.log +24 -0
  265. data/vendor/local/share/groonga/doc/ja/source/example/tutorial05-2.log +5 -0
  266. data/vendor/local/share/groonga/doc/ja/source/example/tutorial05-3.log +5 -0
  267. data/vendor/local/share/groonga/doc/ja/source/example/tutorial05-4.log +5 -0
  268. data/vendor/local/share/groonga/doc/ja/source/example/tutorial05-5.log +5 -0
  269. data/vendor/local/share/groonga/doc/ja/source/example/tutorial05-6.log +5 -0
  270. data/vendor/local/share/groonga/doc/ja/source/example/tutorial06-1.log +25 -0
  271. data/vendor/local/share/groonga/doc/ja/source/example/tutorial06-2.log +9 -0
  272. data/vendor/local/share/groonga/doc/ja/source/example/tutorial06-3.log +21 -0
  273. data/vendor/local/share/groonga/doc/ja/source/example/tutorial06-4.log +7 -0
  274. data/vendor/local/share/groonga/doc/ja/source/example/tutorial06-5.log +5 -0
  275. data/vendor/local/share/groonga/doc/ja/source/example/tutorial07-1.log +22 -0
  276. data/vendor/local/share/groonga/doc/ja/source/example/tutorial07-2.log +9 -0
  277. data/vendor/local/share/groonga/doc/ja/source/example/tutorial07-3.log +20 -0
  278. data/vendor/local/share/groonga/doc/ja/source/example/tutorial07-4.log +9 -0
  279. data/vendor/local/share/groonga/doc/ja/source/example/tutorial08-1.log +14 -0
  280. data/vendor/local/share/groonga/doc/ja/source/example/tutorial10-1.log +5 -0
  281. data/vendor/local/share/groonga/doc/ja/source/example/tutorial10-10.log +5 -0
  282. data/vendor/local/share/groonga/doc/ja/source/example/tutorial10-2.log +5 -0
  283. data/vendor/local/share/groonga/doc/ja/source/example/tutorial10-3.log +5 -0
  284. data/vendor/local/share/groonga/doc/ja/source/example/tutorial10-4.log +5 -0
  285. data/vendor/local/share/groonga/doc/ja/source/example/tutorial10-5.log +5 -0
  286. data/vendor/local/share/groonga/doc/ja/source/example/tutorial10-6.log +5 -0
  287. data/vendor/local/share/groonga/doc/ja/source/example/tutorial10-7.log +5 -0
  288. data/vendor/local/share/groonga/doc/ja/source/example/tutorial10-8.log +5 -0
  289. data/vendor/local/share/groonga/doc/ja/source/example/tutorial10-9.log +5 -0
  290. data/vendor/local/share/groonga/doc/ja/source/execfile.txt +226 -0
  291. data/vendor/local/share/groonga/doc/ja/source/expr.txt +43 -0
  292. data/vendor/local/share/groonga/doc/ja/source/functions.txt +10 -0
  293. data/vendor/local/share/groonga/doc/ja/source/functions/edit_distance.txt +48 -0
  294. data/vendor/local/share/groonga/doc/ja/source/functions/geo_distance.txt +51 -0
  295. data/vendor/local/share/groonga/doc/ja/source/functions/geo_in_circle.txt +54 -0
  296. data/vendor/local/share/groonga/doc/ja/source/functions/geo_in_rectangle.txt +55 -0
  297. data/vendor/local/share/groonga/doc/ja/source/functions/now.txt +34 -0
  298. data/vendor/local/share/groonga/doc/ja/source/functions/rand.txt +41 -0
  299. data/vendor/local/share/groonga/doc/ja/source/grnslap.txt +64 -0
  300. data/vendor/local/share/groonga/doc/ja/source/grntest.txt +259 -0
  301. data/vendor/local/share/groonga/doc/ja/source/http.txt +52 -0
  302. data/vendor/local/share/groonga/doc/ja/source/index.txt +21 -0
  303. data/vendor/local/share/groonga/doc/ja/source/install.txt +114 -0
  304. data/vendor/local/share/groonga/doc/ja/source/news.txt +199 -0
  305. data/vendor/local/share/groonga/doc/ja/source/process.txt +12 -0
  306. data/vendor/local/share/groonga/doc/ja/source/pseudo_column.txt +38 -0
  307. data/vendor/local/share/groonga/doc/ja/source/rdoc.py +762 -0
  308. data/vendor/local/share/groonga/doc/ja/source/reference.txt +14 -0
  309. data/vendor/local/share/groonga/doc/ja/source/tutorial.txt +10 -0
  310. data/vendor/local/share/groonga/doc/ja/source/tutorial/tutorial01.txt +293 -0
  311. data/vendor/local/share/groonga/doc/ja/source/tutorial/tutorial02.txt +100 -0
  312. data/vendor/local/share/groonga/doc/ja/source/tutorial/tutorial03.txt +72 -0
  313. data/vendor/local/share/groonga/doc/ja/source/tutorial/tutorial04.txt +111 -0
  314. data/vendor/local/share/groonga/doc/ja/source/tutorial/tutorial05.txt +65 -0
  315. data/vendor/local/share/groonga/doc/ja/source/tutorial/tutorial06.txt +91 -0
  316. data/vendor/local/share/groonga/doc/ja/source/tutorial/tutorial07.txt +92 -0
  317. data/vendor/local/share/groonga/doc/ja/source/tutorial/tutorial08.txt +53 -0
  318. data/vendor/local/share/groonga/doc/ja/source/tutorial/tutorial09.txt +9 -0
  319. data/vendor/local/share/groonga/doc/ja/source/tutorial/tutorial10.txt +486 -0
  320. data/vendor/local/share/groonga/doc/ja/source/type.txt +118 -0
  321. data/vendor/local/share/groonga/doc/ja/source/update_execution_example.py +113 -0
  322. data/vendor/local/share/groonga/examples/dictionary/edict/edict2grn.rb +46 -0
  323. data/vendor/local/share/groonga/examples/dictionary/edict/edict_import.sh +10 -0
  324. data/vendor/local/share/groonga/examples/dictionary/eijiro/eijiro2grn.rb +61 -0
  325. data/vendor/local/share/groonga/examples/dictionary/eijiro/eijiro_import.sh +10 -0
  326. data/vendor/local/share/groonga/examples/dictionary/gene95/gene2grn.rb +46 -0
  327. data/vendor/local/share/groonga/examples/dictionary/gene95/gene_import.sh +10 -0
  328. data/vendor/local/share/groonga/examples/dictionary/html/css/dictionary.css +3 -0
  329. data/vendor/local/share/groonga/examples/dictionary/html/index.html +26 -0
  330. data/vendor/local/share/groonga/examples/dictionary/html/js/dictionary.js +51 -0
  331. data/vendor/local/share/groonga/examples/dictionary/html/js/jquery-1.4.2.min.js +154 -0
  332. data/vendor/local/share/groonga/examples/dictionary/init_db.sh +10 -0
  333. data/vendor/local/share/groonga/examples/dictionary/jmdict/jmdict.rb +42 -0
  334. data/vendor/local/share/groonga/examples/dictionary/readme.txt +71 -0
  335. data/vendor/local/share/man/man1/groonga.1 +5498 -0
  336. metadata +360 -118
  337. data/pkg-config.rb +0 -333
  338. data/pkg/rroonga-0.9.5/NEWS.ja.rdoc +0 -156
  339. data/pkg/rroonga-0.9.5/NEWS.rdoc +0 -158
  340. data/pkg/rroonga-0.9.5/README.ja.rdoc +0 -65
  341. data/pkg/rroonga-0.9.5/README.rdoc +0 -66
  342. data/pkg/rroonga-0.9.5/text/TUTORIAL.ja.rdoc +0 -394
  343. data/pkg/rroonga-0.9.5/text/expression.rdoc +0 -285
  344. data/test-unit/Rakefile +0 -40
  345. data/test-unit/TODO +0 -5
  346. data/test-unit/bin/testrb +0 -5
  347. data/test-unit/html/classic.html +0 -15
  348. data/test-unit/html/index.html +0 -25
  349. data/test-unit/html/index.html.ja +0 -27
  350. data/test-unit/lib/test/unit.rb +0 -323
  351. data/test-unit/lib/test/unit/assertionfailederror.rb +0 -25
  352. data/test-unit/lib/test/unit/assertions.rb +0 -1230
  353. data/test-unit/lib/test/unit/attribute.rb +0 -125
  354. data/test-unit/lib/test/unit/autorunner.rb +0 -360
  355. data/test-unit/lib/test/unit/collector.rb +0 -36
  356. data/test-unit/lib/test/unit/collector/descendant.rb +0 -23
  357. data/test-unit/lib/test/unit/collector/dir.rb +0 -108
  358. data/test-unit/lib/test/unit/collector/load.rb +0 -144
  359. data/test-unit/lib/test/unit/collector/objectspace.rb +0 -34
  360. data/test-unit/lib/test/unit/color-scheme.rb +0 -102
  361. data/test-unit/lib/test/unit/color.rb +0 -96
  362. data/test-unit/lib/test/unit/diff.rb +0 -724
  363. data/test-unit/lib/test/unit/error.rb +0 -130
  364. data/test-unit/lib/test/unit/exceptionhandler.rb +0 -39
  365. data/test-unit/lib/test/unit/failure.rb +0 -136
  366. data/test-unit/lib/test/unit/fixture.rb +0 -176
  367. data/test-unit/lib/test/unit/notification.rb +0 -129
  368. data/test-unit/lib/test/unit/omission.rb +0 -191
  369. data/test-unit/lib/test/unit/pending.rb +0 -150
  370. data/test-unit/lib/test/unit/priority.rb +0 -180
  371. data/test-unit/lib/test/unit/runner/console.rb +0 -52
  372. data/test-unit/lib/test/unit/runner/emacs.rb +0 -8
  373. data/test-unit/lib/test/unit/runner/tap.rb +0 -8
  374. data/test-unit/lib/test/unit/testcase.rb +0 -476
  375. data/test-unit/lib/test/unit/testresult.rb +0 -89
  376. data/test-unit/lib/test/unit/testsuite.rb +0 -110
  377. data/test-unit/lib/test/unit/ui/console/outputlevel.rb +0 -14
  378. data/test-unit/lib/test/unit/ui/console/testrunner.rb +0 -466
  379. data/test-unit/lib/test/unit/ui/emacs/testrunner.rb +0 -63
  380. data/test-unit/lib/test/unit/ui/tap/testrunner.rb +0 -92
  381. data/test-unit/lib/test/unit/ui/testrunner.rb +0 -28
  382. data/test-unit/lib/test/unit/ui/testrunnermediator.rb +0 -77
  383. data/test-unit/lib/test/unit/ui/testrunnerutilities.rb +0 -41
  384. data/test-unit/lib/test/unit/util/backtracefilter.rb +0 -41
  385. data/test-unit/lib/test/unit/util/method-owner-finder.rb +0 -28
  386. data/test-unit/lib/test/unit/util/observable.rb +0 -90
  387. data/test-unit/lib/test/unit/util/procwrapper.rb +0 -48
  388. data/test-unit/lib/test/unit/version.rb +0 -7
  389. data/test-unit/sample/adder.rb +0 -13
  390. data/test-unit/sample/subtracter.rb +0 -12
  391. data/test-unit/sample/test_adder.rb +0 -20
  392. data/test-unit/sample/test_subtracter.rb +0 -20
  393. data/test-unit/sample/test_user.rb +0 -23
  394. data/test-unit/test/collector/test-descendant.rb +0 -133
  395. data/test-unit/test/collector/test-load.rb +0 -442
  396. data/test-unit/test/collector/test_dir.rb +0 -406
  397. data/test-unit/test/collector/test_objectspace.rb +0 -100
  398. data/test-unit/test/run-test.rb +0 -15
  399. data/test-unit/test/test-attribute.rb +0 -86
  400. data/test-unit/test/test-color-scheme.rb +0 -67
  401. data/test-unit/test/test-color.rb +0 -47
  402. data/test-unit/test/test-diff.rb +0 -518
  403. data/test-unit/test/test-emacs-runner.rb +0 -60
  404. data/test-unit/test/test-fixture.rb +0 -287
  405. data/test-unit/test/test-notification.rb +0 -33
  406. data/test-unit/test/test-omission.rb +0 -81
  407. data/test-unit/test/test-pending.rb +0 -70
  408. data/test-unit/test/test-priority.rb +0 -119
  409. data/test-unit/test/test-testcase.rb +0 -544
  410. data/test-unit/test/test_assertions.rb +0 -1151
  411. data/test-unit/test/test_error.rb +0 -26
  412. data/test-unit/test/test_failure.rb +0 -33
  413. data/test-unit/test/test_testresult.rb +0 -113
  414. data/test-unit/test/test_testsuite.rb +0 -129
  415. data/test-unit/test/testunit-test-util.rb +0 -14
  416. data/test-unit/test/ui/test_testrunmediator.rb +0 -20
  417. data/test-unit/test/util/test-method-owner-finder.rb +0 -38
  418. data/test-unit/test/util/test_backtracefilter.rb +0 -41
  419. data/test-unit/test/util/test_observable.rb +0 -102
  420. data/test-unit/test/util/test_procwrapper.rb +0 -36
  421. data/vendor/local/lib/groonga/modules/functions/cast.dll +0 -0
data/NEWS.ja.rdoc CHANGED
@@ -1,5 +1,29 @@
1
1
  = お知らせ
2
2
 
3
+ == 1.0.1: 2010-09-12
4
+
5
+ === 修正
6
+
7
+ * テーブル作成時に誤ったフラグを指定していた問題を修正。
8
+ [小野マトペさんが報告]
9
+
10
+ === 感謝
11
+
12
+ * 小野マトペさん
13
+
14
+ == 1.0.0: 2010-08-29
15
+
16
+ * groonga 1.0.0対応。
17
+ * Groonga::CASErrorを追加。
18
+ * Groonga::Table#open_cursorに:order_byオプションを追加。
19
+ * 前方一致検索がマッチしたレコードを順に取り出すカーソルを作る
20
+ Groonga::PatriciaTrie#open_prefix_cursorを追加。
21
+ * ローマ字・ひらがなでカタカナのキーを検索するカーソルを作る
22
+ Groonga::PatriciaTrie#open_rk_cursorを追加。
23
+ * 値の近い順にレコードを取り出すカーソルを作る
24
+ Groonga::PatriciaTrie#open_near_cursorを追加。
25
+ * インデックスのソースに_keyを指定できるようになった。
26
+
3
27
  == 0.9.5: 2010-07-29
4
28
 
5
29
  * groonga 0.7.4対応。
data/NEWS.rdoc CHANGED
@@ -1,5 +1,29 @@
1
1
  = NEWS
2
2
 
3
+ == 1.0.1: 2010-09-12
4
+
5
+ === Fixes
6
+
7
+ * Fixed wrong flag used on creating a table.
8
+ [Reported by ono matope]
9
+
10
+ === Thanks
11
+
12
+ * ono matope
13
+
14
+ == 1.0.0: 2010-08-29
15
+
16
+ * Supported groonga 1.0.0.
17
+ * Added Groonga::CASError.
18
+ * Added :order_by option to Groonga::Table#open_cursor.
19
+ * Added Groonga::PatriciaTrie#open_prefix_cursor that creates a cursor
20
+ to retrieve each records by prefix search.
21
+ * Added Groonga::PatriciaTrie#open_rk_cursor that creats a cursor to
22
+ retrieve katakana keys from roman letters and/or hiragana.
23
+ * Added Groonga::PatriciaTrie#open_near_cursor that creates a cursor to
24
+ retrieve records order by distance from key.
25
+ * Supported _key as index source.
26
+
3
27
  == 0.9.5: 2010-07-20
4
28
 
5
29
  * Supported groonga 0.7.4.
data/README.ja.rdoc CHANGED
@@ -35,8 +35,8 @@ pkg-config.rbはrcairoに付属しているもので、これはRubyライセ
35
35
 
36
36
  == 依存ソフトウェア
37
37
 
38
- * Ruby >= 1.8 (1.9.1対応)
39
- * groonga >= 0.1.9
38
+ * Ruby >= 1.8 (1.9.1, 1.9.2対応)
39
+ * groonga >= 1.0.0
40
40
 
41
41
  == インストール
42
42
 
@@ -63,3 +63,4 @@ http://lists.sourceforge.jp/mailman/listinfo/groonga-dev
63
63
  * id:mat_akiさん: チュートリアルのバグを教えてくれました。
64
64
  * @yune_kotomi: バグレポートしてくれました。
65
65
  * 咳さん: バグレポートしてくれました。
66
+ * 小野マトペさん: バグレポートしてくれました。
data/README.rdoc CHANGED
@@ -36,8 +36,8 @@ license/GPL for details.
36
36
 
37
37
  == Dependencies
38
38
 
39
- * Ruby >= 1.8 (including 1.9.1)
40
- * groonga >= 0.1.9
39
+ * Ruby >= 1.8 (including 1.9.1 and 1.9.2)
40
+ * groonga >= 1.0.0
41
41
 
42
42
  == Install
43
43
 
@@ -64,3 +64,4 @@ http://rubyforge.org/mailman/listinfo/groonga-users-en
64
64
  * id:mat_aki: sent bug reports.
65
65
  * @yune_kotomi: sent a bug report.
66
66
  * m_seki: sent bug reports.
67
+ * ono matope: sent bug reports.
data/Rakefile CHANGED
@@ -49,13 +49,10 @@ manifest_contents = []
49
49
  base_dir_included_components = %w(AUTHORS Rakefile
50
50
  README.rdoc README.ja.rdoc
51
51
  NEWS.rdoc NEWS.ja.rdoc
52
- rroonga-build.rb extconf.rb pkg-config.rb)
52
+ rroonga-build.rb extconf.rb)
53
53
  excluded_components = %w(.cvsignore .gdb_history CVS depend Makefile doc pkg
54
- .svn .git doc data .test-result tmp)
54
+ .svn .git doc data .test-result tmp vendor)
55
55
  excluded_suffixes = %w(.png .ps .pdf .o .so .a .txt .~)
56
- unless ENV["RUBY_CC_VERSION"]
57
- excluded_components << "vendor"
58
- end
59
56
  Find.find(base_dir) do |target|
60
57
  target = truncate_base_dir[target]
61
58
  components = target.split(File::SEPARATOR)
@@ -110,6 +107,7 @@ Hoe.spec('rroonga') do
110
107
  :require_paths => ["lib", "ext/groonga"],
111
108
  :extra_rdoc_files => Dir.glob("**/*.rdoc"),
112
109
  }
110
+ project.extra_dev_deps << ['pkg-config', '>= 0']
113
111
  project.readme_file = "README.ja.rdoc"
114
112
 
115
113
  news_of_current_release = File.read("NEWS.rdoc").split(/^==\s.*$/)[1]
@@ -135,9 +133,20 @@ ObjectSpace.each_object(Rake::RDocTask) do |rdoc_task|
135
133
  rdoc_task.rdoc_files += Dir.glob("**/*.rdoc")
136
134
  end
137
135
 
136
+ binary_dir = File.join("vendor", "local")
138
137
  Rake::ExtensionTask.new("groonga", project.spec) do |ext|
139
138
  ext.cross_compile = true
140
- ext.cross_platform = 'x86-mingw32'
139
+ ext.cross_compiling do |spec|
140
+ if /mingw|mswin/ =~ spec.platform.to_s
141
+ binary_files = []
142
+ Find.find(binary_dir) do |name|
143
+ next unless File.file?(name)
144
+ next if /\.zip\z/i =~ name
145
+ binary_files << name
146
+ end
147
+ spec.files += binary_files
148
+ end
149
+ end
141
150
  end
142
151
 
143
152
  task :publish_docs => [:prepare_docs_for_publishing]
@@ -22,29 +22,21 @@ $LOAD_PATH.unshift(base_dir.to_s)
22
22
 
23
23
  require 'English'
24
24
  require 'mkmf'
25
- require 'pkg-config'
26
25
  require 'rroonga-build'
27
26
 
27
+ begin
28
+ require 'pkg-config'
29
+ rescue LoadError
30
+ require 'rubygems'
31
+ require 'pkg-config'
32
+ end
33
+
28
34
  include RroongaBuild
29
35
 
30
36
  package_name = "groonga"
31
37
  module_name = "groonga"
32
38
  major, minor, micro = RequiredGroongaVersion::VERSION
33
39
 
34
- unless PKGConfig.have_package(package_name, major, minor, micro)
35
- have_local_groonga?(package_name, major, minor, micro) or exit 1
36
- add_rpath_for_local_groonga
37
- end
38
-
39
- real_version = PKGConfig.modversion(package_name)
40
- real_major, real_minor, real_micro = real_version.split(/\./)
41
-
42
- $defs << "-DRB_GRN_COMPILATION"
43
-
44
- $defs << "-DGRN_MAJOR_VERSION=#{real_major}"
45
- $defs << "-DGRN_MINOR_VERSION=#{real_minor}"
46
- $defs << "-DGRN_MICRO_VERSION=#{real_micro}"
47
-
48
40
  checking_for(checking_message("GCC")) do
49
41
  if macro_defined?("__GNUC__", "")
50
42
  $CFLAGS += ' -Wall'
@@ -61,20 +53,28 @@ checking_for(checking_message("Win32 OS")) do
61
53
  import_library_name = "libruby-#{module_name}.a"
62
54
  $DLDFLAGS << " -Wl,--out-implib=#{import_library_name}"
63
55
  $cleanfiles << import_library_name
64
- local_groonga_install_dir = base_dir + "vendor" + "local"
65
- $CFLAGS += " -I#{local_groonga_install_dir}/include"
66
- local_groonga_lib_dir = local_groonga_install_dir + "lib"
67
- ["libgroonga.lib", "libgroonga.dll.a"].each do |libgroonga_base|
68
- libgroonga = local_groonga_lib_dir + libgroonga_base
69
- if libgroonga.exist?
70
- $DLDFLAGS += " -L#{local_groonga_lib_dir}"
71
- break
72
- end
73
- end
56
+ binary_base_dir = base_dir + "vendor" + "local"
57
+ pkg_config_dir = binary_base_dir + "lib" + "pkgconfig"
58
+ PKGConfig.add_path(pkg_config_dir.to_s)
59
+ PKGConfig.set_override_variable("prefix", binary_base_dir.to_s)
74
60
  end
75
61
  win32
76
62
  end
77
63
 
64
+ unless PKGConfig.have_package(package_name, major, minor, micro)
65
+ have_local_groonga?(package_name, major, minor, micro) or exit 1
66
+ add_rpath_for_local_groonga
67
+ end
68
+
69
+ real_version = PKGConfig.modversion(package_name)
70
+ real_major, real_minor, real_micro = real_version.split(/\./)
71
+
72
+ $defs << "-DRB_GRN_COMPILATION"
73
+
74
+ $defs << "-DGRN_MAJOR_VERSION=#{real_major}"
75
+ $defs << "-DGRN_MINOR_VERSION=#{real_minor}"
76
+ $defs << "-DGRN_MICRO_VERSION=#{real_micro}"
77
+
78
78
  have_header("ruby/st.h") unless have_macro("HAVE_RUBY_ST_H", "ruby.h")
79
79
  have_func("rb_errinfo", "ruby.h")
80
80
  have_type("enum ruby_value_type", "ruby.h")
@@ -0,0 +1,2 @@
1
+ EXPORTS
2
+ Init_groonga
@@ -97,7 +97,7 @@ rb_grn_array_s_create (int argc, VALUE *argv, VALUE klass)
97
97
  grn_obj *value_type = NULL, *table;
98
98
  const char *name = NULL, *path = NULL;
99
99
  unsigned name_size = 0;
100
- grn_obj_flags flags = GRN_TABLE_NO_KEY;
100
+ grn_obj_flags flags = GRN_OBJ_TABLE_NO_KEY;
101
101
  VALUE rb_table;
102
102
  VALUE options, rb_context, rb_name, rb_path, rb_persistent;
103
103
  VALUE rb_value_type, rb_sub_records;
@@ -92,6 +92,7 @@ static VALUE eGrnUpdateNotAllowed;
92
92
  static VALUE eGrnTooSmallOffset;
93
93
  static VALUE eGrnTooLargeOffset;
94
94
  static VALUE eGrnTooSmallLimit;
95
+ static VALUE eGrnCASError;
95
96
 
96
97
  VALUE
97
98
  rb_grn_rc_to_exception (grn_rc rc)
@@ -312,6 +313,9 @@ rb_grn_rc_to_exception (grn_rc rc)
312
313
  case GRN_TOO_SMALL_LIMIT:
313
314
  exception = eGrnTooSmallLimit;
314
315
  break;
316
+ case GRN_CAS_ERROR:
317
+ exception = eGrnCASError;
318
+ break;
315
319
  }
316
320
 
317
321
  if (NIL_P(exception))
@@ -539,6 +543,9 @@ rb_grn_rc_to_message (grn_rc rc)
539
543
  case GRN_TOO_SMALL_LIMIT:
540
544
  message = "too small limit";
541
545
  break;
546
+ case GRN_CAS_ERROR:
547
+ message = "CAS error";
548
+ break;
542
549
  }
543
550
 
544
551
  if (!message)
@@ -1152,4 +1159,11 @@ rb_grn_init_exception (VALUE mGrn)
1152
1159
  */
1153
1160
  eGrnTooSmallLimit =
1154
1161
  rb_define_class_under(mGrn, "TooSmallLimit", rb_eGrnError);
1162
+
1163
+ /*
1164
+ * Document-class: Groonga::CASError
1165
+ *
1166
+ * CAS(Compare and Swap)が失敗したときに発生する。
1167
+ */
1168
+ eGrnCASError = rb_define_class_under(mGrn, "CASError", rb_eGrnError);
1155
1169
  }
@@ -152,7 +152,7 @@ rb_grn_hash_s_create (int argc, VALUE *argv, VALUE klass)
152
152
  grn_obj *key_type = NULL, *value_type = NULL, *table;
153
153
  const char *name = NULL, *path = NULL;
154
154
  unsigned name_size = 0;
155
- grn_obj_flags flags = GRN_TABLE_HASH_KEY;
155
+ grn_obj_flags flags = GRN_OBJ_TABLE_HASH_KEY;
156
156
  VALUE rb_table;
157
157
  VALUE options, rb_context, rb_name, rb_path, rb_persistent;
158
158
  VALUE rb_key_normalize, rb_key_type, rb_value_type, rb_default_tokenizer;
@@ -307,7 +307,19 @@ resolve_source_id (grn_ctx *context, grn_obj *column, VALUE rb_source)
307
307
  source = RVAL2GRNOBJECT(rb_source, &context);
308
308
  }
309
309
  rb_grn_context_check(context, rb_source);
310
- source_id = grn_obj_id(context, source);
310
+ if (source->header.type == GRN_ACCESSOR) {
311
+ char name[256];
312
+ int length;
313
+ length = grn_column_name(context, source, name, sizeof(name));
314
+ name[length] = '\0';
315
+ if (strcmp(name, "_key") != 0) {
316
+ rb_raise(rb_eArgError,
317
+ "source accessor must be '_key': <%s>", name);
318
+ }
319
+ source_id = grn_obj_id(context, column);
320
+ } else {
321
+ source_id = grn_obj_id(context, source);
322
+ }
311
323
  }
312
324
 
313
325
  return source_id;
@@ -766,8 +766,8 @@ rb_grn_object_inspect_content_flags_with_label (VALUE inspected,
766
766
  rb_ary_push(inspected_flags, rb_str_new2("WITH_WEIGHT"));
767
767
  if (flags & GRN_OBJ_WITH_POSITION)
768
768
  rb_ary_push(inspected_flags, rb_str_new2("WITH_POSITION"));
769
- if (flags & GRN_OBJ_WITH_BUFFER)
770
- rb_ary_push(inspected_flags, rb_str_new2("WITH_BUFFER"));
769
+ if (flags & GRN_OBJ_RING_BUFFER)
770
+ rb_ary_push(inspected_flags, rb_str_new2("RING_BUFFER"));
771
771
 
772
772
  if (flags & GRN_OBJ_WITH_SUBREC) {
773
773
  rb_ary_push(inspected_flags, rb_str_new2("WITH_SUBREC"));
@@ -19,6 +19,8 @@
19
19
 
20
20
  #include "rb-grn.h"
21
21
 
22
+ grn_rc grn_obj_cast(grn_ctx *ctx, grn_obj *src, grn_obj *dest, int addp);
23
+
22
24
  #define SELF(object) ((RbGrnTableKeySupport *)DATA_PTR(object))
23
25
 
24
26
  VALUE rb_cGrnPatriciaTrie;
@@ -159,7 +161,7 @@ rb_grn_patricia_trie_s_create (int argc, VALUE *argv, VALUE klass)
159
161
  grn_obj *key_type = NULL, *value_type = NULL, *table;
160
162
  const char *name = NULL, *path = NULL;
161
163
  unsigned name_size = 0;
162
- grn_obj_flags flags = GRN_TABLE_PAT_KEY;
164
+ grn_obj_flags flags = GRN_OBJ_TABLE_PAT_KEY;
163
165
  VALUE rb_table;
164
166
  VALUE options, rb_context, rb_name, rb_path, rb_persistent;
165
167
  VALUE rb_key_normalize, rb_key_with_sis, rb_key_type;
@@ -488,6 +490,387 @@ rb_grn_patricia_trie_register_key_with_sis_p (VALUE self)
488
490
  return CBOOL2RVAL(table->header.flags & GRN_OBJ_KEY_WITH_SIS);
489
491
  }
490
492
 
493
+ static grn_table_cursor *
494
+ rb_grn_patricia_trie_open_grn_prefix_cursor (int argc, VALUE *argv, VALUE self,
495
+ grn_ctx **context)
496
+ {
497
+ grn_obj *table;
498
+ grn_table_cursor *cursor;
499
+ void *prefix = NULL;
500
+ unsigned prefix_size = 0;
501
+ int offset = 0, limit = -1;
502
+ int flags = GRN_CURSOR_PREFIX;
503
+ VALUE options, rb_prefix, rb_key_bytes, rb_key_bits;
504
+ VALUE rb_order, rb_order_by;
505
+ VALUE rb_greater_than, rb_less_than, rb_offset, rb_limit;
506
+
507
+ rb_grn_table_deconstruct((RbGrnTable *)SELF(self), &table, context,
508
+ NULL, NULL,
509
+ NULL, NULL, NULL,
510
+ NULL);
511
+
512
+ rb_scan_args(argc, argv, "11", &rb_prefix, &options);
513
+
514
+ rb_grn_scan_options(options,
515
+ "key_bytes", &rb_key_bytes,
516
+ "key_bites", &rb_key_bits,
517
+ "offset", &rb_offset,
518
+ "limit", &rb_limit,
519
+ "order", &rb_order,
520
+ "order_by", &rb_order_by,
521
+ "greater_than", &rb_greater_than,
522
+ "less_than", &rb_less_than,
523
+ NULL);
524
+
525
+ prefix = StringValuePtr(rb_prefix);
526
+ if (!NIL_P(rb_key_bytes) && !NIL_P(rb_key_bits)) {
527
+ rb_raise(rb_eArgError,
528
+ "should not specify both :key_bytes and :key_bits once: %s",
529
+ rb_grn_inspect(rb_ary_new4(argc, argv)));
530
+ } else if (!NIL_P(rb_key_bytes)) {
531
+ prefix_size = NUM2UINT(rb_key_bytes);
532
+ } else if (!NIL_P(rb_key_bits)) {
533
+ prefix_size = NUM2UINT(rb_key_bits);
534
+ flags |= GRN_CURSOR_SIZE_BY_BIT;
535
+ } else {
536
+ prefix_size = RSTRING_LEN(rb_prefix);
537
+ }
538
+ if (!NIL_P(rb_offset))
539
+ offset = NUM2INT(rb_offset);
540
+ if (!NIL_P(rb_limit))
541
+ limit = NUM2INT(rb_limit);
542
+
543
+ if (NIL_P(rb_order)) {
544
+ } else if (rb_grn_equal_option(rb_order, "asc") ||
545
+ rb_grn_equal_option(rb_order, "ascending")) {
546
+ flags |= GRN_CURSOR_ASCENDING;
547
+ } else if (rb_grn_equal_option(rb_order, "desc") ||
548
+ rb_grn_equal_option(rb_order, "descending")) {
549
+ flags |= GRN_CURSOR_DESCENDING;
550
+ } else {
551
+ rb_raise(rb_eArgError,
552
+ "order should be one of "
553
+ "[:asc, :ascending, :desc, :descending]: %s",
554
+ rb_grn_inspect(rb_order));
555
+ }
556
+ if (NIL_P(rb_order_by)) {
557
+ } else if (rb_grn_equal_option(rb_order_by, "id")) {
558
+ flags |= GRN_CURSOR_BY_ID;
559
+ } else if (rb_grn_equal_option(rb_order_by, "key")) {
560
+ if (table->header.type != GRN_TABLE_PAT_KEY) {
561
+ rb_raise(rb_eArgError,
562
+ "order_by => :key is available "
563
+ "only for Groonga::PatriciaTrie: %s",
564
+ rb_grn_inspect(self));
565
+ }
566
+ flags |= GRN_CURSOR_BY_KEY;
567
+ } else {
568
+ rb_raise(rb_eArgError,
569
+ "order_by should be one of [:id%s]: %s",
570
+ table->header.type == GRN_TABLE_PAT_KEY ? ", :key" : "",
571
+ rb_grn_inspect(rb_order_by));
572
+ }
573
+
574
+ if (RVAL2CBOOL(rb_greater_than))
575
+ flags |= GRN_CURSOR_GT;
576
+ if (RVAL2CBOOL(rb_less_than))
577
+ flags |= GRN_CURSOR_LT;
578
+
579
+ cursor = grn_table_cursor_open(*context, table,
580
+ prefix, prefix_size,
581
+ NULL, 0,
582
+ offset, limit, flags);
583
+ rb_grn_context_check(*context, self);
584
+
585
+ return cursor;
586
+ }
587
+
588
+
589
+ /*
590
+ * call-seq:
591
+ * table.open_prefix_cursor(prefix, options={}) -> Groonga::PatriciaTrieCursor
592
+ * table.open_prefix_cursor(prefix, options={}) {|cursor| ... }
593
+ *
594
+ * _prefix_に前方一致検索をするカーソルを生成して返す。ブロッ
595
+ * クを指定すると、そのブロックに生成したカーソルが渡され、ブ
596
+ * ロックを抜けると自動的にカーソルが破棄される。
597
+ *
598
+ * _options_に指定可能な値は以下の通り。
599
+ *
600
+ * [+:key_bytes+]
601
+ * _prefix_のサイズ(byte)
602
+ *
603
+ * [+:key_bits+]
604
+ * _prefix_のサイズ(bit)
605
+ *
606
+ * [+:offset+]
607
+ * 該当する範囲のレコードのうち、(0ベースで)_:offset_番目
608
+ * からレコードを取り出す。
609
+ *
610
+ * [+:limit+]
611
+ * 該当する範囲のレコードのうち、_:limit_件のみを取り出す。
612
+ * 省略された場合または-1が指定された場合は、全件が指定され
613
+ * たものとみなす。
614
+ *
615
+ * [+:order+]
616
+ * +:asc+または+:ascending+を指定すると昇順にレコードを取
617
+ * り出す。
618
+ * +:desc+または+:descending+を指定すると降順にレコードを
619
+ * 取り出す。
620
+ *
621
+ * [+:order_by+]
622
+ * +:id+を指定するとID順にレコードを取り出す。(デフォルト)
623
+ *
624
+ * +:key+指定するとキー順にレコードを取り出す。
625
+ *
626
+ * [+:greater_than+]
627
+ * +true+を指定すると_prefix_で指定した値に一致した[+key+]を
628
+ * 範囲に含まない。
629
+ *
630
+ * [+:less_than+]
631
+ * +true+を指定すると_prefix_で指定した値に一致した[+key+]を
632
+ * 範囲に含まない。
633
+ */
634
+ static VALUE
635
+ rb_grn_patricia_trie_open_prefix_cursor (int argc, VALUE *argv, VALUE self)
636
+ {
637
+ grn_ctx *context = NULL;
638
+ grn_table_cursor *cursor;
639
+ VALUE rb_cursor;
640
+
641
+ cursor = rb_grn_patricia_trie_open_grn_prefix_cursor(argc, argv,
642
+ self, &context);
643
+ rb_cursor = GRNTABLECURSOR2RVAL(Qnil, context, cursor);
644
+ rb_iv_set(rb_cursor, "@table", self); /* FIXME: cursor should mark table */
645
+ if (rb_block_given_p())
646
+ return rb_ensure(rb_yield, rb_cursor, rb_grn_object_close, rb_cursor);
647
+ else
648
+ return rb_cursor;
649
+ }
650
+
651
+ static grn_table_cursor *
652
+ rb_grn_patricia_trie_open_grn_rk_cursor (int argc, VALUE *argv, VALUE self,
653
+ grn_ctx **context)
654
+ {
655
+ grn_obj *table;
656
+ grn_table_cursor *cursor;
657
+ void *prefix = NULL;
658
+ unsigned prefix_size = 0;
659
+ int offset = 0, limit = -1;
660
+ int flags = GRN_CURSOR_PREFIX | GRN_CURSOR_RK;
661
+ VALUE options, rb_prefix, rb_key_bytes, rb_key_bits;
662
+ VALUE rb_greater_than, rb_less_than, rb_offset, rb_limit;
663
+
664
+ rb_grn_table_deconstruct((RbGrnTable *)SELF(self), &table, context,
665
+ NULL, NULL,
666
+ NULL, NULL, NULL,
667
+ NULL);
668
+
669
+ rb_scan_args(argc, argv, "11", &rb_prefix, &options);
670
+
671
+ rb_grn_scan_options(options,
672
+ "key_bytes", &rb_key_bytes,
673
+ "key_bites", &rb_key_bits,
674
+ "offset", &rb_offset,
675
+ "limit", &rb_limit,
676
+ "greater_than", &rb_greater_than,
677
+ "less_than", &rb_less_than,
678
+ NULL);
679
+
680
+ prefix = StringValuePtr(rb_prefix);
681
+ if (!NIL_P(rb_key_bytes) && !NIL_P(rb_key_bits)) {
682
+ rb_raise(rb_eArgError,
683
+ "should not specify both :key_bytes and :key_bits once: %s",
684
+ rb_grn_inspect(rb_ary_new4(argc, argv)));
685
+ } else if (!NIL_P(rb_key_bytes)) {
686
+ prefix_size = NUM2UINT(rb_key_bytes);
687
+ } else if (!NIL_P(rb_key_bits)) {
688
+ prefix_size = NUM2UINT(rb_key_bits);
689
+ flags |= GRN_CURSOR_SIZE_BY_BIT;
690
+ } else {
691
+ prefix_size = RSTRING_LEN(rb_prefix);
692
+ }
693
+ if (!NIL_P(rb_offset))
694
+ offset = NUM2INT(rb_offset);
695
+ if (!NIL_P(rb_limit))
696
+ limit = NUM2INT(rb_limit);
697
+
698
+ if (RVAL2CBOOL(rb_greater_than))
699
+ flags |= GRN_CURSOR_GT;
700
+ if (RVAL2CBOOL(rb_less_than))
701
+ flags |= GRN_CURSOR_LT;
702
+
703
+ cursor = grn_table_cursor_open(*context, table,
704
+ prefix, prefix_size,
705
+ NULL, 0,
706
+ offset, limit, flags);
707
+ rb_grn_context_check(*context, self);
708
+
709
+ return cursor;
710
+ }
711
+
712
+ /*
713
+ * call-seq:
714
+ * table.open_rk_cursor(key, options={}) -> Groonga::PatriciaTrieCursor
715
+ * table.open_rk_cursor(key, options={}) {|cursor| ... }
716
+ *
717
+ * _table_のキーはカタカナである必要がある。また、エンコーディ
718
+ * ングはUTF-8である必要がある。ローマ字やひらがなで_key_を指
719
+ * 定しても、_key_に対応するカタカナのキーを検索するカーソル
720
+ * を生成して返す。ブロックを指定すると、そのブロックに生成し
721
+ * たカーソルが渡され、ブロックを抜けると自動的にカーソルが破
722
+ * 棄される。
723
+ *
724
+ * _options_に指定可能な値は以下の通り。
725
+ *
726
+ * [+:key_bytes+]
727
+ * _key_のサイズ(byte)
728
+ *
729
+ * [+:key_bits+]
730
+ * _key_のサイズ(bit)(現在は未サポート)
731
+ *
732
+ * [+:offset+]
733
+ * 該当する範囲のレコードのうち、(0ベースで)_:offset_番目
734
+ * からレコードを取り出す。
735
+ *
736
+ * [+:limit+]
737
+ * 該当する範囲のレコードのうち、_:limit_件のみを取り出す。
738
+ * 省略された場合または-1が指定された場合は、全件が指定され
739
+ * たものとみなす。
740
+ *
741
+ * [+:greater_than+]
742
+ * +true+を指定すると_key_で指定した値に一致した[+key+]を
743
+ * 範囲に含まない。
744
+ *
745
+ * [+:less_than+]
746
+ * +true+を指定すると_key_で指定した値に一致した[+key+]を
747
+ * 範囲に含まない。
748
+ */
749
+ static VALUE
750
+ rb_grn_patricia_trie_open_rk_cursor (int argc, VALUE *argv, VALUE self)
751
+ {
752
+ grn_ctx *context = NULL;
753
+ grn_table_cursor *cursor;
754
+ VALUE rb_cursor;
755
+
756
+ cursor = rb_grn_patricia_trie_open_grn_rk_cursor(argc, argv,
757
+ self, &context);
758
+ rb_cursor = GRNTABLECURSOR2RVAL(Qnil, context, cursor);
759
+ rb_iv_set(rb_cursor, "@table", self); /* FIXME: cursor should mark table */
760
+ if (rb_block_given_p())
761
+ return rb_ensure(rb_yield, rb_cursor, rb_grn_object_close, rb_cursor);
762
+ else
763
+ return rb_cursor;
764
+ }
765
+
766
+
767
+ static grn_table_cursor *
768
+ rb_grn_patricia_trie_open_grn_near_cursor (int argc, VALUE *argv, VALUE self,
769
+ grn_ctx **context, int flags)
770
+ {
771
+ grn_obj *table;
772
+ grn_obj *key_p = NULL, casted_key;
773
+ grn_table_cursor *cursor;
774
+ unsigned min_size = 0;
775
+ int offset = 0, limit = -1;
776
+ VALUE options, rb_key, rb_min_size;
777
+ VALUE rb_greater_than, rb_less_than, rb_offset, rb_limit;
778
+
779
+ flags |= GRN_CURSOR_PREFIX;
780
+
781
+ rb_grn_table_deconstruct((RbGrnTable *)SELF(self), &table, context,
782
+ NULL, NULL,
783
+ NULL, NULL, NULL,
784
+ NULL);
785
+
786
+ rb_scan_args(argc, argv, "11", &rb_key, &options);
787
+
788
+ rb_grn_scan_options(options,
789
+ "size", &rb_min_size,
790
+ "offset", &rb_offset,
791
+ "limit", &rb_limit,
792
+ "greater_than", &rb_greater_than,
793
+ "less_than", &rb_less_than,
794
+ NULL);
795
+
796
+ key_p = RVAL2GRNBULK_WITH_TYPE(rb_key, *context, key_p,
797
+ table->header.domain, grn_ctx_at(*context, table->header.domain));
798
+ GRN_OBJ_INIT(&casted_key, GRN_BULK, 0, table->header.domain);
799
+ if (key_p->header.domain != table->header.domain) {
800
+ grn_obj_cast(*context, key_p, &casted_key, 0);
801
+ key_p = &casted_key;
802
+ }
803
+
804
+ if (!NIL_P(rb_min_size))
805
+ min_size = NUM2UINT(rb_min_size);
806
+ if (!NIL_P(rb_offset))
807
+ offset = NUM2INT(rb_offset);
808
+ if (!NIL_P(rb_limit))
809
+ limit = NUM2INT(rb_limit);
810
+
811
+ if (RVAL2CBOOL(rb_greater_than))
812
+ flags |= GRN_CURSOR_GT;
813
+ if (RVAL2CBOOL(rb_less_than))
814
+ flags |= GRN_CURSOR_LT;
815
+
816
+ cursor = grn_table_cursor_open(*context, table,
817
+ NULL, min_size,
818
+ GRN_BULK_HEAD(key_p), GRN_BULK_VSIZE(key_p),
819
+ offset, limit, flags);
820
+ GRN_OBJ_FIN(*context, &casted_key);
821
+ rb_grn_context_check(*context, self);
822
+
823
+ return cursor;
824
+ }
825
+
826
+ /*
827
+ * call-seq:
828
+ * table.open_near_cursor(key, options={}) -> Groonga::PatriciaTrieCursor
829
+ * table.open_near_cursor(key, options={}) {|cursor| ... }
830
+ *
831
+ * _key_に近い順にレコードを取り出すカーソルを生成して返す。
832
+ * ブロックを指定すると、そのブロックに生成したカーソルが渡さ
833
+ * れ、ブロックを抜けると自動的にカーソルが破棄される。
834
+ *
835
+ * _options_に指定可能な値は以下の通り。
836
+ *
837
+ * [+:size+]
838
+ * _size_バイト以降のデータが同じキーのレコードに限定する。
839
+ *
840
+ * [+:offset+]
841
+ * 該当する範囲のレコードのうち、(0ベースで)_:offset_番目
842
+ * からレコードを取り出す。
843
+ *
844
+ * [+:limit+]
845
+ * 該当する範囲のレコードのうち、_:limit_件のみを取り出す。
846
+ * 省略された場合または-1が指定された場合は、全件が指定され
847
+ * たものとみなす。
848
+ *
849
+ * [+:greater_than+]
850
+ * +true+を指定すると_key_で指定した値に一致した[+key+]を
851
+ * 範囲に含まない。
852
+ *
853
+ * [+:less_than+]
854
+ * +true+を指定すると_key_で指定した値に一致した[+key+]を
855
+ * 範囲に含まない。
856
+ */
857
+ static VALUE
858
+ rb_grn_patricia_trie_open_near_cursor (int argc, VALUE *argv, VALUE self)
859
+ {
860
+ grn_ctx *context = NULL;
861
+ grn_table_cursor *cursor;
862
+ VALUE rb_cursor;
863
+
864
+ cursor = rb_grn_patricia_trie_open_grn_near_cursor(argc, argv,
865
+ self, &context, GRN_CURSOR_RK);
866
+ rb_cursor = GRNTABLECURSOR2RVAL(Qnil, context, cursor);
867
+ rb_iv_set(rb_cursor, "@table", self); /* FIXME: cursor should mark table */
868
+ if (rb_block_given_p())
869
+ return rb_ensure(rb_yield, rb_cursor, rb_grn_object_close, rb_cursor);
870
+ else
871
+ return rb_cursor;
872
+ }
873
+
491
874
  void
492
875
  rb_grn_init_patricia_trie (VALUE mGrn)
493
876
  {
@@ -507,4 +890,14 @@ rb_grn_init_patricia_trie (VALUE mGrn)
507
890
 
508
891
  rb_define_method(rb_cGrnPatriciaTrie, "register_key_with_sis?",
509
892
  rb_grn_patricia_trie_register_key_with_sis_p, 0);
893
+
894
+ rb_define_method(rb_cGrnPatriciaTrie, "open_prefix_cursor",
895
+ rb_grn_patricia_trie_open_prefix_cursor,
896
+ -1);
897
+ rb_define_method(rb_cGrnPatriciaTrie, "open_rk_cursor",
898
+ rb_grn_patricia_trie_open_rk_cursor,
899
+ -1);
900
+ rb_define_method(rb_cGrnPatriciaTrie, "open_near_cursor",
901
+ rb_grn_patricia_trie_open_near_cursor,
902
+ -1);
510
903
  }