rroonga 0.9.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (198) hide show
  1. data/AUTHORS +5 -0
  2. data/NEWS.ja.rdoc +114 -0
  3. data/NEWS.rdoc +116 -0
  4. data/README.ja.rdoc +65 -0
  5. data/README.rdoc +66 -0
  6. data/Rakefile +205 -0
  7. data/benchmark/common.rb +49 -0
  8. data/benchmark/read-write-many-small-items.rb +144 -0
  9. data/benchmark/write-many-small-items.rb +135 -0
  10. data/example/bookmark.rb +161 -0
  11. data/example/index-html.rb +89 -0
  12. data/example/search/config.ru +230 -0
  13. data/example/search/public/css/groonga.css +122 -0
  14. data/ext/.gitignore +2 -0
  15. data/ext/groonga/extconf.rb +93 -0
  16. data/ext/groonga/mkmf.log +99 -0
  17. data/ext/groonga/rb-grn-accessor.c +52 -0
  18. data/ext/groonga/rb-grn-array-cursor.c +36 -0
  19. data/ext/groonga/rb-grn-array.c +210 -0
  20. data/ext/groonga/rb-grn-column.c +573 -0
  21. data/ext/groonga/rb-grn-context.c +662 -0
  22. data/ext/groonga/rb-grn-database.c +472 -0
  23. data/ext/groonga/rb-grn-encoding-support.c +64 -0
  24. data/ext/groonga/rb-grn-encoding.c +257 -0
  25. data/ext/groonga/rb-grn-exception.c +1110 -0
  26. data/ext/groonga/rb-grn-expression-builder.c +75 -0
  27. data/ext/groonga/rb-grn-expression.c +731 -0
  28. data/ext/groonga/rb-grn-fix-size-column.c +166 -0
  29. data/ext/groonga/rb-grn-hash-cursor.c +38 -0
  30. data/ext/groonga/rb-grn-hash.c +294 -0
  31. data/ext/groonga/rb-grn-index-column.c +488 -0
  32. data/ext/groonga/rb-grn-logger.c +504 -0
  33. data/ext/groonga/rb-grn-object.c +1369 -0
  34. data/ext/groonga/rb-grn-operation.c +198 -0
  35. data/ext/groonga/rb-grn-patricia-trie-cursor.c +39 -0
  36. data/ext/groonga/rb-grn-patricia-trie.c +488 -0
  37. data/ext/groonga/rb-grn-procedure.c +52 -0
  38. data/ext/groonga/rb-grn-query.c +260 -0
  39. data/ext/groonga/rb-grn-record.c +40 -0
  40. data/ext/groonga/rb-grn-snippet.c +334 -0
  41. data/ext/groonga/rb-grn-table-cursor-key-support.c +69 -0
  42. data/ext/groonga/rb-grn-table-cursor.c +247 -0
  43. data/ext/groonga/rb-grn-table-key-support.c +714 -0
  44. data/ext/groonga/rb-grn-table.c +1977 -0
  45. data/ext/groonga/rb-grn-type.c +181 -0
  46. data/ext/groonga/rb-grn-utils.c +769 -0
  47. data/ext/groonga/rb-grn-variable-size-column.c +36 -0
  48. data/ext/groonga/rb-grn-variable.c +108 -0
  49. data/ext/groonga/rb-grn-view-accessor.c +53 -0
  50. data/ext/groonga/rb-grn-view-cursor.c +35 -0
  51. data/ext/groonga/rb-grn-view-record.c +41 -0
  52. data/ext/groonga/rb-grn-view.c +421 -0
  53. data/ext/groonga/rb-grn.h +698 -0
  54. data/ext/groonga/rb-groonga.c +107 -0
  55. data/extconf.rb +130 -0
  56. data/html/bar.svg +153 -0
  57. data/html/developer.html +117 -0
  58. data/html/developer.svg +469 -0
  59. data/html/download.svg +253 -0
  60. data/html/favicon.ico +0 -0
  61. data/html/favicon.xcf +0 -0
  62. data/html/footer.html.erb +28 -0
  63. data/html/head.html.erb +4 -0
  64. data/html/header.html.erb +17 -0
  65. data/html/index.html +147 -0
  66. data/html/install.svg +636 -0
  67. data/html/logo.xcf +0 -0
  68. data/html/ranguba.css +250 -0
  69. data/html/tutorial.svg +559 -0
  70. data/lib/groonga.rb +90 -0
  71. data/lib/groonga/context.rb +184 -0
  72. data/lib/groonga/expression-builder.rb +324 -0
  73. data/lib/groonga/patricia-trie.rb +85 -0
  74. data/lib/groonga/record.rb +311 -0
  75. data/lib/groonga/schema.rb +1191 -0
  76. data/lib/groonga/view-record.rb +56 -0
  77. data/license/GPL +340 -0
  78. data/license/LGPL +504 -0
  79. data/license/RUBY +59 -0
  80. data/misc/grnop2ruby.rb +49 -0
  81. data/pkg-config.rb +333 -0
  82. data/rroonga-build.rb +57 -0
  83. data/test-unit/Rakefile +40 -0
  84. data/test-unit/TODO +5 -0
  85. data/test-unit/bin/testrb +5 -0
  86. data/test-unit/html/classic.html +15 -0
  87. data/test-unit/html/index.html +25 -0
  88. data/test-unit/html/index.html.ja +27 -0
  89. data/test-unit/lib/test/unit.rb +323 -0
  90. data/test-unit/lib/test/unit/assertionfailederror.rb +25 -0
  91. data/test-unit/lib/test/unit/assertions.rb +1230 -0
  92. data/test-unit/lib/test/unit/attribute.rb +125 -0
  93. data/test-unit/lib/test/unit/autorunner.rb +360 -0
  94. data/test-unit/lib/test/unit/collector.rb +36 -0
  95. data/test-unit/lib/test/unit/collector/descendant.rb +23 -0
  96. data/test-unit/lib/test/unit/collector/dir.rb +108 -0
  97. data/test-unit/lib/test/unit/collector/load.rb +144 -0
  98. data/test-unit/lib/test/unit/collector/objectspace.rb +34 -0
  99. data/test-unit/lib/test/unit/color-scheme.rb +102 -0
  100. data/test-unit/lib/test/unit/color.rb +96 -0
  101. data/test-unit/lib/test/unit/diff.rb +724 -0
  102. data/test-unit/lib/test/unit/error.rb +130 -0
  103. data/test-unit/lib/test/unit/exceptionhandler.rb +39 -0
  104. data/test-unit/lib/test/unit/failure.rb +136 -0
  105. data/test-unit/lib/test/unit/fixture.rb +176 -0
  106. data/test-unit/lib/test/unit/notification.rb +129 -0
  107. data/test-unit/lib/test/unit/omission.rb +191 -0
  108. data/test-unit/lib/test/unit/pending.rb +150 -0
  109. data/test-unit/lib/test/unit/priority.rb +180 -0
  110. data/test-unit/lib/test/unit/runner/console.rb +52 -0
  111. data/test-unit/lib/test/unit/runner/emacs.rb +8 -0
  112. data/test-unit/lib/test/unit/runner/tap.rb +8 -0
  113. data/test-unit/lib/test/unit/testcase.rb +476 -0
  114. data/test-unit/lib/test/unit/testresult.rb +89 -0
  115. data/test-unit/lib/test/unit/testsuite.rb +110 -0
  116. data/test-unit/lib/test/unit/ui/console/outputlevel.rb +14 -0
  117. data/test-unit/lib/test/unit/ui/console/testrunner.rb +466 -0
  118. data/test-unit/lib/test/unit/ui/emacs/testrunner.rb +63 -0
  119. data/test-unit/lib/test/unit/ui/tap/testrunner.rb +92 -0
  120. data/test-unit/lib/test/unit/ui/testrunner.rb +28 -0
  121. data/test-unit/lib/test/unit/ui/testrunnermediator.rb +77 -0
  122. data/test-unit/lib/test/unit/ui/testrunnerutilities.rb +41 -0
  123. data/test-unit/lib/test/unit/util/backtracefilter.rb +41 -0
  124. data/test-unit/lib/test/unit/util/method-owner-finder.rb +28 -0
  125. data/test-unit/lib/test/unit/util/observable.rb +90 -0
  126. data/test-unit/lib/test/unit/util/procwrapper.rb +48 -0
  127. data/test-unit/lib/test/unit/version.rb +7 -0
  128. data/test-unit/sample/adder.rb +13 -0
  129. data/test-unit/sample/subtracter.rb +12 -0
  130. data/test-unit/sample/test_adder.rb +20 -0
  131. data/test-unit/sample/test_subtracter.rb +20 -0
  132. data/test-unit/sample/test_user.rb +23 -0
  133. data/test-unit/test/collector/test-descendant.rb +133 -0
  134. data/test-unit/test/collector/test-load.rb +442 -0
  135. data/test-unit/test/collector/test_dir.rb +406 -0
  136. data/test-unit/test/collector/test_objectspace.rb +100 -0
  137. data/test-unit/test/run-test.rb +15 -0
  138. data/test-unit/test/test-attribute.rb +86 -0
  139. data/test-unit/test/test-color-scheme.rb +67 -0
  140. data/test-unit/test/test-color.rb +47 -0
  141. data/test-unit/test/test-diff.rb +518 -0
  142. data/test-unit/test/test-emacs-runner.rb +60 -0
  143. data/test-unit/test/test-fixture.rb +287 -0
  144. data/test-unit/test/test-notification.rb +33 -0
  145. data/test-unit/test/test-omission.rb +81 -0
  146. data/test-unit/test/test-pending.rb +70 -0
  147. data/test-unit/test/test-priority.rb +119 -0
  148. data/test-unit/test/test-testcase.rb +544 -0
  149. data/test-unit/test/test_assertions.rb +1151 -0
  150. data/test-unit/test/test_error.rb +26 -0
  151. data/test-unit/test/test_failure.rb +33 -0
  152. data/test-unit/test/test_testresult.rb +113 -0
  153. data/test-unit/test/test_testsuite.rb +129 -0
  154. data/test-unit/test/testunit-test-util.rb +14 -0
  155. data/test-unit/test/ui/test_testrunmediator.rb +20 -0
  156. data/test-unit/test/util/test-method-owner-finder.rb +38 -0
  157. data/test-unit/test/util/test_backtracefilter.rb +41 -0
  158. data/test-unit/test/util/test_observable.rb +102 -0
  159. data/test-unit/test/util/test_procwrapper.rb +36 -0
  160. data/test/.gitignore +1 -0
  161. data/test/groonga-test-utils.rb +134 -0
  162. data/test/run-test.rb +58 -0
  163. data/test/test-array.rb +90 -0
  164. data/test/test-column.rb +316 -0
  165. data/test/test-context-select.rb +93 -0
  166. data/test/test-context.rb +73 -0
  167. data/test/test-database.rb +113 -0
  168. data/test/test-encoding.rb +33 -0
  169. data/test/test-exception.rb +93 -0
  170. data/test/test-expression-builder.rb +217 -0
  171. data/test/test-expression.rb +134 -0
  172. data/test/test-fix-size-column.rb +65 -0
  173. data/test/test-gqtp.rb +72 -0
  174. data/test/test-hash.rb +305 -0
  175. data/test/test-index-column.rb +81 -0
  176. data/test/test-logger.rb +37 -0
  177. data/test/test-patricia-trie.rb +205 -0
  178. data/test/test-procedure.rb +37 -0
  179. data/test/test-query.rb +22 -0
  180. data/test/test-record.rb +243 -0
  181. data/test/test-remote.rb +54 -0
  182. data/test/test-schema-view.rb +90 -0
  183. data/test/test-schema.rb +459 -0
  184. data/test/test-snippet.rb +130 -0
  185. data/test/test-table-cursor.rb +153 -0
  186. data/test/test-table-offset-and-limit.rb +102 -0
  187. data/test/test-table-select-normalize.rb +53 -0
  188. data/test/test-table-select.rb +150 -0
  189. data/test/test-table.rb +594 -0
  190. data/test/test-type.rb +71 -0
  191. data/test/test-variable-size-column.rb +98 -0
  192. data/test/test-variable.rb +28 -0
  193. data/test/test-vector-column.rb +76 -0
  194. data/test/test-version.rb +31 -0
  195. data/test/test-view.rb +72 -0
  196. data/text/TUTORIAL.ja.rdoc +392 -0
  197. data/text/expression.rdoc +284 -0
  198. metadata +275 -0
