rroonga 1.0.1 → 1.0.2

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 (135) hide show
  1. data/NEWS.ja.rdoc +46 -0
  2. data/NEWS.rdoc +46 -0
  3. data/README.ja.rdoc +2 -2
  4. data/README.rdoc +2 -3
  5. data/Rakefile +148 -11
  6. data/example/bookmark.rb +94 -91
  7. data/ext/groonga/extconf.rb +25 -25
  8. data/ext/groonga/groonga.def +2 -0
  9. data/ext/groonga/mkmf.log +7 -7
  10. data/ext/groonga/rb-grn-column.c +66 -0
  11. data/ext/groonga/rb-grn-context.c +92 -5
  12. data/ext/groonga/rb-grn-database.c +24 -1
  13. data/ext/groonga/rb-grn-exception.c +15 -0
  14. data/ext/groonga/rb-grn-hash.c +2 -2
  15. data/ext/groonga/rb-grn-index-column.c +8 -4
  16. data/ext/groonga/rb-grn-object.c +4 -2
  17. data/ext/groonga/rb-grn-patricia-trie.c +2 -2
  18. data/ext/groonga/rb-grn-snippet.c +1 -0
  19. data/ext/groonga/rb-grn-table-key-support.c +22 -19
  20. data/ext/groonga/rb-grn-table.c +63 -5
  21. data/ext/groonga/rb-grn.h +1 -1
  22. data/ext/groonga/rb-groonga.c +1 -0
  23. data/extconf.rb +1 -1
  24. data/html/developer.html +8 -2
  25. data/html/favicon.ico +0 -0
  26. data/html/favicon.svg +591 -0
  27. data/html/index.html +71 -8
  28. data/html/logo.svg +612 -0
  29. data/html/ranguba.css +92 -7
  30. data/html/readme.svg +256 -0
  31. data/lib/groonga/expression-builder.rb +8 -4
  32. data/lib/groonga/record.rb +77 -7
  33. data/lib/groonga/schema.rb +429 -100
  34. data/rroonga-build.rb +1 -1
  35. data/test/run-test.rb +1 -1
  36. data/test/test-array.rb +4 -0
  37. data/test/test-context.rb +8 -0
  38. data/test/test-database.rb +8 -1
  39. data/test/test-expression-builder.rb +14 -0
  40. data/test/test-fix-size-column.rb +4 -0
  41. data/test/test-hash.rb +10 -4
  42. data/test/test-index-column.rb +11 -0
  43. data/test/test-patricia-trie.rb +7 -1
  44. data/test/test-record.rb +14 -0
  45. data/test/test-remote.rb +3 -2
  46. data/test/test-schema-create-table.rb +32 -2
  47. data/test/test-schema.rb +108 -11
  48. data/test/test-table-select-normalize.rb +7 -3
  49. data/test/test-table-select.rb +12 -0
  50. data/test/test-table.rb +7 -0
  51. data/test/test-variable-size-column.rb +4 -0
  52. data/test-unit/Rakefile +40 -0
  53. data/test-unit/TODO +5 -0
  54. data/test-unit/bin/testrb +5 -0
  55. data/test-unit/html/classic.html +15 -0
  56. data/test-unit/html/index.html +25 -0
  57. data/test-unit/html/index.html.ja +27 -0
  58. data/test-unit/lib/test/unit/assertionfailederror.rb +25 -0
  59. data/test-unit/lib/test/unit/assertions.rb +1230 -0
  60. data/test-unit/lib/test/unit/attribute.rb +125 -0
  61. data/test-unit/lib/test/unit/autorunner.rb +360 -0
  62. data/test-unit/lib/test/unit/collector/descendant.rb +23 -0
  63. data/test-unit/lib/test/unit/collector/dir.rb +108 -0
  64. data/test-unit/lib/test/unit/collector/load.rb +144 -0
  65. data/test-unit/lib/test/unit/collector/objectspace.rb +34 -0
  66. data/test-unit/lib/test/unit/collector.rb +36 -0
  67. data/test-unit/lib/test/unit/color-scheme.rb +102 -0
  68. data/test-unit/lib/test/unit/color.rb +96 -0
  69. data/test-unit/lib/test/unit/diff.rb +724 -0
  70. data/test-unit/lib/test/unit/error.rb +130 -0
  71. data/test-unit/lib/test/unit/exceptionhandler.rb +39 -0
  72. data/test-unit/lib/test/unit/failure.rb +136 -0
  73. data/test-unit/lib/test/unit/fixture.rb +176 -0
  74. data/test-unit/lib/test/unit/notification.rb +129 -0
  75. data/test-unit/lib/test/unit/omission.rb +191 -0
  76. data/test-unit/lib/test/unit/pending.rb +150 -0
  77. data/test-unit/lib/test/unit/priority.rb +180 -0
  78. data/test-unit/lib/test/unit/runner/console.rb +52 -0
  79. data/test-unit/lib/test/unit/runner/emacs.rb +8 -0
  80. data/test-unit/lib/test/unit/runner/tap.rb +8 -0
  81. data/test-unit/lib/test/unit/testcase.rb +476 -0
  82. data/test-unit/lib/test/unit/testresult.rb +89 -0
  83. data/test-unit/lib/test/unit/testsuite.rb +110 -0
  84. data/test-unit/lib/test/unit/ui/console/outputlevel.rb +14 -0
  85. data/test-unit/lib/test/unit/ui/console/testrunner.rb +466 -0
  86. data/test-unit/lib/test/unit/ui/emacs/testrunner.rb +63 -0
  87. data/test-unit/lib/test/unit/ui/tap/testrunner.rb +92 -0
  88. data/test-unit/lib/test/unit/ui/testrunner.rb +28 -0
  89. data/test-unit/lib/test/unit/ui/testrunnermediator.rb +77 -0
  90. data/test-unit/lib/test/unit/ui/testrunnerutilities.rb +41 -0
  91. data/test-unit/lib/test/unit/util/backtracefilter.rb +41 -0
  92. data/test-unit/lib/test/unit/util/method-owner-finder.rb +28 -0
  93. data/test-unit/lib/test/unit/util/observable.rb +90 -0
  94. data/test-unit/lib/test/unit/util/procwrapper.rb +48 -0
  95. data/test-unit/lib/test/unit/version.rb +7 -0
  96. data/test-unit/lib/test/unit.rb +323 -0
  97. data/test-unit/sample/adder.rb +13 -0
  98. data/test-unit/sample/subtracter.rb +12 -0
  99. data/test-unit/sample/test_adder.rb +20 -0
  100. data/test-unit/sample/test_subtracter.rb +20 -0
  101. data/test-unit/sample/test_user.rb +23 -0
  102. data/test-unit/test/collector/test-descendant.rb +133 -0
  103. data/test-unit/test/collector/test-load.rb +442 -0
  104. data/test-unit/test/collector/test_dir.rb +406 -0
  105. data/test-unit/test/collector/test_objectspace.rb +100 -0
  106. data/test-unit/test/run-test.rb +15 -0
  107. data/test-unit/test/test-attribute.rb +86 -0
  108. data/test-unit/test/test-color-scheme.rb +67 -0
  109. data/test-unit/test/test-color.rb +47 -0
  110. data/test-unit/test/test-diff.rb +518 -0
  111. data/test-unit/test/test-emacs-runner.rb +60 -0
  112. data/test-unit/test/test-fixture.rb +287 -0
  113. data/test-unit/test/test-notification.rb +33 -0
  114. data/test-unit/test/test-omission.rb +81 -0
  115. data/test-unit/test/test-pending.rb +70 -0
  116. data/test-unit/test/test-priority.rb +119 -0
  117. data/test-unit/test/test-testcase.rb +544 -0
  118. data/test-unit/test/test_assertions.rb +1151 -0
  119. data/test-unit/test/test_error.rb +26 -0
  120. data/test-unit/test/test_failure.rb +33 -0
  121. data/test-unit/test/test_testresult.rb +113 -0
  122. data/test-unit/test/test_testsuite.rb +129 -0
  123. data/test-unit/test/testunit-test-util.rb +14 -0
  124. data/test-unit/test/ui/test_testrunmediator.rb +20 -0
  125. data/test-unit/test/util/test-method-owner-finder.rb +38 -0
  126. data/test-unit/test/util/test_backtracefilter.rb +41 -0
  127. data/test-unit/test/util/test_observable.rb +102 -0
  128. data/test-unit/test/util/test_procwrapper.rb +36 -0
  129. data/text/{TUTORIAL.ja.rdoc → tutorial.ja.rdoc} +165 -126
  130. metadata +106 -16
  131. data/html/favicon.xcf +0 -0
  132. data/html/logo.xcf +0 -0
  133. data/license/GPL +0 -340
  134. data/license/RUBY +0 -59
  135. data/pkg-config.rb +0 -333
