rroonga 1.2.5-x86-mingw32 → 1.2.7-x86-mingw32

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 (300) hide show
  1. data/Gemfile +30 -0
  2. data/Rakefile +24 -285
  3. data/ext/groonga/extconf.rb +4 -2
  4. data/ext/groonga/rb-grn-array.c +5 -4
  5. data/ext/groonga/rb-grn-context.c +7 -22
  6. data/ext/groonga/rb-grn-database.c +42 -1
  7. data/ext/groonga/rb-grn-index-column.c +5 -0
  8. data/ext/groonga/rb-grn-object.c +58 -26
  9. data/ext/groonga/rb-grn-patricia-trie.c +2 -1
  10. data/ext/groonga/rb-grn-record.c +11 -1
  11. data/ext/groonga/rb-grn-snippet.c +44 -1
  12. data/ext/groonga/rb-grn-table-key-support.c +21 -10
  13. data/ext/groonga/rb-grn-utils.c +3 -1
  14. data/ext/groonga/rb-grn-variable-size-column.c +47 -1
  15. data/ext/groonga/rb-grn.h +4 -1
  16. data/extconf.rb +1 -0
  17. data/lib/1.8/groonga.so +0 -0
  18. data/lib/1.9/groonga.so +0 -0
  19. data/lib/groonga/dumper.rb +3 -3
  20. data/lib/groonga/pagination.rb +1 -1
  21. data/lib/groonga/record.rb +10 -0
  22. data/rroonga-build.rb +1 -1
  23. data/test/test-accessor.rb +4 -0
  24. data/test/test-array.rb +9 -1
  25. data/test/test-database.rb +16 -0
  26. data/test/test-expression.rb +2 -0
  27. data/test/test-hash.rb +11 -2
  28. data/test/test-patricia-trie.rb +10 -1
  29. data/test/test-table-select.rb +31 -17
  30. data/test/test-type.rb +3 -3
  31. data/test/test-variable-size-column.rb +8 -1
  32. data/vendor/local/bin/grntest.exe +0 -0
  33. data/vendor/local/bin/groonga.exe +0 -0
  34. data/vendor/local/bin/libgroonga-0.dll +0 -0
  35. data/vendor/local/bin/libmecab-1.dll +0 -0
  36. data/vendor/local/bin/mecab-config +2 -2
  37. data/vendor/local/bin/mecab.exe +0 -0
  38. data/vendor/local/include/groonga/groonga.h +20 -4
  39. data/vendor/local/lib/groonga/plugins/suggest/suggest.a +0 -0
  40. data/vendor/local/lib/groonga/plugins/suggest/suggest.dll +0 -0
  41. data/vendor/local/lib/groonga/plugins/suggest/suggest.dll.a +0 -0
  42. data/vendor/local/lib/groonga/plugins/suggest/suggest.la +3 -3
  43. data/vendor/local/lib/groonga/plugins/tokenizers/mecab.a +0 -0
  44. data/vendor/local/lib/groonga/plugins/tokenizers/mecab.dll +0 -0
  45. data/vendor/local/lib/groonga/plugins/tokenizers/mecab.dll.a +0 -0
  46. data/vendor/local/lib/groonga/plugins/tokenizers/mecab.la +3 -3
  47. data/vendor/local/lib/libgroonga.a +0 -0
  48. data/vendor/local/lib/libgroonga.dll.a +0 -0
  49. data/vendor/local/lib/libgroonga.la +2 -2
  50. data/vendor/local/lib/libmecab.a +0 -0
  51. data/vendor/local/lib/libmecab.dll.a +0 -0
  52. data/vendor/local/lib/libmecab.la +1 -1
  53. data/vendor/local/lib/pkgconfig/groonga.pc +2 -2
  54. data/vendor/local/libexec/mecab/mecab-cost-train.exe +0 -0
  55. data/vendor/local/libexec/mecab/mecab-dict-gen.exe +0 -0
  56. data/vendor/local/libexec/mecab/mecab-dict-index.exe +0 -0
  57. data/vendor/local/libexec/mecab/mecab-system-eval.exe +0 -0
  58. data/vendor/local/libexec/mecab/mecab-test-gen.exe +0 -0
  59. data/vendor/local/share/doc/groonga/en/html/.buildinfo +1 -1
  60. data/vendor/local/share/doc/groonga/en/html/_sources/commands/suggest.txt +207 -35
  61. data/vendor/local/share/doc/groonga/en/html/_sources/executables/grntest.txt +1 -1
  62. data/vendor/local/share/doc/groonga/en/html/_sources/executables/{http.txt → groonga-http.txt} +1 -1
  63. data/vendor/local/share/doc/groonga/en/html/_sources/executables/groonga-suggest-create-dataset.txt +50 -0
  64. data/vendor/local/share/doc/groonga/en/html/_sources/index.txt +1 -0
  65. data/vendor/local/share/doc/groonga/en/html/_sources/install.txt +14 -3
  66. data/vendor/local/share/doc/groonga/en/html/_sources/log.txt +214 -0
  67. data/vendor/local/share/doc/groonga/en/html/_sources/news/1.0.x.txt +1 -1
  68. data/vendor/local/share/doc/groonga/en/html/_sources/news.txt +35 -3
  69. data/vendor/local/share/doc/groonga/en/html/_sources/suggest/completion.txt +195 -0
  70. data/vendor/local/share/doc/groonga/en/html/_sources/suggest/correction.txt +148 -0
  71. data/vendor/local/share/doc/groonga/en/html/_sources/suggest/introduction.txt +94 -0
  72. data/vendor/local/share/doc/groonga/en/html/_sources/suggest/suggestion.txt +115 -0
  73. data/vendor/local/share/doc/groonga/en/html/_sources/suggest/tutorial.txt +8 -0
  74. data/vendor/local/share/doc/groonga/en/html/_sources/suggest.txt +22 -0
  75. data/vendor/local/share/doc/groonga/en/html/_sources/tutorial/tutorial01.txt +2 -1
  76. data/vendor/local/share/doc/groonga/en/html/_static/groonga.css +1 -0
  77. data/vendor/local/share/doc/groonga/en/html/characteristic.html +5 -5
  78. data/vendor/local/share/doc/groonga/en/html/command_version.html +30 -30
  79. data/vendor/local/share/doc/groonga/en/html/commands/cache_limit.html +34 -34
  80. data/vendor/local/share/doc/groonga/en/html/commands/check.html +34 -34
  81. data/vendor/local/share/doc/groonga/en/html/commands/clearlock.html +34 -34
  82. data/vendor/local/share/doc/groonga/en/html/commands/column_create.html +34 -34
  83. data/vendor/local/share/doc/groonga/en/html/commands/column_list.html +34 -34
  84. data/vendor/local/share/doc/groonga/en/html/commands/column_remove.html +34 -34
  85. data/vendor/local/share/doc/groonga/en/html/commands/define_selector.html +36 -36
  86. data/vendor/local/share/doc/groonga/en/html/commands/defrag.html +34 -34
  87. data/vendor/local/share/doc/groonga/en/html/commands/delete.html +34 -34
  88. data/vendor/local/share/doc/groonga/en/html/commands/dump.html +32 -32
  89. data/vendor/local/share/doc/groonga/en/html/commands/load.html +36 -36
  90. data/vendor/local/share/doc/groonga/en/html/commands/log_level.html +36 -36
  91. data/vendor/local/share/doc/groonga/en/html/commands/log_put.html +36 -36
  92. data/vendor/local/share/doc/groonga/en/html/commands/log_reopen.html +38 -38
  93. data/vendor/local/share/doc/groonga/en/html/commands/quit.html +32 -32
  94. data/vendor/local/share/doc/groonga/en/html/commands/select.html +38 -38
  95. data/vendor/local/share/doc/groonga/en/html/commands/shutdown.html +32 -32
  96. data/vendor/local/share/doc/groonga/en/html/commands/status.html +34 -34
  97. data/vendor/local/share/doc/groonga/en/html/commands/suggest.html +258 -72
  98. data/vendor/local/share/doc/groonga/en/html/commands/table_create.html +34 -34
  99. data/vendor/local/share/doc/groonga/en/html/commands/table_list.html +34 -34
  100. data/vendor/local/share/doc/groonga/en/html/commands/table_remove.html +34 -34
  101. data/vendor/local/share/doc/groonga/en/html/commands/view_add.html +34 -34
  102. data/vendor/local/share/doc/groonga/en/html/commands.html +42 -42
  103. data/vendor/local/share/doc/groonga/en/html/community.html +5 -5
  104. data/vendor/local/share/doc/groonga/en/html/contribution/development/com.html +7 -7
  105. data/vendor/local/share/doc/groonga/en/html/contribution/development/document.html +7 -7
  106. data/vendor/local/share/doc/groonga/en/html/contribution/development/query.html +7 -7
  107. data/vendor/local/share/doc/groonga/en/html/contribution/development/test.html +7 -7
  108. data/vendor/local/share/doc/groonga/en/html/contribution/development.html +8 -8
  109. data/vendor/local/share/doc/groonga/en/html/contribution/documentation/c-api.html +7 -7
  110. data/vendor/local/share/doc/groonga/en/html/contribution/documentation/i18n.html +7 -7
  111. data/vendor/local/share/doc/groonga/en/html/contribution/documentation.html +8 -8
  112. data/vendor/local/share/doc/groonga/en/html/contribution/report.html +12 -12
  113. data/vendor/local/share/doc/groonga/en/html/contribution.html +10 -10
  114. data/vendor/local/share/doc/groonga/en/html/executables/grnslap.html +32 -32
  115. data/vendor/local/share/doc/groonga/en/html/executables/grntest.html +49 -49
  116. data/vendor/local/share/doc/groonga/en/html/executables/{http.html → groonga-http.html} +34 -34
  117. data/vendor/local/share/doc/groonga/en/html/executables/groonga-suggest-create-dataset.html +186 -0
  118. data/vendor/local/share/doc/groonga/en/html/executables/groonga.html +37 -37
  119. data/vendor/local/share/doc/groonga/en/html/executables.html +22 -21
  120. data/vendor/local/share/doc/groonga/en/html/expr.html +26 -26
  121. data/vendor/local/share/doc/groonga/en/html/functions/edit_distance.html +32 -32
  122. data/vendor/local/share/doc/groonga/en/html/functions/geo_distance.html +32 -32
  123. data/vendor/local/share/doc/groonga/en/html/functions/geo_in_circle.html +32 -32
  124. data/vendor/local/share/doc/groonga/en/html/functions/geo_in_rectangle.html +32 -32
  125. data/vendor/local/share/doc/groonga/en/html/functions/now.html +30 -30
  126. data/vendor/local/share/doc/groonga/en/html/functions/rand.html +32 -32
  127. data/vendor/local/share/doc/groonga/en/html/functions.html +23 -23
  128. data/vendor/local/share/doc/groonga/en/html/genindex.html +5 -5
  129. data/vendor/local/share/doc/groonga/en/html/index.html +105 -74
  130. data/vendor/local/share/doc/groonga/en/html/install.html +22 -11
  131. data/vendor/local/share/doc/groonga/en/html/limitations.html +17 -17
  132. data/vendor/local/share/doc/groonga/en/html/log.html +345 -0
  133. data/vendor/local/share/doc/groonga/en/html/news/0.x.html +5 -5
  134. data/vendor/local/share/doc/groonga/en/html/news/1.0.x.html +6 -6
  135. data/vendor/local/share/doc/groonga/en/html/news/1.1.x.html +5 -5
  136. data/vendor/local/share/doc/groonga/en/html/news.html +94 -57
  137. data/vendor/local/share/doc/groonga/en/html/objects.inv +0 -0
  138. data/vendor/local/share/doc/groonga/en/html/pseudo_column.html +22 -22
  139. data/vendor/local/share/doc/groonga/en/html/reference.html +69 -68
  140. data/vendor/local/share/doc/groonga/en/html/search.html +5 -5
  141. data/vendor/local/share/doc/groonga/en/html/searchindex.js +1 -1
  142. data/vendor/local/share/doc/groonga/en/html/spec/search.html +28 -28
  143. data/vendor/local/share/doc/groonga/en/html/spec.html +15 -15
  144. data/vendor/local/share/doc/groonga/en/html/suggest/completion.html +357 -0
  145. data/vendor/local/share/doc/groonga/en/html/suggest/correction.html +286 -0
  146. data/vendor/local/share/doc/groonga/en/html/suggest/introduction.html +243 -0
  147. data/vendor/local/share/doc/groonga/en/html/suggest/suggestion.html +265 -0
  148. data/vendor/local/share/doc/groonga/en/html/suggest/tutorial.html +134 -0
  149. data/vendor/local/share/doc/groonga/en/html/suggest.html +166 -0
  150. data/vendor/local/share/doc/groonga/en/html/troubleshooting/different_results_with_the_same_keyword.html +26 -26
  151. data/vendor/local/share/doc/groonga/en/html/troubleshooting.html +19 -19
  152. data/vendor/local/share/doc/groonga/en/html/tutorial/tutorial01.html +6 -6
  153. data/vendor/local/share/doc/groonga/en/html/tutorial/tutorial02.html +5 -5
  154. data/vendor/local/share/doc/groonga/en/html/tutorial/tutorial03.html +5 -5
  155. data/vendor/local/share/doc/groonga/en/html/tutorial/tutorial04.html +5 -5
  156. data/vendor/local/share/doc/groonga/en/html/tutorial/tutorial05.html +5 -5
  157. data/vendor/local/share/doc/groonga/en/html/tutorial/tutorial06.html +5 -5
  158. data/vendor/local/share/doc/groonga/en/html/tutorial/tutorial07.html +5 -5
  159. data/vendor/local/share/doc/groonga/en/html/tutorial/tutorial08.html +5 -5
  160. data/vendor/local/share/doc/groonga/en/html/tutorial/tutorial09.html +5 -5
  161. data/vendor/local/share/doc/groonga/en/html/tutorial/tutorial10.html +10 -10
  162. data/vendor/local/share/doc/groonga/en/html/tutorial.html +5 -5
  163. data/vendor/local/share/doc/groonga/en/html/type.html +30 -30
  164. data/vendor/local/share/doc/groonga/ja/html/.buildinfo +1 -1
  165. data/vendor/local/share/doc/groonga/ja/html/_sources/commands/suggest.txt +207 -35
  166. data/vendor/local/share/doc/groonga/ja/html/_sources/executables/grntest.txt +1 -1
  167. data/vendor/local/share/doc/groonga/{source/executables/http.txt → ja/html/_sources/executables/groonga-http.txt} +1 -1
  168. data/vendor/local/share/doc/groonga/ja/html/_sources/executables/groonga-suggest-create-dataset.txt +50 -0
  169. data/vendor/local/share/doc/groonga/ja/html/_sources/index.txt +1 -0
  170. data/vendor/local/share/doc/groonga/ja/html/_sources/install.txt +14 -3
  171. data/vendor/local/share/doc/groonga/ja/html/_sources/log.txt +214 -0
  172. data/vendor/local/share/doc/groonga/ja/html/_sources/news/1.0.x.txt +1 -1
  173. data/vendor/local/share/doc/groonga/ja/html/_sources/news.txt +35 -3
  174. data/vendor/local/share/doc/groonga/ja/html/_sources/suggest/completion.txt +195 -0
  175. data/vendor/local/share/doc/groonga/ja/html/_sources/suggest/correction.txt +148 -0
  176. data/vendor/local/share/doc/groonga/ja/html/_sources/suggest/introduction.txt +94 -0
  177. data/vendor/local/share/doc/groonga/ja/html/_sources/suggest/suggestion.txt +115 -0
  178. data/vendor/local/share/doc/groonga/ja/html/_sources/suggest/tutorial.txt +8 -0
  179. data/vendor/local/share/doc/groonga/ja/html/_sources/suggest.txt +22 -0
  180. data/vendor/local/share/doc/groonga/ja/html/_sources/tutorial/tutorial01.txt +2 -1
  181. data/vendor/local/share/doc/groonga/ja/html/_static/groonga.css +1 -0
  182. data/vendor/local/share/doc/groonga/ja/html/characteristic.html +5 -5
  183. data/vendor/local/share/doc/groonga/ja/html/command_version.html +30 -30
  184. data/vendor/local/share/doc/groonga/ja/html/commands/cache_limit.html +34 -34
  185. data/vendor/local/share/doc/groonga/ja/html/commands/check.html +34 -34
  186. data/vendor/local/share/doc/groonga/ja/html/commands/clearlock.html +34 -34
  187. data/vendor/local/share/doc/groonga/ja/html/commands/column_create.html +34 -34
  188. data/vendor/local/share/doc/groonga/ja/html/commands/column_list.html +34 -34
  189. data/vendor/local/share/doc/groonga/ja/html/commands/column_remove.html +34 -34
  190. data/vendor/local/share/doc/groonga/ja/html/commands/define_selector.html +36 -36
  191. data/vendor/local/share/doc/groonga/ja/html/commands/defrag.html +34 -34
  192. data/vendor/local/share/doc/groonga/ja/html/commands/delete.html +34 -34
  193. data/vendor/local/share/doc/groonga/ja/html/commands/dump.html +32 -32
  194. data/vendor/local/share/doc/groonga/ja/html/commands/load.html +36 -36
  195. data/vendor/local/share/doc/groonga/ja/html/commands/log_level.html +36 -36
  196. data/vendor/local/share/doc/groonga/ja/html/commands/log_put.html +36 -36
  197. data/vendor/local/share/doc/groonga/ja/html/commands/log_reopen.html +38 -38
  198. data/vendor/local/share/doc/groonga/ja/html/commands/quit.html +32 -32
  199. data/vendor/local/share/doc/groonga/ja/html/commands/select.html +38 -38
  200. data/vendor/local/share/doc/groonga/ja/html/commands/shutdown.html +32 -32
  201. data/vendor/local/share/doc/groonga/ja/html/commands/status.html +34 -34
  202. data/vendor/local/share/doc/groonga/ja/html/commands/suggest.html +237 -72
  203. data/vendor/local/share/doc/groonga/ja/html/commands/table_create.html +34 -34
  204. data/vendor/local/share/doc/groonga/ja/html/commands/table_list.html +34 -34
  205. data/vendor/local/share/doc/groonga/ja/html/commands/table_remove.html +34 -34
  206. data/vendor/local/share/doc/groonga/ja/html/commands/view_add.html +34 -34
  207. data/vendor/local/share/doc/groonga/ja/html/commands.html +42 -42
  208. data/vendor/local/share/doc/groonga/ja/html/community.html +5 -5
  209. data/vendor/local/share/doc/groonga/ja/html/contribution/development/com.html +7 -7
  210. data/vendor/local/share/doc/groonga/ja/html/contribution/development/document.html +7 -7
  211. data/vendor/local/share/doc/groonga/ja/html/contribution/development/query.html +7 -7
  212. data/vendor/local/share/doc/groonga/ja/html/contribution/development/test.html +7 -7
  213. data/vendor/local/share/doc/groonga/ja/html/contribution/development.html +8 -8
  214. data/vendor/local/share/doc/groonga/ja/html/contribution/documentation/c-api.html +7 -7
  215. data/vendor/local/share/doc/groonga/ja/html/contribution/documentation/i18n.html +7 -7
  216. data/vendor/local/share/doc/groonga/ja/html/contribution/documentation.html +8 -8
  217. data/vendor/local/share/doc/groonga/ja/html/contribution/report.html +12 -12
  218. data/vendor/local/share/doc/groonga/ja/html/contribution.html +10 -10
  219. data/vendor/local/share/doc/groonga/ja/html/executables/grnslap.html +32 -32
  220. data/vendor/local/share/doc/groonga/ja/html/executables/grntest.html +49 -49
  221. data/vendor/local/share/doc/groonga/ja/html/executables/{http.html → groonga-http.html} +34 -34
  222. data/vendor/local/share/doc/groonga/ja/html/executables/groonga-suggest-create-dataset.html +187 -0
  223. data/vendor/local/share/doc/groonga/ja/html/executables/groonga.html +37 -37
  224. data/vendor/local/share/doc/groonga/ja/html/executables.html +22 -21
  225. data/vendor/local/share/doc/groonga/ja/html/expr.html +26 -26
  226. data/vendor/local/share/doc/groonga/ja/html/functions/edit_distance.html +32 -32
  227. data/vendor/local/share/doc/groonga/ja/html/functions/geo_distance.html +32 -32
  228. data/vendor/local/share/doc/groonga/ja/html/functions/geo_in_circle.html +32 -32
  229. data/vendor/local/share/doc/groonga/ja/html/functions/geo_in_rectangle.html +32 -32
  230. data/vendor/local/share/doc/groonga/ja/html/functions/now.html +30 -30
  231. data/vendor/local/share/doc/groonga/ja/html/functions/rand.html +32 -32
  232. data/vendor/local/share/doc/groonga/ja/html/functions.html +23 -23
  233. data/vendor/local/share/doc/groonga/ja/html/genindex.html +5 -5
  234. data/vendor/local/share/doc/groonga/ja/html/index.html +105 -74
  235. data/vendor/local/share/doc/groonga/ja/html/install.html +24 -11
  236. data/vendor/local/share/doc/groonga/ja/html/limitations.html +17 -17
  237. data/vendor/local/share/doc/groonga/ja/html/log.html +346 -0
  238. data/vendor/local/share/doc/groonga/ja/html/news/0.x.html +5 -5
  239. data/vendor/local/share/doc/groonga/ja/html/news/1.0.x.html +6 -6
  240. data/vendor/local/share/doc/groonga/ja/html/news/1.1.x.html +5 -5
  241. data/vendor/local/share/doc/groonga/ja/html/news.html +87 -55
  242. data/vendor/local/share/doc/groonga/ja/html/objects.inv +0 -0
  243. data/vendor/local/share/doc/groonga/ja/html/pseudo_column.html +22 -22
  244. data/vendor/local/share/doc/groonga/ja/html/reference.html +69 -68
  245. data/vendor/local/share/doc/groonga/ja/html/search.html +5 -5
  246. data/vendor/local/share/doc/groonga/ja/html/searchindex.js +1 -1
  247. data/vendor/local/share/doc/groonga/ja/html/spec/search.html +28 -28
  248. data/vendor/local/share/doc/groonga/ja/html/spec.html +15 -15
  249. data/vendor/local/share/doc/groonga/ja/html/suggest/completion.html +327 -0
  250. data/vendor/local/share/doc/groonga/ja/html/suggest/correction.html +254 -0
  251. data/vendor/local/share/doc/groonga/ja/html/suggest/introduction.html +225 -0
  252. data/vendor/local/share/doc/groonga/ja/html/suggest/suggestion.html +248 -0
  253. data/vendor/local/share/doc/groonga/ja/html/suggest/tutorial.html +135 -0
  254. data/vendor/local/share/doc/groonga/ja/html/suggest.html +166 -0
  255. data/vendor/local/share/doc/groonga/ja/html/troubleshooting/different_results_with_the_same_keyword.html +26 -26
  256. data/vendor/local/share/doc/groonga/ja/html/troubleshooting.html +19 -19
  257. data/vendor/local/share/doc/groonga/ja/html/tutorial/tutorial01.html +6 -6
  258. data/vendor/local/share/doc/groonga/ja/html/tutorial/tutorial02.html +5 -5
  259. data/vendor/local/share/doc/groonga/ja/html/tutorial/tutorial03.html +5 -5
  260. data/vendor/local/share/doc/groonga/ja/html/tutorial/tutorial04.html +5 -5
  261. data/vendor/local/share/doc/groonga/ja/html/tutorial/tutorial05.html +5 -5
  262. data/vendor/local/share/doc/groonga/ja/html/tutorial/tutorial06.html +5 -5
  263. data/vendor/local/share/doc/groonga/ja/html/tutorial/tutorial07.html +5 -5
  264. data/vendor/local/share/doc/groonga/ja/html/tutorial/tutorial08.html +5 -5
  265. data/vendor/local/share/doc/groonga/ja/html/tutorial/tutorial09.html +5 -5
  266. data/vendor/local/share/doc/groonga/ja/html/tutorial/tutorial10.html +10 -10
  267. data/vendor/local/share/doc/groonga/ja/html/tutorial.html +5 -5
  268. data/vendor/local/share/doc/groonga/ja/html/type.html +30 -30
  269. data/vendor/local/share/doc/groonga/source/commands/suggest.txt +207 -35
  270. data/vendor/local/share/doc/groonga/source/example/completion-1.log +5 -0
  271. data/vendor/local/share/doc/groonga/source/example/correction-1.log +5 -0
  272. data/vendor/local/share/doc/groonga/source/example/suggestion-1.log +5 -0
  273. data/vendor/local/share/doc/groonga/source/executables/grntest.txt +1 -1
  274. data/vendor/local/share/doc/groonga/{ja/html/_sources/executables/http.txt → source/executables/groonga-http.txt} +1 -1
  275. data/vendor/local/share/doc/groonga/source/executables/groonga-suggest-create-dataset.txt +50 -0
  276. data/vendor/local/share/doc/groonga/source/index.txt +1 -0
  277. data/vendor/local/share/doc/groonga/source/install.txt +14 -3
  278. data/vendor/local/share/doc/groonga/source/log.txt +214 -0
  279. data/vendor/local/share/doc/groonga/source/news/1.0.x.txt +1 -1
  280. data/vendor/local/share/doc/groonga/source/news.txt +35 -3
  281. data/vendor/local/share/doc/groonga/source/suggest/completion.txt +195 -0
  282. data/vendor/local/share/doc/groonga/source/suggest/correction.txt +148 -0
  283. data/vendor/local/share/doc/groonga/source/suggest/introduction.txt +94 -0
  284. data/vendor/local/share/doc/groonga/source/suggest/suggestion.txt +115 -0
  285. data/vendor/local/share/doc/groonga/source/suggest/tutorial.txt +8 -0
  286. data/vendor/local/share/doc/groonga/source/suggest.txt +22 -0
  287. data/vendor/local/share/doc/groonga/source/tutorial/tutorial01.txt +2 -1
  288. data/vendor/local/share/doc/groonga/source/update_execution_example.py +46 -20
  289. data/vendor/local/share/license/groonga/AUTHORS +17 -0
  290. data/vendor/local/share/license/groonga/COPYING +504 -0
  291. data/vendor/local/share/license/mecab/AUTHORS +1 -0
  292. data/vendor/local/share/license/mecab/BSD +29 -0
  293. data/vendor/local/share/license/mecab/COPYING +4 -0
  294. data/vendor/local/share/license/mecab/GPL +340 -0
  295. data/vendor/local/share/license/mecab/LGPL +504 -0
  296. data/vendor/local/share/license/naist-jdic/AUTHORS +2 -0
  297. data/vendor/local/share/license/naist-jdic/COPYING +31 -0
  298. data/vendor/local/share/man/ja/man1/groonga.1 +1050 -45
  299. data/vendor/local/share/man/man1/groonga.1 +1174 -48
  300. metadata +62 -9