data/AUTHORS ADDED
@@ -0,0 +1,5 @@
1
+ Kouhei Sutou <kou@clear-code.com>
2
+ Tasuku SUENAGA <a@razil.jp>
3
+ daijiro <morita@razil.jp>
4
+ Yuto HAYAMIZU <y.hayamizu@gmail.com>
5
+ SHIDARA Yoji <dara@shidara.net>
data/NEWS.ja.rdoc ADDED
@@ -0,0 +1,114 @@
1
+ = お知らせ
2
+
3
+ == 0.9.1: 2010-02-09
4
+
5
+ * groonga 0.1.6対応
6
+
7
+ == 0.9.0: 2010-02-09
8
+
9
+ * groonga 0.1.5対応
10
+ * APIの追加
11
+ * Groonga::Object#context
12
+ * Groonga::Record#n_sub_records
13
+ * Groonga::Context#send
14
+ * Groonga::Context#receive
15
+ * Groonga::PatriciaTrie#prefix_search [Tasuku SUENAGA]
16
+ * Groonga::Object#path [Ryo Onodera]
17
+ * Groonga::Object#lock [Tasuku SUENAGA]
18
+ * Groonga::Object#unlock [Tasuku SUENAGA]
19
+ * Groonga::Object#locked? [Tasuku SUENAGA]
20
+ * Groonga::Object#temporary?
21
+ * Groonga::Object#persistent?
22
+ * Groonga::ObjectClosed
23
+ * Groonga::Context.[]
24
+ * Groonga::Table#column_value
25
+ * Groonga::Table#set_column_value
26
+ * APIの変更
27
+ * Groonga::Table#select, Groonga::Column#select
28
+ * Groonga::Expressionも受け付けるようになった
29
+ * grn式のシンタックスを指定する:syntaxオプションの追加
30
+ * Groonga::Table#open_cursor
31
+ * 開始位置を指定する:offsetオプションの追加
32
+ * 最大レコード数を指定する:limitオプションの追加
33
+ * Groonga::Expression.parseの引数を変更
34
+ * (nil (default) -> :column) -> (nil (default) -> :query)
35
+ * :column -> 廃止
36
+ * :table -> :query
37
+ * :table_query -> :query
38
+ * :expression -> :script
39
+ * :language -> :script
40
+ * Groonga::Table#define_column, Groonga::Table#define_index_column
41
+ * 永続テーブルをデフォルトにした
42
+ * Groonga::Table#[]をGroonga::Table#valueに変更
43
+ * Groonga::Table#[]=をGroonga::Table#set_valueに変更
44
+ * Groonga::Table#findをGroonga::Table#[]に変更
45
+ * Groonga::Table#findは非推奨
46
+ * Groonga::Table#[]=を削除
47
+ * Groonga::TableKeySupport#[]=はGroonga::TableKeySupport#addの別名
48
+ * Groonga::Recordで存在しないカラムにアクセスしたときの例外を
49
+ Groonga::InvalidArgumentからGroonga::NoSuchColumnに変更
50
+ * バグ修正
51
+ * スキーマにコンテキストが伝搬されない問題の修正 [dara]
52
+ * Groonga::PatriciaTrie#tag_keysが最後のテキストを返さない問題の修正
53
+ [Ryo Onodera]
54
+ * extconf.rbにデバッグモードでビルドする--with-debugオプションを追加
55
+ * Ruby 1.9.1でextconf.rbが失敗する問題の修正
56
+
57
+ === 感謝
58
+
59
+ * dara
60
+ * Ryo Onodera
61
+ * Tasuku SUENAGA
62
+
63
+ == 0.0.7: 2009-10-02
64
+
65
+ * groonga 0.1.4対応
66
+ * APIの追加
67
+ * Groonga::PatriciaTrie#scan
68
+ * Groonga::PatriciaTrie#tag_keys
69
+ * Groonga::Expression#snippet
70
+ * Groonga::Object#append
71
+ * Groonga::Object#prepend
72
+
73
+ == 0.0.6: 2009-07-31
74
+
75
+ * groonga 0.1.1対応
76
+ * ドキュメントの修正 [id:mat_aki]
77
+ * Groonga::Table#selectでのg式対応
78
+ * APIの追加
79
+ * Groonga::Table#union!
80
+ * Groonga::Table#intersect!
81
+ * Groonga::Table#differene!
82
+ * Groonga::Table#merge!
83
+ * tar.gzも提供 [id:m_seki]
84
+ * メモリリークの修正
85
+
86
+ == 0.0.3: 2009-07-18
87
+
88
+ * [#26145] Groonga::TableKeySupport#has_key?の追加 [Tasuku SUENAGA]
89
+ * [#26146] カラム名が存在しない場合はGroonga::Record#[]が例外
90
+ をあげるように変更 [Tasuku SUENAGA]
91
+ * 32ビット環境をサポート [niku]
92
+ * N-gramインデックスサーチのテストを追加 [dara]
93
+ * APIの追加
94
+ * Groonga::Record#incemrent!
95
+ * Groonga::Record#decemrent!
96
+ * Groonga::Record#lock
97
+ * Groonga::Table#lock
98
+ * Groonga::Schema: スキーマ定義用DSL
99
+ * Groonga::Expression
100
+
101
+ == 0.0.2: 2009-06-04
102
+
103
+ * groonga 0.0.8対応 [mori]
104
+ * 性能向上: キー、値、ドメイン、レンジをキャッシュ
105
+ * API改良
106
+ * ドキュメントの追加
107
+ * Ruby 1.9対応
108
+ * バグ修正:
109
+ * インストール処理の修正 [Tasuku SUENAGA]
110
+ * メモリリーク修正
111
+
112
+ == 0.0.1: 2009-04-30
113
+
114
+ * 最初のリリース!
data/NEWS.rdoc ADDED
@@ -0,0 +1,116 @@
1
+ = NEWS
2
+
3
+ == 0.9.1: 2010-02-09
4
+
5
+ * Supported groonga 0.1.6
6
+
7
+ == 0.9.0: 2010-02-09
8
+
9
+ * Supported groonga 0.1.5
10
+ * Added API
11
+ * Groonga::Object#context
12
+ * Groonga::Record#n_sub_records
13
+ * Groonga::Context#send
14
+ * Groonga::Context#receive
15
+ * Groonga::PatriciaTrie#prefix_search [Tasuku SUENAGA]
16
+ * Groonga::Object#path [Ryo Onodera]
17
+ * Groonga::Object#lock [Tasuku SUENAGA]
18
+ * Groonga::Object#unlock [Tasuku SUENAGA]
19
+ * Groonga::Object#locked? [Tasuku SUENAGA]
20
+ * Groonga::Object#temporary?
21
+ * Groonga::Object#persistent?
22
+ * Groonga::ObjectClosed
23
+ * Groonga::Context.[]
24
+ * Groonga::Table#column_value
25
+ * Groonga::Table#set_column_value
26
+ * Changed API
27
+ * Groonga::Table#select, Groonga::Column#select
28
+ * They also accept Groonga::Expression
29
+ * Added :syntax option that specifies grn expression syntax
30
+ * Groonga::Table#open_cursor
31
+ * Added :offset option that specifies offset.
32
+ * Added :limit option that specifies max number of records.
33
+ * Changed Groonga::Expression.parse options:
34
+ * (nil (default) -> :column) -> (nil (default) -> :query)
35
+ * :column -> removed
36
+ * :table -> :query
37
+ * :table_query -> :query
38
+ * :expression -> :script
39
+ * :language -> :script
40
+ * Groonga::Table#define_column, Groonga::Table#define_index_column
41
+ * Defined column becomes persistent table by default
42
+ * Groonga::Table#[] -> Groonga::Table#value
43
+ * Groonga::Table#[]= -> Groonga::Table#set_value
44
+ * Groonga::Table#find -> Groonga::Table#[]
45
+ * Groonga::Table#find -> obsolete
46
+ * Groonga::Table#[]= -> removed
47
+ * Groonga::TableKeySupport#[]= is alias of Groonga::TableKeySupport#add
48
+ * Changed exception class to Groonga::NoSuchColumn from
49
+ Groonga::InvalidArgument when Groonga::Record accesses nonexistent
50
+ a column.
51
+ * Bug fixes
52
+ * Fixed a bug that context isn't passed to schema [dara]
53
+ * Fixed a bug that Groonga::PatriciaTrie#tag_keys doesn't return
54
+ that last text.
55
+ [Ryo Onodera]
56
+ * Added --with-debug option to extconf.rb for debug build.
57
+ * Fixed a bug that Ruby 1.9.1 may fail extconf.rb.
58
+
59
+ === Thanks
60
+
61
+ * dara
62
+ * Ryo Onodera
63
+ * Tasuku SUENAGA
64
+
65
+ == 0.0.7: 2009-10-02
66
+
67
+ * Supported groonga 0.1.4
68
+ * Added API
69
+ * Groonga::PatriciaTrie#scan
70
+ * Groonga::PatriciaTrie#tag_keys
71
+ * Groonga::Expression#snippet
72
+ * Groonga::Object#append
73
+ * Groonga::Object#prepend
74
+
75
+ == 0.0.6: 2009-07-31
76
+
77
+ * Supported groonga 0.1.1.
78
+ * Fixed documents [id:mat_aki]
79
+ * Supported groonga expression for searching.
80
+ * Added API
81
+ * Groonga::Table#union!
82
+ * Groonga::Table#intersect!
83
+ * Groonga::Table#differene!
84
+ * Groonga::Table#merge!
85
+ * Provided tar.gz [id:m_seki]
86
+ * Fixed memory leaks
87
+
88
+ == 0.0.3: 2009-07-18
89
+
90
+ * [#26145] Added Groonga::TableKeySupport#has_key? [Tasuku SUENAGA]
91
+ * [#26146] Groonga::Record#[] raises an exception for nonexistent
92
+ column name. [Tasuku SUENAGA]
93
+ * Supported 32bit environment [niku]
94
+ * Added a test for N-gram index search [dara]
95
+ * Added APIs
96
+ * Groonga::Record#incemrent!
97
+ * Groonga::Record#decemrent!
98
+ * Groonga::Record#lock
99
+ * Groonga::Table#lock
100
+ * Groonga::Schema: A DSL for schema definition
101
+ * Groonga::Expression
102
+
103
+ == 0.0.2: 2009-06-04
104
+
105
+ * Supported groonga 0.0.8 [mori]
106
+ * Improved preformance: cache key, value, domain and range
107
+ * Improved API
108
+ * Added documents
109
+ * Supported Ruby 1.9
110
+ * Bug fixes:
111
+ * Fixed install process [Tasuku SUENAGA]
112
+ * Fixed memory leaks
113
+
114
+ == 0.0.1: 2009-04-30
115
+
116
+ * Initial release!
data/README.ja.rdoc ADDED
@@ -0,0 +1,65 @@
1
+ = はじめに
2
+
3
+ == 名前
4
+
5
+ rroonga
6
+
7
+ == 説明
8
+
9
+ 全文検索機能とカラムストア機能を提供するgroongaのRubyバイン
10
+ ディングです。
11
+
12
+ groongaのいわゆるDB-API層をRubyから使うための拡張ライブラリで
13
+ す。groongaのAPIをそのままRubyレベルに提供するのではなく、
14
+ Rubyらしく読み書きしやすいAPIとして提供します。高速・高機能な
15
+ groongaをRubyらしい書き方で利用できます。
16
+
17
+ groongaに関する情報は以下を参照して下さい。
18
+
19
+ * groonga: http://groonga.org/
20
+
21
+ == 作者
22
+
23
+ Kouhei Sutou:: <tt><kou@clear-code.com></tt>
24
+ Tasuku SUENAGA:: <tt><a@razil.jp></tt>
25
+ daijiro:: <tt><morita@razil.jp></tt>
26
+ Yuto HAYAMIZU:: <tt><y.hayamizu@gmail.com></tt>
27
+ SHIDARA Yoji:: <tt><dara@shidara.net></tt>
28
+
29
+ == ライセンス
30
+
31
+ LGPL 2.1です。詳しくはlicense/LGPLを見てください。
32
+
33
+ pkg-config.rbはrcairoに付属しているもので、これはRubyライセ
34
+ ンスです。詳しくはlicense/RUBYとlicense/GPLを見てください。
35
+
36
+ == 依存ソフトウェア
37
+
38
+ * Ruby >= 1.8 (1.9.1対応)
39
+ * groonga >= 0.1.9
40
+
41
+ == インストール
42
+
43
+ % sudo gem install rroonga
44
+
45
+ == ドキュメント
46
+
47
+ http://groonga.rubyforge.org/rroonga/
48
+
49
+ == メーリングリスト
50
+
51
+ 質問、要望、バグ報告などはgroongaのMLにお願いします。
52
+
53
+ http://lists.sourceforge.jp/mailman/listinfo/groonga-dev
54
+
55
+ == 感謝
56
+
57
+ * 森さん: 最新groonga対応パッチをくれました。
58
+ * グニャラくん: バグレポートしてくれました。
59
+ * にくさん: バグレポートしてくれました。
60
+ * daraさん:
61
+ * テストを書いてくれました。
62
+ * バグを直してくれました。
63
+ * id:mat_akiさん: チュートリアルのバグを教えてくれました。
64
+ * @yune_kotomi: バグレポートしてくれました。
65
+ * 咳さん: バグレポートしてくれました。
data/README.rdoc ADDED
@@ -0,0 +1,66 @@
1
+ = README
2
+
3
+ == Name
4
+
5
+ rroonga
6
+
7
+ == Description
8
+
9
+ Ruby bindings for groonga that provides full text search and
10
+ column store features.
11
+
12
+ rroonga is a extension library to use groonga's DB-API
13
+ layer. rroonga provides Rubyish readable and writable
14
+ API. You can use groonga's first and highly functional
15
+ features from Ruby.
16
+
17
+ See the following URL about groonga.
18
+
19
+ * groonga: http://groonga.org/
20
+
21
+ == Authors
22
+
23
+ Kouhei Sutou:: <tt><kou@clear-code.com></tt>
24
+ Tasuku SUENAGA:: <tt><a@razil.jp></tt>
25
+ daijiro:: <tt><morita@razil.jp></tt>
26
+ Yuto HAYAMIZU:: <tt><y.hayamizu@gmail.com></tt>
27
+ SHIDARA Yoji:: <tt><dara@shidara.net></tt>
28
+
29
+ == License
30
+
31
+ LGPL 2.1. See license/LGPL for details.
32
+
33
+ pkg-config.rb is a library that is bundled with rcairo. It's
34
+ distributed under Ruby license. See license/RUBY and
35
+ license/GPL for details.
36
+
37
+ == Dependencies
38
+
39
+ * Ruby >= 1.8 (including 1.9.1)
40
+ * groonga >= 0.1.9
41
+
42
+ == Install
43
+
44
+ % sudo gem install rroonga
45
+
46
+ == Documents
47
+
48
+ Japanese only. Sorry.
49
+
50
+ http://groonga.rubyforge.org/rroonga/
51
+
52
+ == Mailing list
53
+
54
+ http://rubyforge.org/mailman/listinfo/groonga-users-en
55
+
56
+ == Thanks
57
+
58
+ * mori: sent patches to support the latest groonga.
59
+ * Tasuku SUENAGA: sent bug reports.
60
+ * niku: sent bug reports.
61
+ * dara:
62
+ * wrote tests.
63
+ * fixed bugs.
64
+ * id:mat_aki: sent bug reports.
65
+ * @yune_kotomi: sent a bug report.
66
+ * m_seki: sent bug reports.
data/Rakefile ADDED
@@ -0,0 +1,205 @@
1
+ # -*- coding: utf-8; mode: ruby -*-
2
+ #
3
+ # Copyright (C) 2009-2010 Kouhei Sutou <kou@clear-code.com>
4
+ #
5
+ # This library is free software; you can redistribute it and/or
6
+ # modify it under the terms of the GNU Lesser General Public
7
+ # License version 2.1 as published by the Free Software Foundation.
8
+ #
9
+ # This library is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
+ # Lesser General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU Lesser General Public
15
+ # License along with this library; if not, write to the Free Software
16
+ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
+
18
+ require 'English'
19
+
20
+ require 'find'
21
+ require 'fileutils'
22
+ require 'pathname'
23
+ require 'erb'
24
+ require 'rubygems'
25
+ gem 'rdoc'
26
+ require 'hoe'
27
+ require 'rake/extensiontask'
28
+
29
+ ENV["NODOT"] = "yes"
30
+
31
+ base_dir = File.join(File.dirname(__FILE__))
32
+ truncate_base_dir = Proc.new do |x|
33
+ x.gsub(/^#{Regexp.escape(base_dir + File::SEPARATOR)}/, '')
34
+ end
35
+
36
+ groonga_ext_dir = File.join(base_dir, "ext", "groonga")
37
+ groonga_lib_dir = File.join(base_dir, 'lib')
38
+ $LOAD_PATH.unshift(groonga_ext_dir)
39
+ $LOAD_PATH.unshift(groonga_lib_dir)
40
+ ENV["RUBYLIB"] = "#{groonga_lib_dir}:#{groonga_ext_dir}:#{ENV['RUBYLIB']}"
41
+
42
+ def guess_version
43
+ require 'groonga'
44
+ Groonga.bindings_version
45
+ end
46
+
47
+ manifest = File.join(base_dir, "Manifest.txt")
48
+ manifest_contents = []
49
+ base_dir_included_components = %w(AUTHORS Rakefile
50
+ README.rdoc README.ja.rdoc
51
+ NEWS.rdoc NEWS.ja.rdoc
52
+ rroonga-build.rb extconf.rb pkg-config.rb)
53
+ excluded_components = %w(.cvsignore .gdb_history CVS depend Makefile doc pkg
54
+ .svn .git doc vendor data .test-result tmp)
55
+ excluded_suffixes = %w(.png .ps .pdf .o .so .a .txt .~)
56
+ Find.find(base_dir) do |target|
57
+ target = truncate_base_dir[target]
58
+ components = target.split(File::SEPARATOR)
59
+ if components.size == 1 and !File.directory?(target)
60
+ next unless base_dir_included_components.include?(components[0])
61
+ end
62
+ Find.prune if (excluded_components - components) != excluded_components
63
+ next if excluded_suffixes.include?(File.extname(target))
64
+ manifest_contents << target if File.file?(target)
65
+ end
66
+
67
+ File.open(manifest, "w") do |f|
68
+ f.puts manifest_contents.sort.join("\n")
69
+ end
70
+
71
+ # For Hoe's no user friendly default behavior. :<
72
+ File.open("README.txt", "w") {|file| file << "= Dummy README\n== XXX\n"}
73
+ FileUtils.cp("NEWS.rdoc", "History.txt")
74
+ at_exit do
75
+ FileUtils.rm_f("README.txt")
76
+ FileUtils.rm_f("History.txt")
77
+ FileUtils.rm_f(manifest)
78
+ end
79
+
80
+ def cleanup_white_space(entry)
81
+ entry.gsub(/(\A\n+|\n+\z)/, '') + "\n"
82
+ end
83
+
84
+ ENV["VERSION"] ||= guess_version
85
+ version = ENV["VERSION"]
86
+ project = nil
87
+ Hoe.spec('rroonga') do |_project|
88
+ Hoe::Test::SUPPORTED_TEST_FRAMEWORKS[:testunit2] = "test/run-test.rb"
89
+ project = _project
90
+ project.version = version
91
+ project.rubyforge_name = 'groonga'
92
+ authors = File.join(base_dir, "AUTHORS")
93
+ project.author = File.readlines(authors).collect do |line|
94
+ if /\s*<[^<>]*>$/ =~ line
95
+ $PREMATCH
96
+ else
97
+ nil
98
+ end
99
+ end.compact
100
+ project.email = ['groonga-users-en@rubyforge.org',
101
+ 'groonga-dev@lists.sourceforge.jp']
102
+ project.url = 'http://groonga.rubyforge.org/'
103
+ project.testlib = :testunit2
104
+ project.test_globs = ["test/run-test.rb"]
105
+ project.spec_extras = {
106
+ :extensions => ['extconf.rb'],
107
+ :require_paths => ["lib", "ext/groonga"],
108
+ :extra_rdoc_files => Dir.glob("**/*.rdoc"),
109
+ }
110
+ project.readme_file = "README.ja.rdoc"
111
+
112
+ news_of_current_release = File.read("NEWS.rdoc").split(/^==\s.*$/)[1]
113
+ project.changes = cleanup_white_space(news_of_current_release)
114
+
115
+ entries = File.read("README.rdoc").split(/^==\s(.*)$/)
116
+ description = cleanup_white_space(entries[entries.index("Description") + 1])
117
+ project.summary, project.description, = description.split(/\n\n+/, 3)
118
+
119
+ project.remote_rdoc_dir = "rroonga"
120
+ end
121
+
122
+ project.spec.dependencies.delete_if {|dependency| dependency.name == "hoe"}
123
+
124
+ ObjectSpace.each_object(Rake::RDocTask) do |rdoc_task|
125
+ options = rdoc_task.options
126
+ t_option_index = options.index("--title") || options.index("-t")
127
+ rdoc_task.options[t_option_index, 2] = nil
128
+ rdoc_task.title = "rroonga - #{version}"
129
+
130
+ rdoc_task.rdoc_files = ["ext/rb-groonga.c"] + Dir.glob("ext/rb-grn-*.c")
131
+ rdoc_task.rdoc_files += Dir.glob("lib/**/*.rb")
132
+ rdoc_task.rdoc_files += Dir.glob("**/*.rdoc")
133
+ end
134
+
135
+ Rake::ExtensionTask.new("groonga", project.spec) do |ext|
136
+ ext.cross_compile = true
137
+ end
138
+
139
+ task :publish_docs => [:prepare_docs_for_publishing]
140
+
141
+
142
+ include ERB::Util
143
+
144
+ def apply_template(file, head, header, footer)
145
+ content = File.read(file)
146
+ content = content.sub(/lang="en"/, 'lang="ja"')
147
+
148
+ title = nil
149
+ content = content.sub(/<title>(.+?)<\/title>/) do
150
+ title = $1
151
+ head.result(binding)
152
+ end
153
+
154
+ content = content.sub(/<body(?:.*?)>/) do |body_start|
155
+ "#{body_start}\n#{header.result(binding)}\n"
156
+ end
157
+
158
+ content = content.sub(/<\/body/) do |body_end|
159
+ "\n#{footer.result(binding)}\n#{body_end}"
160
+ end
161
+
162
+ File.open(file, "w") do |file|
163
+ file.print(content)
164
+ end
165
+ end
166
+
167
+ def erb_template(name)
168
+ file = File.join("html", "#{name}.html.erb")
169
+ template = File.read(file)
170
+ erb = ERB.new(template, nil, "-")
171
+ erb.filename = file
172
+ erb
173
+ end
174
+
175
+ task :prepare_docs_for_publishing do
176
+ head = erb_template("head")
177
+ header = erb_template("header")
178
+ footer = erb_template("footer")
179
+ Find.find("doc") do |file|
180
+ if /\.html\z/ =~ file and /_(?:c|rb)\.html\z/ !~ file
181
+ apply_template(file, head, header, footer)
182
+ end
183
+ end
184
+ end
185
+
186
+ task :publish_html do
187
+ config = YAML.load(File.read(File.expand_path("~/.rubyforge/user-config.yml")))
188
+ host = "#{config["username"]}@rubyforge.org"
189
+
190
+ rsync_args = "-av --exclude '*.erb' --exclude '*.svg' --exclude .svn"
191
+ remote_dir = "/var/www/gforge-projects/#{project.rubyforge_name}/"
192
+ sh "rsync #{rsync_args} html/ #{host}:#{remote_dir}"
193
+ end
194
+
195
+ task :tag do
196
+ repository = "svn+ssh://rubyforge.org/var/svn/groonga/rroonga"
197
+ sh("svn cp -m 'release #{version}!!!' " +
198
+ "#{repository}/trunk #{repository}/tags/#{version}")
199
+ end
200
+
201
+ # fix Hoe's incorrect guess.
202
+ project.spec.executables.clear
203
+ # project.lib_files = project.spec.files.grep(%r|^src/lib/|)
204
+
205
+ task(:release).prerequisites.reject! {|name| name == "clean"}