data/html/ranguba.css CHANGED
@@ -24,7 +24,8 @@ div.header
24
24
  padding: 0px;
25
25
  }
26
26
 
27
- div.header div.title
27
+ div.header div.title,
28
+ div.header h1.title
28
29
  {
29
30
  background: url(logo.png) no-repeat;
30
31
  font-family: sans-serif;
@@ -37,35 +38,78 @@ div.header div.title
37
38
  }
38
39
 
39
40
  div.header div.title a,
41
+ div.header h1.title a,
40
42
  div.header div.title a:link,
41
- div.header div.title a:visited
43
+ div.header h1.title a:link,
44
+ div.header div.title a:visited,
45
+ div.header h1.title a:visited
42
46
  {
43
47
  color: black;
44
48
  text-decoration: none;
45
49
  }
46
50
 
47
- div.header div.title span
51
+ div.header div.title span,
52
+ div.header h1.title span
48
53
  {
49
54
  display: block;
50
- padding-left: 300px;
55
+ padding-left: 230px;
51
56
  margin-bottom: 2px;
57
+ margin-right: 210px;
52
58
  }
53
59
 
54
- div.header div.title span.title
60
+ div.header div.title span.title,
61
+ div.header h1.title span.title
55
62
  {
56
63
  padding-top: 20px;
57
64
  }
