rroonga 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. data/NEWS.ja.rdoc +11 -0
  2. data/NEWS.rdoc +11 -0
  3. data/README.ja.rdoc +1 -0
  4. data/README.rdoc +1 -0
  5. data/ext/groonga/mkmf.log +99 -0
  6. data/ext/groonga/rb-grn-array.c +1 -1
  7. data/ext/groonga/rb-grn-hash.c +1 -1
  8. data/ext/groonga/rb-grn-patricia-trie.c +1 -1
  9. data/ext/groonga/rb-grn.h +1 -1
  10. data/test/test-patricia-trie.rb +10 -0
  11. metadata +25 -102
  12. data/test-unit-notify/Rakefile +0 -47
  13. data/test-unit-notify/lib/test/unit/notify.rb +0 -104
  14. data/test-unit/COPYING +0 -56
  15. data/test-unit/GPL +0 -340
  16. data/test-unit/PSFL +0 -271
  17. data/test-unit/Rakefile +0 -53
  18. data/test-unit/TODO +0 -5
  19. data/test-unit/bin/testrb +0 -5
  20. data/test-unit/html/bar.svg +0 -153
  21. data/test-unit/html/developer.svg +0 -469
  22. data/test-unit/html/favicon.ico +0 -0
  23. data/test-unit/html/favicon.svg +0 -82
  24. data/test-unit/html/heading-mark.svg +0 -393
  25. data/test-unit/html/index.html +0 -247
  26. data/test-unit/html/index.html.ja +0 -270
  27. data/test-unit/html/install.svg +0 -636
  28. data/test-unit/html/logo.svg +0 -483
  29. data/test-unit/html/test-unit.css +0 -339
  30. data/test-unit/html/tutorial.svg +0 -559
  31. data/test-unit/lib/test/unit.rb +0 -328
  32. data/test-unit/lib/test/unit/assertionfailederror.rb +0 -25
  33. data/test-unit/lib/test/unit/assertions.rb +0 -1334
  34. data/test-unit/lib/test/unit/attribute.rb +0 -125
  35. data/test-unit/lib/test/unit/autorunner.rb +0 -363
  36. data/test-unit/lib/test/unit/collector.rb +0 -36
  37. data/test-unit/lib/test/unit/collector/descendant.rb +0 -23
  38. data/test-unit/lib/test/unit/collector/dir.rb +0 -108
  39. data/test-unit/lib/test/unit/collector/load.rb +0 -144
  40. data/test-unit/lib/test/unit/collector/objectspace.rb +0 -34
  41. data/test-unit/lib/test/unit/color-scheme.rb +0 -106
  42. data/test-unit/lib/test/unit/color.rb +0 -96
  43. data/test-unit/lib/test/unit/diff.rb +0 -740
  44. data/test-unit/lib/test/unit/error.rb +0 -130
  45. data/test-unit/lib/test/unit/exceptionhandler.rb +0 -39
  46. data/test-unit/lib/test/unit/failure.rb +0 -136
  47. data/test-unit/lib/test/unit/fixture.rb +0 -176
  48. data/test-unit/lib/test/unit/notification.rb +0 -129
  49. data/test-unit/lib/test/unit/omission.rb +0 -191
  50. data/test-unit/lib/test/unit/pending.rb +0 -150
  51. data/test-unit/lib/test/unit/priority.rb +0 -180
  52. data/test-unit/lib/test/unit/runner/console.rb +0 -52
  53. data/test-unit/lib/test/unit/runner/emacs.rb +0 -8
  54. data/test-unit/lib/test/unit/runner/tap.rb +0 -8
  55. data/test-unit/lib/test/unit/testcase.rb +0 -483
  56. data/test-unit/lib/test/unit/testresult.rb +0 -121
  57. data/test-unit/lib/test/unit/testsuite.rb +0 -110
  58. data/test-unit/lib/test/unit/ui/console/outputlevel.rb +0 -14
  59. data/test-unit/lib/test/unit/ui/console/testrunner.rb +0 -430
  60. data/test-unit/lib/test/unit/ui/emacs/testrunner.rb +0 -63
  61. data/test-unit/lib/test/unit/ui/tap/testrunner.rb +0 -82
  62. data/test-unit/lib/test/unit/ui/testrunner.rb +0 -53
  63. data/test-unit/lib/test/unit/ui/testrunnermediator.rb +0 -77
  64. data/test-unit/lib/test/unit/ui/testrunnerutilities.rb +0 -41
  65. data/test-unit/lib/test/unit/util/backtracefilter.rb +0 -42
  66. data/test-unit/lib/test/unit/util/method-owner-finder.rb +0 -28
  67. data/test-unit/lib/test/unit/util/observable.rb +0 -90
  68. data/test-unit/lib/test/unit/util/output.rb +0 -31
  69. data/test-unit/lib/test/unit/util/procwrapper.rb +0 -48
  70. data/test-unit/lib/test/unit/version.rb +0 -7
  71. data/test-unit/sample/adder.rb +0 -13
  72. data/test-unit/sample/subtracter.rb +0 -12
  73. data/test-unit/sample/test_adder.rb +0 -20
  74. data/test-unit/sample/test_subtracter.rb +0 -20
  75. data/test-unit/sample/test_user.rb +0 -23
  76. data/test-unit/test/collector/test-descendant.rb +0 -133
  77. data/test-unit/test/collector/test-load.rb +0 -442
  78. data/test-unit/test/collector/test_dir.rb +0 -406
  79. data/test-unit/test/collector/test_objectspace.rb +0 -100
  80. data/test-unit/test/run-test.rb +0 -15
  81. data/test-unit/test/test-attribute.rb +0 -86
  82. data/test-unit/test/test-color-scheme.rb +0 -69
  83. data/test-unit/test/test-color.rb +0 -47
  84. data/test-unit/test/test-diff.rb +0 -518
  85. data/test-unit/test/test-emacs-runner.rb +0 -60
  86. data/test-unit/test/test-fixture.rb +0 -287
  87. data/test-unit/test/test-notification.rb +0 -33
  88. data/test-unit/test/test-omission.rb +0 -81
  89. data/test-unit/test/test-pending.rb +0 -70
  90. data/test-unit/test/test-priority.rb +0 -119
  91. data/test-unit/test/test-testcase.rb +0 -544
  92. data/test-unit/test/test_assertions.rb +0 -1197
  93. data/test-unit/test/test_error.rb +0 -26
  94. data/test-unit/test/test_failure.rb +0 -33
  95. data/test-unit/test/test_testresult.rb +0 -113
  96. data/test-unit/test/test_testsuite.rb +0 -129
  97. data/test-unit/test/testunit-test-util.rb +0 -14
  98. data/test-unit/test/ui/test_tap.rb +0 -33
  99. data/test-unit/test/ui/test_testrunmediator.rb +0 -20
  100. data/test-unit/test/util/test-method-owner-finder.rb +0 -38
  101. data/test-unit/test/util/test-output.rb +0 -11
  102. data/test-unit/test/util/test_backtracefilter.rb +0 -41
  103. data/test-unit/test/util/test_observable.rb +0 -102
  104. data/test-unit/test/util/test_procwrapper.rb +0 -36