@@ -79,19 +79,13 @@ rb_grn_object_from_ruby_object (VALUE object, grn_ctx **context)
79
79
  return rb_grn_object->object;
80
80
  }
81
81
 
82
- static grn_obj *
83
- rb_grn_object_finalizer (grn_ctx *context, int n_args, grn_obj **grn_objects,
84
- grn_user_data *user_data)
82
+ static void
83
+ rb_grn_object_run_finalizer (grn_ctx *context, grn_obj *grn_object,
84
+ RbGrnObject *rb_grn_object)
85
85
  {
86
- RbGrnObject *rb_grn_object;
87
- grn_obj *grn_object = *grn_objects;
88
-
89
86
  if (rb_grn_exited)
90
- return NULL;
91
-
92
- rb_grn_object = user_data->ptr;
87
+ return;
93
88
 
94
- grn_obj_user_data(context, grn_object)->ptr = NULL;
95
89
  grn_obj_set_finalizer(context, grn_object, NULL);
96
90
 
97
91
  debug("finalize: %p:%p:%p:%p:%p 0x%x\n",
@@ -101,11 +95,10 @@ rb_grn_object_finalizer (grn_ctx *context, int n_args, grn_obj **grn_objects,
101
95
 
102
96
  rb_grn_object->context = NULL;
103
97
  rb_grn_object->object = NULL;
98
+ rb_grn_object->have_finalizer = GRN_FALSE;
104
99
 
105
100
  switch (grn_object->header.type) {
106
101
  case GRN_DB:
107
- grn_ctx_use(context, NULL);
108
- break;
109
102
  case GRN_TYPE:
110
103
  case GRN_PROC:
111
104
  case GRN_CURSOR_TABLE_HASH_KEY:
@@ -148,6 +141,22 @@ rb_grn_object_finalizer (grn_ctx *context, int n_args, grn_obj **grn_objects,
148
141
  grn_object->header.type);
149
142
  break;
150
143
  }
144
+ }
145
+
146
+ static grn_obj *
147
+ rb_grn_object_finalizer (grn_ctx *context, int n_args, grn_obj **grn_objects,
148
+ grn_user_data *user_data)
149
+ {
150
+ RbGrnObject *rb_grn_object;
151
+ grn_obj *grn_object = *grn_objects;
152
+
153
+ if (rb_grn_exited)
154
+ return NULL;
155
+
156
+ rb_grn_object = user_data->ptr;
157
+
158
+ grn_obj_user_data(context, grn_object)->ptr = NULL;
159
+ rb_grn_object_run_finalizer(context, grn_object, rb_grn_object);
151
160
 
152
161
  return NULL;
153
162
  }
@@ -160,19 +169,26 @@ rb_grn_object_free (RbGrnObject *rb_grn_object)
160
169
 
161
170
  context = rb_grn_object->context;
162
171
  grn_object = rb_grn_object->object;
163
- debug("rb-free: %p:%p:%p; %d\n", context, grn_object, rb_grn_object,
164
- rb_grn_object->have_finalizer);
165
- if (!rb_grn_exited && context && grn_object && rb_grn_object->have_finalizer) {
166
- grn_user_data *user_data;
167
-
168
- user_data = grn_obj_user_data(context, grn_object);
169
- debug("type: %x; need_close: %d; user_data: %p; ptr: %p\n",
172
+ debug("rb-free: %p:%p:%p; %d:%d\n", context, grn_object, rb_grn_object,
173
+ rb_grn_object->have_finalizer, rb_grn_object->need_close);
174
+ if (!rb_grn_exited && context && grn_object &&
175
+ (rb_grn_object->have_finalizer || rb_grn_object->need_close)) {
176
+ grn_user_data *user_data = NULL;
177
+
178
+ if (rb_grn_object->have_finalizer) {
179
+ user_data = grn_obj_user_data(context, grn_object);
180
+ }
181
+ debug("type: %#x; need_close: %d; user_data: %p; ptr: %p\n",
170
182
  grn_object->header.type,
171
183
  rb_grn_object->need_close,
172
184
  user_data,
173
185
  user_data ? user_data->ptr : NULL);
174
- if (user_data && user_data->ptr) {
175
- rb_grn_object_finalizer(context, 1, &grn_object, user_data);
186
+ if (rb_grn_object->have_finalizer) {
187
+ if (user_data && user_data->ptr) {
188
+ rb_grn_object_finalizer(context, 1, &grn_object, user_data);
189
+ } else {
190
+ rb_grn_object_run_finalizer(context, grn_object, rb_grn_object);
191
+ }
176
192
  }
177
193
  if (rb_grn_object->need_close) {
178
194
  grn_obj_unlink(context, grn_object);
@@ -297,15 +313,21 @@ rb_grn_object_bind_common (VALUE klass, VALUE self, VALUE rb_context,
297
313
 
298
314
  user_data = grn_obj_user_data(context, object);
299
315
  if (user_data) {
300
- debug("set-finalizer: %p:%p:%p 0x%x\n",
316
+ debug("set-finalizer: %p:%p:%p %#x\n",
301
317
  context, object, rb_grn_object,
302
318
  object->header.type);
303
319
  user_data->ptr = rb_grn_object;
304
320
  grn_obj_set_finalizer(context, object, rb_grn_object_finalizer);
305
321
  rb_grn_object->have_finalizer = GRN_TRUE;
322
+ } else if (object->header.type == GRN_ACCESSOR) {
323
+ debug("set-finalizer(implicit): %p:%p:%p %#x\n",
324
+ context, object, rb_grn_object,
325
+ object->header.type);
326
+ rb_grn_object->have_finalizer = GRN_TRUE;
306
327
  }
307
328
 
308
329
  switch (object->header.type) {
330
+ case GRN_DB:
309
331
  case GRN_PROC:
310
332
  case GRN_TYPE:
311
333
  rb_grn_object->need_close = GRN_FALSE;
@@ -495,13 +517,17 @@ rb_grn_object_deconstruct (RbGrnObject *rb_grn_object,
495
517
  VALUE
496
518
  rb_grn_object_close (VALUE self)
497
519
  {
520
+ RbGrnObject *rb_grn_object;
498
521
  grn_obj *object;
499
522
  grn_ctx *context;
500
523
 
501
- rb_grn_object_deconstruct(SELF(self), &object, &context,
524
+ rb_grn_object = SELF(self);
525
+ rb_grn_object_deconstruct(rb_grn_object, &object, &context,
502
526
  NULL, NULL, NULL, NULL);
503
- if (object && context)
527
+ if (object && context) {
528
+ rb_grn_object_run_finalizer(context, object, rb_grn_object);
504
529
  grn_obj_close(context, object);
530
+ }
505
531
 
506
532
  return Qnil;
507
533
  }
@@ -517,13 +543,19 @@ rb_grn_object_close (VALUE self)
517
543
  VALUE
518
544
  rb_grn_object_unlink (VALUE self)
519
545
  {
546
+ RbGrnObject *rb_grn_object;
520
547
  grn_obj *object;
521
548
  grn_ctx *context;
522
549
 
523
- rb_grn_object_deconstruct(SELF(self), &object, &context,
550
+ rb_grn_object = SELF(self);
551
+ rb_grn_object_deconstruct(rb_grn_object, &object, &context,
524
552
  NULL, NULL, NULL, NULL);
525
- if (object && context)
553
+ if (object && context) {
554
+ if (!(rb_grn_object->object->header.flags & GRN_OBJ_PERSISTENT)) {
555
+ rb_grn_object_run_finalizer(context, object, rb_grn_object);
556
+ }
526
557
  grn_obj_unlink(context, object);
558
+ }
527
559
 
528
560
  return Qnil;
529
561
  }
@@ -798,6 +798,7 @@ rb_grn_patricia_trie_open_grn_near_cursor (int argc, VALUE *argv, VALUE self,
798
798
  GRN_OBJ_INIT(&casted_key, GRN_BULK, 0, table->header.domain);
799
799
  if (key_p->header.domain != table->header.domain) {
800
800
  grn_obj_cast(*context, key_p, &casted_key, 0);
801
+ grn_obj_unlink(*context, key_p);
801
802
  key_p = &casted_key;
802
803
  }
803
804
 
@@ -862,7 +863,7 @@ rb_grn_patricia_trie_open_near_cursor (int argc, VALUE *argv, VALUE self)
862
863
  VALUE rb_cursor;
863
864
 
864
865
  cursor = rb_grn_patricia_trie_open_grn_near_cursor(argc, argv,
865
- self, &context, GRN_CURSOR_RK);
866
+ self, &context, GRN_CURSOR_RK);
866
867
  rb_cursor = GRNTABLECURSOR2RVAL(Qnil, context, cursor);
867
868
  rb_iv_set(rb_cursor, "@table", self); /* FIXME: cursor should mark table */
868
869
  if (rb_block_given_p())
@@ -1,6 +1,6 @@
1
1
  /* -*- c-file-style: "ruby" -*- */
2
2
  /*
3
- Copyright (C) 2009-2010 Kouhei Sutou <kou@clear-code.com>
3
+ Copyright (C) 2009-2011 Kouhei Sutou <kou@clear-code.com>
4
4
 
5
5
  This library is free software; you can redistribute it and/or
6
6
  modify it under the terms of the GNU Lesser General Public
@@ -26,6 +26,16 @@ rb_grn_record_new (VALUE table, grn_id id, VALUE values)
26
26
  return rb_grn_record_new_raw(table, UINT2NUM(id), values);
27
27
  }
28
28
 
29
+ VALUE
30
+ rb_grn_record_new_added (VALUE table, grn_id id, VALUE values)
31
+ {
32
+ VALUE record;
33
+
34
+ record = rb_grn_record_new(table, id, values);
35
+ rb_funcall(record, rb_intern("added="), 1, Qtrue);
36
+ return record;
37
+ }
38
+
29
39
  VALUE
30
40
  rb_grn_record_new_raw (VALUE table, VALUE rb_id, VALUE values)
31
41
  {
@@ -66,7 +66,8 @@ rb_rb_grn_snippet_free (void *object)
66
66
  {
67
67
  RbGrnSnippet *rb_grn_snippet = object;
68
68
 
69
- if (rb_grn_snippet->owner &&
69
+ if (!rb_grn_exited &&
70
+ rb_grn_snippet->owner &&
70
71
  rb_grn_snippet->context && rb_grn_snippet->snippet)
71
72
  grn_snip_close(rb_grn_snippet->context,
72
73
  rb_grn_snippet->snippet);
@@ -237,6 +238,12 @@ rb_grn_snippet_add_keyword (int argc, VALUE *argv, VALUE self)
237
238
 
238
239
  rb_grn_snippet = SELF(self);
239
240
 
241
+ if (!rb_grn_snippet->snippet) {
242
+ rb_raise(rb_eGrnClosed,
243
+ "can't access already closed groonga object: %s",
244
+ rb_grn_inspect(CLASS_OF(self)));
245
+ }
246
+
240
247
  keyword = StringValuePtr(rb_keyword);
241
248
  keyword_length = RSTRING_LEN(rb_keyword);
242
249
 
@@ -294,6 +301,12 @@ rb_grn_snippet_execute (VALUE self, VALUE rb_string)
294
301
  context = rb_grn_snippet->context;
295
302
  snippet = rb_grn_snippet->snippet;
296
303
 
304
+ if (!snippet) {
305
+ rb_raise(rb_eGrnClosed,
306
+ "can't access already closed groonga object: %s",
307
+ rb_grn_inspect(CLASS_OF(self)));
308
+ }
309
+
297
310
  #ifdef HAVE_RUBY_ENCODING_H
298
311
  rb_string = rb_grn_context_rb_string_encode(context, rb_string);
299
312
  #endif
@@ -320,6 +333,34 @@ rb_grn_snippet_execute (VALUE self, VALUE rb_string)
320
333
  return rb_results;
321
334
  }
322
335
 
336
+ /*
337
+ * Document-method: close
338
+ *
339
+ * call-seq:
340
+ * snippet.close
341
+ *
342
+ * _snippet_が使用しているリソースを開放する。これ以降_snippet_を
343
+ * 使うことはできない。
344
+ */
345
+ static VALUE
346
+ rb_grn_snippet_close (VALUE self)
347
+ {
348
+ RbGrnSnippet *rb_grn_snippet;
349
+ grn_ctx *context;
350
+ grn_snip *snippet;
351
+
352
+ rb_grn_snippet = SELF(self);
353
+ context = rb_grn_snippet->context;
354
+ snippet = rb_grn_snippet->snippet;
355
+ if (context && snippet) {
356
+ grn_snip_close(context, snippet);
357
+ rb_grn_snippet->context = NULL;
358
+ rb_grn_snippet->snippet = NULL;
359
+ }
360
+
361
+ return Qnil;
362
+ }
363
+
323
364
  void
324
365
  rb_grn_init_snippet (VALUE mGrn)
325
366
  {
@@ -332,4 +373,6 @@ rb_grn_init_snippet (VALUE mGrn)
332
373
  rb_grn_snippet_add_keyword, -1);
333
374
  rb_define_method(rb_cGrnSnippet, "execute",
334
375
  rb_grn_snippet_execute, 1);
376
+ rb_define_method(rb_cGrnSnippet, "close",
377
+ rb_grn_snippet_close, 0);
335
378
  }
@@ -1,6 +1,6 @@
1
1
  /* -*- c-file-style: "ruby" -*- */
2
2
  /*
3
- Copyright (C) 2009-2010 Kouhei Sutou <kou@clear-code.com>
3
+ Copyright (C) 2009-2011 Kouhei Sutou <kou@clear-code.com>
4
4
 
5
5
  This library is free software; you can redistribute it and/or
6
6
  modify it under the terms of the GNU Lesser General Public
@@ -88,7 +88,7 @@ rb_grn_table_key_support_bind (RbGrnTableKeySupport *rb_grn_table_key_support,
88
88
  }
89
89
 
90
90
  static grn_id
91
- rb_grn_table_key_support_add_raw (VALUE self, VALUE rb_key)
91
+ rb_grn_table_key_support_add_raw (VALUE self, VALUE rb_key, int *added)
92
92
  {
93
93
  grn_ctx *context;
94
94
  grn_obj *table;
@@ -103,7 +103,7 @@ rb_grn_table_key_support_add_raw (VALUE self, VALUE rb_key)
103
103
  GRN_BULK_REWIND(key);
104
104
  RVAL2GRNKEY(rb_key, context, key, domain_id, domain, self);
105
105
  id = grn_table_add(context, table,
106
- GRN_BULK_HEAD(key), GRN_BULK_VSIZE(key), NULL);
106
+ GRN_BULK_HEAD(key), GRN_BULK_VSIZE(key), added);
107
107
  rb_grn_context_check(context, self);
108
108
 
109
109
  return id;
@@ -116,6 +116,11 @@ rb_grn_table_key_support_add_raw (VALUE self, VALUE rb_key)
116
116
  * 主キーが_key_のレコード追加し、追加したレコードを返す。レ
117
117
  * コードの追加に失敗した場合は+nil+を返す。
118
118
  *
119
+ * すでに同じキーのレコードが存在する場合は追加せずに同じレ
120
+ * コードを返す。追加されたかどうかは
121
+ * +Groonga::Record#added?+で調べることができる。+true+を返
122
+ * したら追加されたということを示す。
123
+ *
119
124
  * _values_にはレコードのカラムに設定する値を指定する。省略
120
125
  * した場合または+nil+を指定した場合はカラムは設定しない。カ
121
126
  * ラムの値は<tt>{:カラム名1 => 値1, :カラム名2 => 値2,
@@ -126,13 +131,19 @@ rb_grn_table_key_support_add (int argc, VALUE *argv, VALUE self)
126
131
  {
127
132
  grn_id id;
128
133
  VALUE key, values;
134
+ int added = GRN_FALSE;
129
135
 
130
136
  rb_scan_args(argc, argv, "11", &key, &values);
131
- id = rb_grn_table_key_support_add_raw(self, key);
132
- if (GRN_ID_NIL == id)
137
+ id = rb_grn_table_key_support_add_raw(self, key, &added);
138
+ if (GRN_ID_NIL == id) {
133
139
  return Qnil;
134
- else
135
- return rb_grn_record_new(self, id, values);
140
+ } else {
141
+ if (added) {
142
+ return rb_grn_record_new_added(self, id, values);
143
+ } else {
144
+ return rb_grn_record_new(self, id, values);
145
+ }
146
+ }
136
147
  }
137
148
 
138
149
  grn_id
@@ -364,7 +375,7 @@ rb_grn_table_key_support_array_set (VALUE self, VALUE rb_key, VALUE rb_values)
364
375
  NULL, NULL, NULL,
365
376
  NULL);
366
377
 
367
- id = rb_grn_table_key_support_add_raw(self, rb_key);
378
+ id = rb_grn_table_key_support_add_raw(self, rb_key, NULL);
368
379
 
369
380
  if (id == GRN_ID_NIL) {
370
381
  rb_raise(rb_eGrnError,
@@ -409,7 +420,7 @@ rb_grn_table_key_support_set_column_value (int argc, VALUE *argv, VALUE self)
409
420
  }
410
421
 
411
422
  rb_key = rb_id_or_key;
412
- id = rb_grn_table_key_support_add_raw(self, rb_key);
423
+ id = rb_grn_table_key_support_add_raw(self, rb_key, NULL);
413
424
  if (id == GRN_ID_NIL) {
414
425
  rb_raise(rb_eGrnError,
415
426
  "failed to add record: %s",
@@ -533,7 +544,7 @@ rb_grn_table_key_support_set_value_by_key (VALUE self,
533
544
  &value, NULL, NULL,
534
545
  NULL);
535
546
 
536
- id = rb_grn_table_key_support_add_raw(self, rb_key);
547
+ id = rb_grn_table_key_support_add_raw(self, rb_key, NULL);
537
548
  if (GRN_ID_NIL == id) {
538
549
  rb_raise(rb_eGrnError,
539
550
  "failed to add new record with key: <%s>: <%s>",
@@ -243,6 +243,8 @@ rb_grn_bulk_from_ruby_object (VALUE object, grn_ctx *context, grn_obj *bulk)
243
243
  case T_NIL:
244
244
  grn_obj_reinit(context, bulk, GRN_DB_VOID, 0);
245
245
  break;
246
+ case T_SYMBOL:
247
+ object = rb_funcall(object, rb_intern("to_s"), 0);
246
248
  case T_STRING:
247
249
  grn_obj_reinit(context, bulk, GRN_DB_TEXT, 0);
248
250
  rb_grn_context_text_set(context, bulk, object);
@@ -306,7 +308,7 @@ rb_grn_bulk_from_ruby_object (VALUE object, grn_ctx *context, grn_obj *bulk)
306
308
  } else {
307
309
  rb_raise(rb_eTypeError,
308
310
  "bulked object should be one of "
309
- "[nil, true, false, String, Integer, Float, Time, "
311
+ "[nil, true, false, String, Symbol, Integer, Float, Time, "
310
312
  "Groonga::Object, Groonga::Record]: %s",
311
313
  rb_grn_inspect(object));
312
314
  }
@@ -18,7 +18,7 @@
18
18
 
19
19
  #include "rb-grn.h"
20
20
 
21
- #define SELF(object) ((RbGrnVariableSizeColumn *)DATA_PTR(object))
21
+ #define SELF(object) ((RbGrnColumn *)DATA_PTR(object))
22
22
 
23
23
  VALUE rb_cGrnVariableSizeColumn;
24
24
 
@@ -28,9 +28,55 @@ VALUE rb_cGrnVariableSizeColumn;
28
28
  * 可変長データ用のカラム。
29
29
  */
30
30
 
31
+ /*
32
+ * Document-method: defrag
33
+ *
34
+ * call-seq:
35
+ * column.defrag(options={}) -> n_segments
36
+ *
37
+ * Defrags the column.
38
+ *
39
+ * @return [Integer] the number of defraged segments
40
+ * @option options [Integer] :threshold (0) the threshold to
41
+ * determine whether a segment is defraged. Available
42
+ * values are -4..22. -4 means all segments are defraged.
43
+ * 22 means no segment is defraged.
44
+ * @since 1.2.6
45
+ */
46
+ static VALUE
47
+ rb_grn_variable_size_column_defrag (int argc, VALUE *argv, VALUE self)
48
+ {
49
+ RbGrnColumn *rb_grn_column;
50
+ grn_ctx *context = NULL;
51
+ grn_obj *column;
52
+ int n_segments;
53
+ VALUE options, rb_threshold;
54
+ int threshold = 0;
55
+
56
+ rb_scan_args(argc, argv, "01", &options);
57
+ rb_grn_scan_options(options,
58
+ "threshold", &rb_threshold,
59
+ NULL);
60
+ if (!NIL_P(rb_threshold)) {
61
+ threshold = NUM2INT(rb_threshold);
62
+ }
63
+
64
+ rb_grn_column = SELF(self);
65
+ rb_grn_object_deconstruct(RB_GRN_OBJECT(rb_grn_column), &column, &context,
66
+ NULL, NULL,
67
+ NULL, NULL);
68
+ n_segments = grn_obj_defrag(context, column, threshold);
69
+ rb_grn_context_check(context, self);
70
+
71
+ return INT2NUM(n_segments);
72
+ }
73
+
31
74
  void
32
75
  rb_grn_init_variable_size_column (VALUE mGrn)
33
76
  {
34
77
  rb_cGrnVariableSizeColumn =
35
78
  rb_define_class_under(mGrn, "VariableSizeColumn", rb_cGrnColumn);
79
+
80
+ rb_define_method(rb_cGrnVariableSizeColumn, "defrag",
81
+ rb_grn_variable_size_column_defrag, -1);
36
82
  }
data/ext/groonga/rb-grn.h CHANGED
@@ -69,7 +69,7 @@ RB_GRN_BEGIN_DECLS
69
69
 
70
70
  #define RB_GRN_MAJOR_VERSION 1
71
71
  #define RB_GRN_MINOR_VERSION 2
72
- #define RB_GRN_MICRO_VERSION 5
72
+ #define RB_GRN_MICRO_VERSION 7
73
73
 
74
74
  #define RB_GRN_QUERY_DEFAULT_MAX_EXPRESSIONS 32
75
75
 
@@ -474,6 +474,9 @@ VALUE rb_grn_posting_new (grn_posting *posting,
474
474
  VALUE rb_grn_record_new (VALUE table,
475
475
  grn_id id,
476
476
  VALUE values);
477
+ VALUE rb_grn_record_new_added (VALUE table,
478
+ grn_id id,
479
+ VALUE values);
477
480
  VALUE rb_grn_record_new_raw (VALUE table,
478
481
  VALUE id,
479
482
  VALUE values);
data/extconf.rb CHANGED
@@ -34,6 +34,7 @@ Dir.chdir(source_ext_dir.to_s) do
34
34
  end
35
35
  ruby = "#{config['bindir']}/#{config['ruby_install_name']}#{config['EXEEXT']}"
36
36
  message("checking in #{ext_dir}...\n")
37
+ ENV["INSTALL_RB"] = "yes"
37
38
  system(ruby, (ext_dir + 'extconf.rb').to_s, *ARGV) or exit 1
38
39
  message("checking in #{ext_dir}: done.\n")
39
40
  File.open("Makefile") do |file|
data/lib/1.8/groonga.so CHANGED
Binary file
data/lib/1.9/groonga.so CHANGED
Binary file
@@ -88,9 +88,9 @@ module Groonga
88
88
  output = options[:output]
89
89
  plugins_dir_re = Regexp.escape(Groonga::Plugin.system_plugins_dir)
90
90
  suffix_re = Regexp.escape(Groonga::Plugin.suffix)
91
- plugin_name = plugin.path.gsub!(/(?:\A#{plugins_dir_re}\/|
92
- #{suffix_re}\z)/x,
93
- '')
91
+ plugin_name = plugin.path.gsub(/(?:\A#{plugins_dir_re}\/|
92
+ #{suffix_re}\z)/x,
93
+ '')
94
94
  output.write("register #{plugin_name}\n")
95
95
  end
96
96
 
@@ -78,7 +78,7 @@ module Groonga
78
78
  # selected_entries = entries.select do |record|
79
79
  # entry.description =~ query
80
80
  # end
81
- # paged_entries = selected_entries.paginate(["_score", :desc],
81
+ # paged_entries = selected_entries.paginate([["_score", :desc]],
82
82
  # :page => 1,
83
83
  # :size => 10)
84
84
  #
@@ -32,6 +32,7 @@ module Groonga
32
32
  def initialize(table, id, values=nil)
33
33
  @table = table
34
34
  @id = id
35
+ @added = false
35
36
  if values
36
37
  values.each do |name, value|
37
38
  self[name] = value
@@ -380,6 +381,15 @@ module Groonga
380
381
  super or !@table.column(name.to_s.sub(/=\z/, '')).nil?
381
382
  end
382
383
 
384
+ def added?
385
+ @added
386
+ end
387
+
388
+ # @private
389
+ def added=(added)
390
+ @added = added
391
+ end
392
+
383
393
  private
384
394
  def normalize_column_name(name)
385
395
  name.to_s
data/rroonga-build.rb CHANGED
@@ -19,7 +19,7 @@ module RroongaBuild
19
19
  module RequiredGroongaVersion
20
20
  MAJOR = 1
21
21
  MINOR = 2
22
- MICRO = 2
22
+ MICRO = 5
23
23
  VERSION = [MAJOR, MINOR, MICRO]
24
24
  end
25
25
 
@@ -22,6 +22,10 @@ class AccessorTest < Test::Unit::TestCase
22
22
  @id = @posts.column("_id")
23
23
  end
24
24
 
25
+ def teardown
26
+ @id = nil
27
+ end
28
+
25
29
  def test_name
26
30
  assert_nil(@id.name)
27
31
  end
data/test/test-array.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2009-2010 Kouhei Sutou <kou@clear-code.com>
1
+ # Copyright (C) 2009-2011 Kouhei Sutou <kou@clear-code.com>
2
2
  #
3
3
  # This library is free software; you can redistribute it and/or
4
4
  # modify it under the terms of the GNU Lesser General Public
@@ -91,4 +91,12 @@ class ArrayTest < Test::Unit::TestCase
91
91
  users.set_column_value(morita_id, "name", "morita")
92
92
  assert_equal("morita", users.column_value(morita_id, "name"))
93
93
  end
94
+
95
+ def test_added?
96
+ users = Groonga::Array.create(:name => "Users")
97
+ first_user = users.add
98
+ assert_predicate(first_user, :added?)
99
+ second_user = users.add
100
+ assert_predicate(second_user, :added?)
101
+ end
94
102
  end
@@ -130,4 +130,20 @@ class DatabaseTest < Test::Unit::TestCase
130
130
  database.touch
131
131
  end
132
132
  end
133
+
134
+ def test_defrag
135
+ setup_database
136
+ Groonga::Schema.define do |schema|
137
+ schema.create_table("Users") do |table|
138
+ table.short_text("name")
139
+ table.short_text("address")
140
+ end
141
+ end
142
+ users = context["Users"]
143
+ 1000.times do |i|
144
+ users.add(:name => "user #{i}" * 1000,
145
+ :address => "address #{i}" * 1000)
146
+ end
147
+ assert_equal(7, @database.defrag)
148
+ end
133
149
  end
@@ -106,6 +106,7 @@ class ExpressionTest < Test::Unit::TestCase
106
106
  "提供するプロジェクトです。groongaの機能を" +
107
107
  "Rubyらしい読み書きしやすい構文で利用できる" +
108
108
  "ことが利点です。"))
109
+ snippet.close
109
110
  end
110
111
 
111
112
  def test_snippet_without_tags
@@ -127,5 +128,6 @@ class ExpressionTest < Test::Unit::TestCase
127
128
  snippet = expression.snippet([], :width => 30)
128
129
  assert_equal(["ラングバプロジェクト"],
129
130
  snippet.execute("ラングバプロジェクトはカラムストア機能も"))
131
+ snippet.close
130
132
  end
131
133
  end
data/test/test-hash.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  # -*- coding: utf-8 -*-
2
- # Copyright (C) 2009-2010 Kouhei Sutou <kou@clear-code.com>
2
+ #
3
+ # Copyright (C) 2009-2011 Kouhei Sutou <kou@clear-code.com>
3
4
  #
4
5
  # This library is free software; you can redistribute it and/or
5
6
  # modify it under the terms of the GNU Lesser General Public
@@ -75,7 +76,6 @@ class HashTest < Test::Unit::TestCase
75
76
  assert_equal(bookmark, bookmarks["http://google.com/"])
76
77
  end
77
78
 
78
-
79
79
  def test_inspect_anonymous
80
80
  path = @tables_dir + "anoymous.groonga"
81
81
  anonymous_table = Groonga::Hash.create(:path => path.to_s)
@@ -308,4 +308,13 @@ class HashTest < Test::Unit::TestCase
308
308
  }
309
309
  end
310
310
  end
311
+
312
+ def test_added?
313
+ users = Groonga::Hash.create(:name => "Users",
314
+ :key_type => "ShortText")
315
+ bob = users.add("bob")
316
+ assert_predicate(bob, :added?)
317
+ bob_again = users.add("bob")
318
+ assert_not_predicate(bob_again, :added?)
319
+ end
311
320
  end
@@ -1,6 +1,6 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  #
3
- # Copyright (C) 2009-2010 Kouhei Sutou <kou@clear-code.com>
3
+ # Copyright (C) 2009-2011 Kouhei Sutou <kou@clear-code.com>
4
4
  #
5
5
  # This library is free software; you can redistribute it and/or
6
6
  # modify it under the terms of the GNU Lesser General Public
@@ -379,4 +379,13 @@ class PatriciaTrieTest < Test::Unit::TestCase
379
379
  numbers.add(7)
380
380
  assert_equal([1, 2, 5, 7], numbers.collect {|number| number.key})
381
381
  end
382
+
383
+ def test_added?
384
+ users = Groonga::PatriciaTrie.create(:name => "Users",
385
+ :key_type => "ShortText")
386
+ bob = users.add("bob")
387
+ assert_predicate(bob, :added?)
388
+ bob_again = users.add("bob")
389
+ assert_not_predicate(bob_again, :added?)
390
+ end
382
391
  end