58
65
 
59
- div.header div.title span.title-separator
66
+ div.header div.title span.title-separator,
67
+ div.header h1.title span.title-separator
60
68
  {
61
69
  display: none;
62
70
  }
63
71
 
64
- div.header div.title span.title-project
72
+ div.header div.title span.title-project,
73
+ div.header h1.title span.title-project
65
74
  {
66
75
  padding-bottom: 20px;
67
76
  }
68
77
 
78
+ ul.other-languages
79
+ {
80
+ position: absolute;
81
+ top: 0px;
82
+ right: 50px;
83
+ padding: 0px;
84
+ margin: 0px;
85
+ }
86
+
87
+ ul.other-languages li
88
+ {
89
+ display: block;
90
+ float: left;
91
+ margin-left: 10px;
92
+ }
93
+
94
+ ul.other-languages li a
95
+ {
96
+ display: block;
97
+ height: 11px;
98
+ width: 16px;
99
+ text-indent: -100000px;
100
+ outline: none;
101
+ }
102
+
103
+ ul.other-languages li#other-language-english
104
+ {
105
+ background: url(us.png) no-repeat;
106
+ }
107
+
108
+ ul.other-languages li#other-language-japanese
109
+ {
110
+ background: url(jp.png) no-repeat;
111
+ }
112
+
69
113
  ul.menu
70
114
  {
71
115
  background: url(bar.png) repeat-x;
@@ -115,6 +159,11 @@ ul.menu li#menu-reference
115
159
  background: url(reference.png) no-repeat;
116
160
  }
117
161
 
162
+ ul.menu li#menu-readme
163
+ {
164
+ background: url(readme.png) no-repeat;
165
+ }
166
+
118
167
  ul.menu li#menu-tutorial