data/NEWS.ja.rdoc CHANGED
@@ -1,5 +1,16 @@
1
1
  = お知らせ
2
2
 
3
+ == 1.0.1: 2010-09-12
4
+
5
+ === 修正
6
+
7
+ * テーブル作成時に誤ったフラグを指定していた問題を修正。
8
+ [小野マトペさんが報告]
9
+
10
+ === 感謝
11
+
12
+ * 小野マトペさん
13
+
3
14
  == 1.0.0: 2010-08-29
4
15
 
5
16
  * groonga 1.0.0対応。
data/NEWS.rdoc CHANGED
@@ -1,5 +1,16 @@
1
1
  = NEWS
2
2
 
3
+ == 1.0.1: 2010-09-12
4
+
5
+ === Fixes
6
+
7
+ * Fixed wrong flag used on creating a table.
8
+ [Reported by ono matope]
9
+
10
+ === Thanks
11
+
12
+ * ono matope
13
+
3
14
  == 1.0.0: 2010-08-29
4
15
 
5
16
  * Supported groonga 1.0.0.
data/README.ja.rdoc CHANGED
@@ -63,3 +63,4 @@ http://lists.sourceforge.jp/mailman/listinfo/groonga-dev
63
63
  * id:mat_akiさん: チュートリアルのバグを教えてくれました。
64
64
  * @yune_kotomi: バグレポートしてくれました。
65
65
  * 咳さん: バグレポートしてくれました。
66
+ * 小野マトペさん: バグレポートしてくれました。
data/README.rdoc CHANGED
@@ -64,3 +64,4 @@ http://rubyforge.org/mailman/listinfo/groonga-users-en
64
64
  * id:mat_aki: sent bug reports.
65
65
  * @yune_kotomi: sent a bug report.
66
66
  * m_seki: sent bug reports.
67
+ * ono matope: sent bug reports.
@@ -0,0 +1,99 @@
1
+ checking for GCC... -------------------- yes
2
+
3
+ "gcc -I. -I/usr/lib/ruby/1.8/x86_64-linux -I/home/kou/work/ruby/rroonga.18/ext/groonga -fno-strict-aliasing -g -g -O2 -fPIC -I/tmp/local/include/groonga -c conftest.c"
4
+ checked program was:
5
+ /* begin */
6
+ 1: /*top*/
7
+ 2: #ifndef __GNUC__
8
+ 3: # error
9
+ 4: >>>>>> __GNUC__ undefined <<<<<<
10
+ 5: #endif
11
+ /* end */
12
+
13
+ --------------------
14
+
15
+ checking for Win32 OS... -------------------- no
16
+
17
+ --------------------
18
+
19
+ have_macro: checking for HAVE_RUBY_ST_H in ruby.h... -------------------- no
20
+
21
+ "gcc -I. -I/usr/lib/ruby/1.8/x86_64-linux -I/home/kou/work/ruby/rroonga.18/ext/groonga -fno-strict-aliasing -g -g -O2 -fPIC -I/tmp/local/include/groonga -Wall -c conftest.c"
22
+ conftest.c:4:3: error: #error
23
+ conftest.c:5: error: expected identifier or ‘(’ before ‘>>’ token
24
+ checked program was:
25
+ /* begin */
26
+ 1: #include <ruby.h>
27
+ 2: /*top*/
28
+ 3: #ifndef HAVE_RUBY_ST_H
29
+ 4: # error
30
+ 5: >>>>>> HAVE_RUBY_ST_H undefined <<<<<<
31
+ 6: #endif
32
+ /* end */
33
+
34
+ --------------------
35
+
36
+ have_header: checking for ruby/st.h... -------------------- no
37
+
38
+ "gcc -E -I. -I/usr/lib/ruby/1.8/x86_64-linux -I/home/kou/work/ruby/rroonga.18/ext/groonga -fno-strict-aliasing -g -g -O2 -fPIC -I/tmp/local/include/groonga -Wall conftest.c -o conftest.i"
39
+ conftest.c:1:21: error: ruby/st.h: そのようなファイルやディレクトリはありません
40
+ checked program was:
41
+ /* begin */
42
+ 1: #include <ruby/st.h>
43
+ /* end */
44
+
45
+ --------------------
46
+
47
+ have_func: checking for rb_errinfo() in ruby.h... -------------------- no
48
+
49
+ "gcc -o conftest -I. -I/usr/lib/ruby/1.8/x86_64-linux -I/home/kou/work/ruby/rroonga.18/ext/groonga -fno-strict-aliasing -g -g -O2 -fPIC -I/tmp/local/include/groonga -Wall conftest.c -L. -L/usr/lib -L. -rdynamic -Wl,-export-dynamic -L/tmp/local/lib -lgroonga -lruby1.8-static -lgroonga -lpthread -lrt -ldl -lcrypt -lm -lc"
50
+ conftest.c: In function ‘t’:
51
+ conftest.c:5: error: ‘rb_errinfo’ undeclared (first use in this function)
52
+ conftest.c:5: error: (Each undeclared identifier is reported only once
53
+ conftest.c:5: error: for each function it appears in.)
54
+ checked program was:
55
+ /* begin */
56
+ 1: #include <ruby.h>
57
+ 2:
58
+ 3: /*top*/
59
+ 4: int main() { return 0; }
60
+ 5: int t() { void ((*volatile p)()); p = (void ((*)()))rb_errinfo; return 0; }
61
+ /* end */
62
+
63
+ "gcc -o conftest -I. -I/usr/lib/ruby/1.8/x86_64-linux -I/home/kou/work/ruby/rroonga.18/ext/groonga -fno-strict-aliasing -g -g -O2 -fPIC -I/tmp/local/include/groonga -Wall conftest.c -L. -L/usr/lib -L. -rdynamic -Wl,-export-dynamic -L/tmp/local/lib -lgroonga -lruby1.8-static -lgroonga -lpthread -lrt -ldl -lcrypt -lm -lc"
64
+ conftest.c: In function ‘t’:
65
+ conftest.c:5: warning: implicit declaration of function ‘rb_errinfo’
66
+ /tmp/cc9zPpDk.o: In function `t':
67
+ /home/kou/work/ruby/rroonga.18/ext/groonga/conftest.c:5: undefined reference to `rb_errinfo'
68
+ collect2: ld returned 1 exit status
69
+ checked program was:
70
+ /* begin */
71
+ 1: #include <ruby.h>
72
+ 2:
73
+ 3: /*top*/
74
+ 4: int main() { return 0; }
75
+ 5: int t() { rb_errinfo(); return 0; }
76
+ /* end */
77
+
78
+ --------------------
79
+
80
+ have_type: checking for enum ruby_value_type in ruby.h... -------------------- no
81
+
82
+ "gcc -I. -I/usr/lib/ruby/1.8/x86_64-linux -I/home/kou/work/ruby/rroonga.18/ext/groonga -fno-strict-aliasing -g -g -O2 -fPIC -I/tmp/local/include/groonga -Wall -c conftest.c"
83
+ conftest.c:5: error: invalid application of ‘sizeof’ to incomplete type ‘conftest_type’
84
+ conftest.c:5: error: size of array ‘conftestval’ is negative
85
+ checked program was:
86
+ /* begin */
87
+ 1: #include <ruby.h>
88
+ 2:
89
+ 3: /*top*/
90
+ 4: typedef enum ruby_value_type conftest_type;
91
+ 5: int conftestval[sizeof(conftest_type)?1:-1];
92
+ /* end */
93
+
94
+ --------------------
95
+
96
+ checking for debug flag... -------------------- no
97
+
98
+ --------------------
99
+
@@ -97,7 +97,7 @@ rb_grn_array_s_create (int argc, VALUE *argv, VALUE klass)
97
97
  grn_obj *value_type = NULL, *table;
98
98
  const char *name = NULL, *path = NULL;
99
99
  unsigned name_size = 0;
100
- grn_obj_flags flags = GRN_TABLE_NO_KEY;
100
+ grn_obj_flags flags = GRN_OBJ_TABLE_NO_KEY;
101
101
  VALUE rb_table;
102
102
  VALUE options, rb_context, rb_name, rb_path, rb_persistent;
103
103
  VALUE rb_value_type, rb_sub_records;
@@ -152,7 +152,7 @@ rb_grn_hash_s_create (int argc, VALUE *argv, VALUE klass)
152
152
  grn_obj *key_type = NULL, *value_type = NULL, *table;
153
153
  const char *name = NULL, *path = NULL;
154
154
  unsigned name_size = 0;
155
- grn_obj_flags flags = GRN_TABLE_HASH_KEY;
155
+ grn_obj_flags flags = GRN_OBJ_TABLE_HASH_KEY;
156
156
  VALUE rb_table;
157
157
  VALUE options, rb_context, rb_name, rb_path, rb_persistent;
158
158
  VALUE rb_key_normalize, rb_key_type, rb_value_type, rb_default_tokenizer;
@@ -161,7 +161,7 @@ rb_grn_patricia_trie_s_create (int argc, VALUE *argv, VALUE klass)
161
161
  grn_obj *key_type = NULL, *value_type = NULL, *table;
162
162
  const char *name = NULL, *path = NULL;
163
163
  unsigned name_size = 0;
164
- grn_obj_flags flags = GRN_TABLE_PAT_KEY;
164
+ grn_obj_flags flags = GRN_OBJ_TABLE_PAT_KEY;
165
165
  VALUE rb_table;
166
166
  VALUE options, rb_context, rb_name, rb_path, rb_persistent;
167
167
  VALUE rb_key_normalize, rb_key_with_sis, rb_key_type;
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 0
72
- #define RB_GRN_MICRO_VERSION 0
72
+ #define RB_GRN_MICRO_VERSION 1
73
73
 
74
74
  typedef int rb_grn_boolean;
75
75
  #define RB_GRN_FALSE (0)
@@ -363,4 +363,14 @@ class PatriciaTrieTest < Test::Unit::TestCase
363
363
  end
364
364
  assert_equal(expected, actual)
365
365
  end
366
+
367
+ def test_add_uint_key
368
+ numbers = Groonga::PatriciaTrie.create(:name => "Numbers",
369
+ :key_type => "UInt32")
370
+ numbers.add(1)
371
+ numbers.add(2)
372
+ numbers.add(5)
373
+ numbers.add(7)
374
+ assert_equal([1, 2, 5, 7], numbers.collect {|number| number.key})
375
+ end
366
376
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rroonga
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 0
10
- version: 1.0.0
9
+ - 1
10
+ version: 1.0.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Kouhei Sutou
@@ -19,10 +19,25 @@ autorequire:
19
19
  bindir: bin
20
20
  cert_chain: []
21
21
 
22
- date: 2010-08-29 00:00:00 +09:00
22
+ date: 2010-09-12 00:00:00 +09:00
23
23
  default_executable:
24
- dependencies: []
25
-
24
+ dependencies:
25
+ - !ruby/object:Gem::Dependency
26
+ name: rubyforge
27
+ prerelease: false
28
+ requirement: &id001 !ruby/object:Gem::Requirement
29
+ none: false
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ hash: 7
34
+ segments:
35
+ - 2
36
+ - 0
37
+ - 4
38
+ version: 2.0.4
39
+ type: :development
40
+ version_requirements: *id001
26
41
  description: |-
27
42
  rroonga is a extension library to use groonga's DB-API
28
43
  layer. rroonga provides Rubyish readable and writable
@@ -36,11 +51,11 @@ executables: []
36
51
  extensions:
37
52
  - extconf.rb
38
53
  extra_rdoc_files:
39
- - README.rdoc
40
- - NEWS.rdoc
41
- - README.ja.rdoc
42
54
  - text/expression.rdoc
43
55
  - text/TUTORIAL.ja.rdoc
56
+ - NEWS.rdoc
57
+ - README.rdoc
58
+ - README.ja.rdoc
44
59
  - NEWS.ja.rdoc
45
60
  files:
46
61
  - AUTHORS
@@ -58,6 +73,7 @@ files:
58
73
  - example/search/public/css/groonga.css
59
74
  - ext/.gitignore
60
75
  - ext/groonga/extconf.rb
76
+ - ext/groonga/mkmf.log
61
77
  - ext/groonga/rb-grn-accessor.c
62
78
  - ext/groonga/rb-grn-array-cursor.c
63
79
  - ext/groonga/rb-grn-array.c
@@ -126,99 +142,6 @@ files:
126
142
  - misc/grnop2ruby.rb
127
143
  - pkg-config.rb
128
144
  - rroonga-build.rb
129
- - test-unit-notify/Rakefile
130
- - test-unit-notify/lib/test/unit/notify.rb
131
- - test-unit/COPYING
132
- - test-unit/GPL
133
- - test-unit/PSFL
134
- - test-unit/Rakefile
135
- - test-unit/TODO
136
- - test-unit/bin/testrb
137
- - test-unit/html/bar.svg
138
- - test-unit/html/developer.svg
139
- - test-unit/html/favicon.ico
140
- - test-unit/html/favicon.svg
141
- - test-unit/html/heading-mark.svg
142
- - test-unit/html/index.html
143
- - test-unit/html/index.html.ja
144
- - test-unit/html/install.svg
145
- - test-unit/html/logo.svg
146
- - test-unit/html/test-unit.css
147
- - test-unit/html/tutorial.svg
148
- - test-unit/lib/test/unit.rb
149
- - test-unit/lib/test/unit/assertionfailederror.rb
150
- - test-unit/lib/test/unit/assertions.rb
151
- - test-unit/lib/test/unit/attribute.rb
152
- - test-unit/lib/test/unit/autorunner.rb
153
- - test-unit/lib/test/unit/collector.rb
154
- - test-unit/lib/test/unit/collector/descendant.rb
155
- - test-unit/lib/test/unit/collector/dir.rb
156
- - test-unit/lib/test/unit/collector/load.rb
157
- - test-unit/lib/test/unit/collector/objectspace.rb
158
- - test-unit/lib/test/unit/color-scheme.rb
159
- - test-unit/lib/test/unit/color.rb
160
- - test-unit/lib/test/unit/diff.rb
161
- - test-unit/lib/test/unit/error.rb
162
- - test-unit/lib/test/unit/exceptionhandler.rb
163
- - test-unit/lib/test/unit/failure.rb
164
- - test-unit/lib/test/unit/fixture.rb
165
- - test-unit/lib/test/unit/notification.rb
166
- - test-unit/lib/test/unit/omission.rb
167
- - test-unit/lib/test/unit/pending.rb
168
- - test-unit/lib/test/unit/priority.rb
169
- - test-unit/lib/test/unit/runner/console.rb
170
- - test-unit/lib/test/unit/runner/emacs.rb
171
- - test-unit/lib/test/unit/runner/tap.rb
172
- - test-unit/lib/test/unit/testcase.rb
173
- - test-unit/lib/test/unit/testresult.rb
174
- - test-unit/lib/test/unit/testsuite.rb
175
- - test-unit/lib/test/unit/ui/console/outputlevel.rb
176
- - test-unit/lib/test/unit/ui/console/testrunner.rb
177
- - test-unit/lib/test/unit/ui/emacs/testrunner.rb
178
- - test-unit/lib/test/unit/ui/tap/testrunner.rb
179
- - test-unit/lib/test/unit/ui/testrunner.rb
180
- - test-unit/lib/test/unit/ui/testrunnermediator.rb
181
- - test-unit/lib/test/unit/ui/testrunnerutilities.rb
182
- - test-unit/lib/test/unit/util/backtracefilter.rb
183
- - test-unit/lib/test/unit/util/method-owner-finder.rb
184
- - test-unit/lib/test/unit/util/observable.rb
185
- - test-unit/lib/test/unit/util/output.rb
186
- - test-unit/lib/test/unit/util/procwrapper.rb
187
- - test-unit/lib/test/unit/version.rb
188
- - test-unit/sample/adder.rb
189
- - test-unit/sample/subtracter.rb
190
- - test-unit/sample/test_adder.rb
191
- - test-unit/sample/test_subtracter.rb
192
- - test-unit/sample/test_user.rb
193
- - test-unit/test/collector/test-descendant.rb
194
- - test-unit/test/collector/test-load.rb
195
- - test-unit/test/collector/test_dir.rb
196
- - test-unit/test/collector/test_objectspace.rb
197
- - test-unit/test/run-test.rb
198
- - test-unit/test/test-attribute.rb
199
- - test-unit/test/test-color-scheme.rb
200
- - test-unit/test/test-color.rb
201
- - test-unit/test/test-diff.rb
202
- - test-unit/test/test-emacs-runner.rb
203
- - test-unit/test/test-fixture.rb
204
- - test-unit/test/test-notification.rb
205
- - test-unit/test/test-omission.rb
206
- - test-unit/test/test-pending.rb
207
- - test-unit/test/test-priority.rb
208
- - test-unit/test/test-testcase.rb
209
- - test-unit/test/test_assertions.rb
210
- - test-unit/test/test_error.rb
211
- - test-unit/test/test_failure.rb
212
- - test-unit/test/test_testresult.rb
213
- - test-unit/test/test_testsuite.rb
214
- - test-unit/test/testunit-test-util.rb
215
- - test-unit/test/ui/test_tap.rb
216
- - test-unit/test/ui/test_testrunmediator.rb
217
- - test-unit/test/util/test-method-owner-finder.rb
218
- - test-unit/test/util/test-output.rb
219
- - test-unit/test/util/test_backtracefilter.rb
220
- - test-unit/test/util/test_observable.rb
221
- - test-unit/test/util/test_procwrapper.rb
222
145
  - test/.gitignore
223
146
  - test/groonga-test-utils.rb
224
147
  - test/run-test.rb
@@ -1,47 +0,0 @@
1
- # -*- ruby -*-
2
-
3
- require 'pathname'
4
-
5
- base_dir = Pathname(__FILE__).dirname.expand_path
6
- test_unit_dir = (base_dir.parent + "test-unit").expand_path
7
- test_unit_lib_dir = test_unit_dir + "lib"
8
- lib_dir = base_dir + "lib"
9
-
10
- $LOAD_PATH.unshift(test_unit_lib_dir.to_s)
11
- $LOAD_PATH.unshift(lib_dir.to_s)
12
-
13
- require 'test/unit/notify'
14
-
15
- require 'rubygems'
16
- require 'hoe'
17
-
18
- Test::Unit.run = true
19
-
20
- version = Test::Unit::Notify::VERSION
21
- ENV["VERSION"] = version
22
- Hoe.spec('test-unit-notify') do
23
- self.version = version
24
- self.rubyforge_name = "test-unit"
25
-
26
- developer('Kouhei Sutou', 'kou@clear-code.com')
27
-
28
- extra_deps << ["test-unit"]
29
- end
30
-
31
- task :docs do
32
- doc_dir = base_dir + "doc"
33
- doc_screenshot_dir = doc_dir + "screenshot"
34
- mkdir_p(doc_screenshot_dir.to_s)
35
- (base_dir + "screenshot").children.each do |file|
36
- next if file.directory?
37
- cp(file.to_s, doc_screenshot_dir.to_s)
38
- end
39
- end
40
-
41
- task :tag do
42
- message = "Released Test::Unit::Notify #{version}!"
43
- base = "svn+ssh://#{ENV['USER']}@rubyforge.org/var/svn/test-unit/extensions/test-unit-notify/"
44
- sh 'svn', 'copy', '-m', message, "#{base}trunk", "#{base}tags/#{version}"
45
- end
46
-
47
- # vim: syntax=Ruby
@@ -1,104 +0,0 @@
1
- #--
2
- #
3
- # Author:: Kouhei Sutou
4
- # Copyright::
5
- # * Copyright (c) 2010 Kouhei Sutou <kou@clear-code.com>
6
- # License:: Ruby license.
7
-
8
- require 'pathname'
9
- require 'erb'
10
- require 'test/unit'
11
-
12
- module Test
13
- module Unit
14
- AutoRunner.setup_option do |auto_runner, options|
15
- options.on("--[no-]notify",
16
- "Notify test result at the last.") do |use_notify|
17
- auto_runner.listeners.reject! do |listener|
18
- listener.is_a?(Notify::Notifier)
19
- end
20
- auto_runner.listeners << Notify::Notifier.new if use_notify
21
- end
22
- end
23
-
24
- module Notify
25
- VERSION = "0.0.2"
26
-
27
- class Notifier
28
- include ERB::Util
29
-
30
- base_dir = Pathname(__FILE__).dirname.parent.parent.parent.expand_path
31
- ICON_DIR = base_dir + "data" + "icons"
32
- def initialize
33
- @theme = "kinotan"
34
- end
35
-
36
- def attach_to_mediator(mediator)
37
- mediator.add_listener(UI::TestRunnerMediator::STARTED,
38
- &method(:started))
39
- mediator.add_listener(UI::TestRunnerMediator::FINISHED,
40
- &method(:finished))
41
- end
42
-
43
- def started(result)
44
- @result = result
45
- end
46
-
47
- def finished(elapsed_time)
48
- case RUBY_PLATFORM
49
- when /mswin|mingw|cygwin/
50
- # how?
51
- when /darwin/
52
- # growl?
53
- else
54
- notify_by_notify_send(elapsed_time)
55
- end
56
- end
57
-
58
- def notify_by_notify_send(elapsed_time)
59
- icon = guess_suitable_icon
60
- args = ["notify-send",
61
- "--expire-time", "5000",
62
- "--urgency", urgency]
63
- args.concat(["--icon", icon.to_s]) if icon
64
- title = "%s [%g%%] (%gs)" % [@result.status,
65
- @result.pass_percentage,
66
- elapsed_time]
67
- args << title
68
- args << h(@result.summary)
69
- system(*args)
70
- end
71
-
72
- def guess_suitable_icon
73
- icon_dir = ICON_DIR + @theme
74
- status = @result.status
75
- icon_base_names = [status]
76
- if @result.passed?
77
- icon_base_names << "pass"
78
- else
79
- case status
80
- when "failure"
81
- icon_base_names << "error"
82
- when "error"
83
- icon_base_names << "failure"
84
- end
85
- end
86
- icon_base_names << "default"
87
- icon_base_names.each do |base_name|
88
- icon = icon_dir + "#{base_name}.png"
89
- return icon if icon.exist?
90
- end
91
- nil
92
- end
93
-
94
- def urgency
95
- if @result.passed?
96
- "normal"
97
- else
98
- "critical"
99
- end
100
- end
101
- end
102
- end
103
- end
104
- end