119
168
  {
120
169
  background: url(tutorial.png) no-repeat;
@@ -248,3 +297,39 @@ body.file div.content
248
297
  {
249
298
  margin: 40px !important;
250
299
  }
300
+
301
+ /* For GTK-Doc */
302
+ @media screen
303
+ {
304
+ table.navigation#top
305
+ {
306
+ position: relative;
307
+ top: 0;
308
+ margin-top: 20px;
309
+ z-index: 0;
310
+ }
311
+
312
+ div.book
313
+ {
314
+ top: 0px;
315
+ }
316
+
317
+ div.refentry,
318
+ div.chapter,
319
+ div.reference,
320
+ div.part,
321
+ div.book,
322
+ div.glossary,
323
+ div.sect1,
324
+ div.appendix,
325
+ div.preface
326
+ {
327
+ top: 0px;
328
+ }
329
+
330
+ div.footer
331
+ {
332
+ padding-top: 0px;
333
+ padding-bottom: 1em;
334
+ }
335
+ }
data/html/readme.svg ADDED
@@ -0,0 +1,256 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <!-- Created with Inkscape (http://www.inkscape.org/) -->
3
+ <svg
4
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
5
+ xmlns:cc="http://creativecommons.org/ns#"
6
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
7
+ xmlns:svg="http://www.w3.org/2000/svg"
8
+ xmlns="http://www.w3.org/2000/svg"
9
+ xmlns:xlink="http://www.w3.org/1999/xlink"
10
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
11
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
12
+ sodipodi:docname="face-smile.svg"
13
+ sodipodi:docbase="/home/jimmac/gfx/ximian/tango-icon-theme/scalable/emotes"
14
+ inkscape:version="0.46"
15
+ sodipodi:version="0.32"
16
+ id="svg4376"
17
+ height="48px"
18
+ width="48px"
19
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
20
+ <defs
21
+ id="defs3">
22
+ <inkscape:perspective
23
+ sodipodi:type="inkscape:persp3d"
24
+ inkscape:vp_x="0 : 24 : 1"
25
+ inkscape:vp_y="0 : 1000 : 0"
26
+ inkscape:vp_z="48 : 24 : 1"
27
+ inkscape:persp3d-origin="24 : 16 : 1"
28
+ id="perspective39" />
29
+ <linearGradient
30
+ id="linearGradient3290">
31
+ <stop
32
+ id="stop3292"
33
+ offset="0.0000000"
34
+ style="stop-color:#fffcde;stop-opacity:1.0000000;" />
35
+ <stop
36
+ style="stop-color:#f6e76a;stop-opacity:1.0000000;"
37
+ offset="0.64485979"
38
+ id="stop3294" />
39
+ <stop
40
+ id="stop3296"
41
+ offset="1.0000000"
42
+ style="stop-color:#ffb738;stop-opacity:1.0000000;" />
43
+ </linearGradient>
44
+ <radialGradient
45
+ r="8.9020796"
46
+ fy="15.755712"
47
+ fx="29.158466"
48
+ cy="15.720984"
49
+ cx="29.288071"
50
+ gradientUnits="userSpaceOnUse"
51
+ id="radialGradient2714"
52
+ xlink:href="#linearGradient3290"
53
+ inkscape:collect="always" />
54
+ <linearGradient
55
+ id="linearGradient2509">
56
+ <stop
57
+ style="stop-color:#fffbd5;stop-opacity:1.0000000;"
58
+ offset="0.0000000"
59
+ id="stop2511" />
60
+ <stop
61
+ style="stop-color:#edd400;stop-opacity:1.0000000;"
62
+ offset="1.0000000"
63
+ id="stop2513" />
64
+ </linearGradient>
65
+ <radialGradient
66
+ gradientTransform="matrix(1.250000,0.000000,0.000000,1.250000,-6.479446,-13.37211)"
67
+ id="aigrd2"
68
+ cx="25.0527"
69
+ cy="39.5928"
70
+ r="15.7572"
71
+ fx="25.0527"
72
+ fy="39.5928"
73
+ gradientUnits="userSpaceOnUse">
74
+ <stop
75
+ offset="0.0000000"
76
+ style="stop-color:#777777;stop-opacity:1.0000000;"
77
+ id="stop8602" />
78
+ <stop
79
+ offset="1"
80
+ style="stop-color:#000000"
81
+ id="stop8604" />
82
+ </radialGradient>
83
+ <linearGradient
84
+ id="linearGradient4565"
85
+ inkscape:collect="always">
86
+ <stop
87
+ id="stop4567"
88
+ offset="0"
89
+ style="stop-color:#000000;stop-opacity:1;" />
90
+ <stop
91
+ id="stop4569"
92
+ offset="1"
93
+ style="stop-color:#000000;stop-opacity:0;" />
94
+ </linearGradient>
95
+ <linearGradient
96
+ id="linearGradient3824">
97
+ <stop
98
+ id="stop3826"
99
+ offset="0"
100
+ style="stop-color:#ffffff;stop-opacity:1;" />
101
+ <stop
102
+ id="stop3828"
103
+ offset="1.0000000"
104
+ style="stop-color:#c9c9c9;stop-opacity:1.0000000;" />
105
+ </linearGradient>
106
+ <linearGradient
107
+ id="linearGradient3800">
108
+ <stop
109
+ id="stop3802"
110
+ offset="0.0000000"
111
+ style="stop-color:#ffeed6;stop-opacity:1.0000000;" />
112
+ <stop
113
+ style="stop-color:#e49c2f;stop-opacity:1.0000000;"
114
+ offset="0.50000000"
115
+ id="stop8664" />
116
+ <stop
117
+ id="stop3804"
118
+ offset="1.0000000"
119
+ style="stop-color:#ffc66c;stop-opacity:1.0000000;" />
120
+ </linearGradient>
121
+ <radialGradient
122
+ gradientUnits="userSpaceOnUse"
123
+ gradientTransform="matrix(1.000000,0.000000,0.000000,0.333333,0.000000,25.71429)"
124
+ r="19.714285"
125
+ fy="38.571430"
126
+ fx="24.714285"
127
+ cy="38.571430"
128
+ cx="24.714285"
129
+ id="radialGradient4571"
130
+ xlink:href="#linearGradient4565"
131
+ inkscape:collect="always" />
132
+ </defs>
133
+ <sodipodi:namedview
134
+ inkscape:window-y="109"
135
+ inkscape:window-x="223"
136
+ inkscape:window-height="739"
137
+ inkscape:window-width="770"
138
+ inkscape:showpageshadow="false"
139
+ inkscape:document-units="px"
140
+ inkscape:grid-bbox="true"
141
+ showgrid="false"
142
+ inkscape:current-layer="layer1"
143
+ inkscape:cy="24.058534"
144
+ inkscape:cx="25.411306"
145
+ inkscape:zoom="11.313708"
146
+ inkscape:pageshadow="2"
147
+ inkscape:pageopacity="0.0"
148
+ borderopacity="0.19607843"
149
+ bordercolor="#666666"
150
+ pagecolor="#ffffff"
151
+ id="base"
152
+ fill="#edd400" />
153
+ <metadata
154
+ id="metadata4">
155
+ <rdf:RDF>
156
+ <cc:Work
157
+ rdf:about="">
158
+ <dc:format>image/svg+xml</dc:format>
159
+ <dc:type
160
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
161
+ <dc:title>Face - Happy</dc:title>
162
+ <dc:subject>
163
+ <rdf:Bag>
164
+ <rdf:li>emoticon</rdf:li>
165
+ <rdf:li>emote</rdf:li>
166
+ <rdf:li>smiley</rdf:li>
167
+ <rdf:li>happy</rdf:li>
168
+ <rdf:li>:)</rdf:li>
169
+ <rdf:li>:-)</rdf:li>
170
+ </rdf:Bag>
171
+ </dc:subject>
172
+ <cc:license
173
+ rdf:resource="http://creativecommons.org/licenses/publicdomain/" />
174
+ <dc:creator>
175
+ <cc:Agent>
176
+ <dc:title>Jakub Steiner</dc:title>
177
+ </cc:Agent>
178
+ </dc:creator>
179
+ <dc:source>http://jimmac.musichall.cz</dc:source>
180
+ </cc:Work>
181
+ <cc:License
182
+ rdf:about="http://creativecommons.org/licenses/publicdomain/">
183
+ <cc:permits
184
+ rdf:resource="http://creativecommons.org/ns#Reproduction" />
185
+ <cc:permits
186
+ rdf:resource="http://creativecommons.org/ns#Distribution" />
187
+ <cc:permits
188
+ rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
189
+ </cc:License>
190
+ </rdf:RDF>
191
+ </metadata>
192
+ <g
193
+ inkscape:groupmode="layer"
194
+ inkscape:label="Layer 1"
195
+ id="layer1">
196
+ <path
197
+ d="M 44.428570 38.571430 A 19.714285 6.5714288 0 1 1 5.0000000,38.571430 A 19.714285 6.5714288 0 1 1 44.428570 38.571430 z"
198
+ sodipodi:ry="6.5714288"
199
+ sodipodi:rx="19.714285"
200
+ sodipodi:cy="38.571430"
201
+ sodipodi:cx="24.714285"
202
+ id="path4563"
203
+ style="opacity:0.53164557;color:#000000;fill:url(#radialGradient4571);fill-opacity:1.0;fill-rule:evenodd;stroke:none;stroke-width:0.40487173;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-dashoffset:0.0000000;stroke-opacity:1.0000000;visibility:visible;display:inline;overflow:visible"
204
+ sodipodi:type="arc" />
205
+ <path
206
+ transform="matrix(2.083142,0.000000,0.000000,2.083142,-40.54715,-16.49224)"
207
+ d="M 39.774755 19.008621 A 8.6620579 8.6620579 0 1 1 22.450640,19.008621 A 8.6620579 8.6620579 0 1 1 39.774755 19.008621 z"
208
+ sodipodi:ry="8.6620579"
209
+ sodipodi:rx="8.6620579"
210
+ sodipodi:cy="19.008621"
211
+ sodipodi:cx="31.112698"
212
+ id="path4320"
213
+ style="overflow:visible;display:inline;visibility:visible;stroke-opacity:1.0000000;stroke-dashoffset:0.0000000;stroke-dasharray:none;stroke-miterlimit:4.0000000;marker-end:none;marker-mid:none;marker-start:none;marker:none;stroke-linejoin:round;stroke-linecap:round;stroke-width:0.48004404;stroke:#9c8c0a;fill-rule:evenodd;fill-opacity:1.0000000;fill:url(#radialGradient2714);color:#000000;opacity:1.0000000"
214
+ sodipodi:type="arc" />
215
+ <path
216
+ transform="matrix(1.979782,0.000000,0.000000,1.979782,-37.33128,-14.52746)"
217
+ sodipodi:type="arc"
218
+ style="opacity:0.67721519;color:#000000;fill:none;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#ffffff;stroke-width:0.50510627;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-dashoffset:0.0000000;stroke-opacity:1.0000000;visibility:visible;display:inline;overflow:visible"
219
+ id="path4322"
220
+ sodipodi:cx="31.112698"
221
+ sodipodi:cy="19.008621"
222
+ sodipodi:rx="8.6620579"
223
+ sodipodi:ry="8.6620579"
224
+ d="M 39.774755 19.008621 A 8.6620579 8.6620579 0 1 1 22.450640,19.008621 A 8.6620579 8.6620579 0 1 1 39.774755 19.008621 z" />
225
+ <path
226
+ sodipodi:nodetypes="czczc"
227
+ id="path2659"
228
+ d="M 37.284637,24.719966 C 34.268170,29.944639 30.741134,33.710005 24.462492,33.710005 C 18.362475,33.710005 13.896955,29.370308 11.110016,24.543189 C 13.659429,27.599109 17.392948,31.109501 24.197327,31.109501 C 32.327531,31.109501 33.749103,28.202646 37.284637,24.719966 z "
229
+ style="opacity:0.35999998;color:#000000;fill:#ffffff;fill-opacity:1.0000000;fill-rule:nonzero;stroke:none;stroke-width:1.0000000;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-dashoffset:0.0000000;stroke-opacity:1.0000000;visibility:visible;display:inline;overflow:visible" />
230
+ <path
231
+ style="fill:url(#aigrd2);fill-rule:nonzero;stroke:none;stroke-miterlimit:4.0000000"
232
+ d="M 37.284637,24.012862 C 34.268170,29.237535 30.741134,33.002901 24.462492,33.002901 C 18.362475,33.002901 13.896955,28.663204 11.110016,23.836085 C 13.659429,26.892005 17.392948,30.402397 24.197327,30.402397 C 32.327531,30.402397 33.749103,27.495542 37.284637,24.012862 z "
233
+ id="path8606"
234
+ sodipodi:nodetypes="czczc" />
235
+ <g
236
+ transform="translate(0.353553,2.392706)"
237
+ id="g8666">
238
+ <path
239
+ style="opacity:0.35999998;fill:#ffffff;fill-rule:nonzero;stroke:none;stroke-miterlimit:4.0000000"
240
+ d="M 21.398158,15.321428 C 21.398158,17.821428 20.273158,19.821428 18.898158,19.821428 C 17.523158,19.821428 16.273158,17.821428 16.273158,15.321428 C 16.273158,12.821428 17.398158,10.821428 18.773158,10.821428 C 20.148158,10.821428 21.273158,12.821428 21.273158,15.321428 L 21.398158,15.321428 z "
241
+ id="path8610" />
242
+ <path
243
+ style="opacity:0.35999998;fill:#ffffff;fill-rule:nonzero;stroke:none;stroke-miterlimit:4.0000000"
244
+ d="M 30.688512,15.321428 C 30.688512,17.821428 29.563512,19.821428 28.188512,19.821428 C 26.813512,19.821428 25.688512,17.821428 25.688512,15.321428 C 25.688512,12.821428 26.813512,10.821428 28.188512,10.821428 C 29.563512,10.821428 30.688512,12.821428 30.688512,15.321428 z "
245
+ id="path8612" />
246
+ <path
247
+ style="fill:#000000;fill-rule:nonzero;stroke:none;stroke-miterlimit:4.0000000"
248
+ d="M 21.398158,14.696428 C 21.398158,17.196428 20.273158,19.196428 18.898158,19.196428 C 17.523158,19.196428 16.398158,17.196428 16.398158,14.696428 C 16.398158,12.196428 17.523158,10.196428 18.898158,10.196428 C 20.273158,10.196428 21.398158,12.196428 21.398158,14.696428 z "
249
+ id="path8614" />
250
+ <path
251
+ style="fill:#000000;fill-rule:nonzero;stroke:none;stroke-miterlimit:4.0000000"
252
+ d="M 30.688512,14.696428 C 30.688512,17.196428 29.563512,19.196428 28.188512,19.196428 C 26.813512,19.196428 25.688512,17.196428 25.688512,14.696428 C 25.688512,12.196428 26.813512,10.196428 28.188512,10.196428 C 29.563512,10.196428 30.688512,12.196428 30.688512,14.696428 z "
253
+ id="path8616" />
254
+ </g>
255
+ </g>
256
+ </svg>
@@ -214,11 +214,15 @@ module Groonga
214
214
 
215
215
  private
216
216
  def normalize(other)
217
- if @range.is_a?(Groonga::Table) and other.is_a?(Integer)
218
- Groonga::Record.new(@range, other)
219
- else
220
- other
217
+ if @range.is_a?(Groonga::Table)
218
+ if other.respond_to?(:record_id)
219
+ id = other.record_id
220
+ else
221
+ id = other
222
+ end
223
+ return Groonga::Record.new(@range, id) if id.is_a?(Integer)
221
224
  end
225
+ other
222
226
  end
223
227
 
224
228
  def method_missing(name, *args, &block)
@@ -44,13 +44,31 @@ module Groonga
44
44
  # call-seq:
45
45
  # record == other -> true/false
46
46
  #
47
- # _record_と_other_が同じgroongaのレコードなら+true+を返し、
48
- # そうでなければ+false+を返す。
47
+ # _record_と_other_が同じテーブルに属していて、さらに、
48
+ # 同じレコードIDを持つなら+true+を返し、そうでなければ
49
+ # +false+を返す。
49
50
  def ==(other)
50
51
  self.class == other.class and
51
52
  [table, id] == [other.table, other.id]
52
53
  end
53
54
 
55
+ # call-seq:
56
+ # record.eql?(other) -> true/false
57
+ #
58
+ # Groonga::Record#==と同じ。
59
+ def eql?(other)
60
+ self == other
61
+ end
62
+
63
+ # call-seq:
64
+ # record.hash -> ハッシュ値
65
+ #
66
+ # 同じテーブルの同じIDのレコードに対しては常に同じハッシュ
67
+ # 値を返す。
68
+ def hash
69
+ @table.hash ^ @id.hash
70
+ end
71
+
54
72
  # call-seq:
55
73
  # record[column_name] -> 値
56
74
  #
@@ -86,6 +104,15 @@ module Groonga
86
104
  column(column_name).prepend(@id, value)
87
105
  end
88
106
 
107
+ # call-seq:
108
+ # record.support_key? -> true/false
109
+ #
110
+ # _record_が所属するテーブルで主キーを使える場合は+true+
111
+ # を返し、使えない場合は+false+を返す。
112
+ def support_key?
113
+ @table.support_key?
114
+ end
115
+
89
116
  # call-seq:
90
117
  # record.have_column?(name) -> true/false
91
118
  #
@@ -102,7 +129,16 @@ module Groonga
102
129
  #
103
130
  # 名前が_name_のカラムが参照カラムであるなら+true+を返す。
104
131
  def reference_column?(name)
105
- column(name).range.is_a?(Groonga::Table)
132
+ column(name).reference_column?
133
+ end
134
+
135
+ # call-seq:
136
+ # record.index_column?(name) -> true/false
137
+ #
138
+ # 名前が_name_のカラムが索引カラム
139
+ # (Groonga::IndexColumn)であるなら+true+を返す。
140
+ def index_column?(name)
141
+ column(name).index_column?
106
142
  end
107
143
 
108
144
  # call-seq:
@@ -123,10 +159,25 @@ module Groonga
123
159
  # _record_が所属するテーブルがGroonga:::Arrayの場合は常
124
160
  # に+nil+を返す。
125
161
  def key
126
- if @table.is_a?(Groonga::Array)
162
+ if support_key?
163
+ @key ||= @table.key(@id)
164
+ else
127
165
  nil
166
+ end
167
+ end
168
+
169
+ # call-seq:
170
+ # record.record_id -> IDまたは主キー
171
+ #
172
+ # レコードを一意に識別するための情報を返す。
173
+ #
174
+ # _record_が所属するテーブルがGroonga:::Arrayの場合はID
175
+ # を返し、それ以外の場合は主キーを返す。
176
+ def record_id
177
+ if support_key?
178
+ key
128
179
  else
129
- @key ||= @table.key(@id)
180
+ id
130
181
  end
131
182
  end
132
183
 
@@ -144,10 +195,22 @@ module Groonga
144
195
  #
145
196
  # 主キーの値が同一であったレコードの件数を返す。検索結果とし
146
197
  # て生成されたテーブルのみに定義される。
198
+ #
199
+ # Groonga::Record#support_sub_recordsでこの値を利用でき
200
+ # るかがわかる。
147
201
  def n_sub_records
148
202
  self["._nsubrecs"]
149
203
  end
150
204
 
205
+ # call-seq:
206
+ # record.support_sub_records? -> true/false
207
+ #
208
+ # Groonga::Record#n_sub_recordsが利用できる場合はtrueを
209
+ # 返す。
210
+ def support_sub_records?
211
+ @table.support_sub_records?
212
+ end
213
+
151
214
  # call-seq:
152
215
  # record.value -> 値
153
216
  #
@@ -198,8 +261,7 @@ module Groonga
198
261
  # たこのレコードのカラムの値のハッシュを返す。
199
262
  def attributes
200
263
  attributes = {"id" => id}
201
- _key = key
202
- attributes["key"] = _key if _key
264
+ attributes["key"] = key if support_key?
203
265
  table_name = @table.name
204
266
  columns.each do |column|
205
267
  next if column.is_a?(Groonga::IndexColumn)
@@ -268,6 +330,14 @@ module Groonga
268
330
  @table.locked?(options.merge(:id => @id))
269
331
  end
270
332
 
333
+ # call-seq:
334
+ # record.valid_id? -> true/false
335
+ #
336
+ # レコードが持つIDが有効なIDであれば+true+を返す。
337
+ def valid_id?
338
+ @table.exist?(@id)
339
+ end
340
+
271
341
  def methods(include_inherited=true) # :nodoc:
272
342
  _methods = super
273
343
  return _methods unless include_inherited