rroonga 0.9.4 → 0.9.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (125) hide show
  1. data/NEWS.ja.rdoc +29 -0
  2. data/NEWS.rdoc +29 -0
  3. data/Rakefile +5 -3
  4. data/ext/groonga/rb-grn-array.c +1 -1
  5. data/ext/groonga/rb-grn-context.c +15 -28
  6. data/ext/groonga/rb-grn-exception.c +46 -1
  7. data/ext/groonga/rb-grn-expression.c +22 -13
  8. data/ext/groonga/rb-grn-fix-size-column.c +2 -8
  9. data/ext/groonga/rb-grn-hash.c +8 -1
  10. data/ext/groonga/rb-grn-object.c +1 -1
  11. data/ext/groonga/rb-grn-patricia-trie.c +23 -1
  12. data/ext/groonga/rb-grn-table-key-support.c +22 -0
  13. data/ext/groonga/rb-grn-table.c +37 -5
  14. data/ext/groonga/rb-grn-utils.c +20 -2
  15. data/ext/groonga/rb-groonga.c +76 -38
  16. data/extconf.rb +17 -1
  17. data/html/developer.html +32 -7
  18. data/html/footer.html.erb +5 -0
  19. data/html/heading-mark.svg +393 -0
  20. data/html/index.html +33 -3
  21. data/lib/groonga.rb +3 -7
  22. data/lib/groonga/context.rb +2 -13
  23. data/lib/groonga/expression-builder.rb +273 -67
  24. data/lib/groonga/pagination.rb +143 -0
  25. data/lib/groonga/record.rb +2 -0
  26. data/lib/groonga/schema.rb +140 -29
  27. data/rroonga-build.rb +2 -2
  28. data/test-unit/Rakefile +40 -0
  29. data/test-unit/TODO +5 -0
  30. data/test-unit/bin/testrb +5 -0
  31. data/test-unit/html/classic.html +15 -0
  32. data/test-unit/html/index.html +25 -0
  33. data/test-unit/html/index.html.ja +27 -0
  34. data/test-unit/lib/test/unit.rb +323 -0
  35. data/test-unit/lib/test/unit/assertionfailederror.rb +25 -0
  36. data/test-unit/lib/test/unit/assertions.rb +1230 -0
  37. data/test-unit/lib/test/unit/attribute.rb +125 -0
  38. data/test-unit/lib/test/unit/autorunner.rb +360 -0
  39. data/test-unit/lib/test/unit/collector.rb +36 -0
  40. data/test-unit/lib/test/unit/collector/descendant.rb +23 -0
  41. data/test-unit/lib/test/unit/collector/dir.rb +108 -0
  42. data/test-unit/lib/test/unit/collector/load.rb +144 -0
  43. data/test-unit/lib/test/unit/collector/objectspace.rb +34 -0
  44. data/test-unit/lib/test/unit/color-scheme.rb +102 -0
  45. data/test-unit/lib/test/unit/color.rb +96 -0
  46. data/test-unit/lib/test/unit/diff.rb +724 -0
  47. data/test-unit/lib/test/unit/error.rb +130 -0
  48. data/test-unit/lib/test/unit/exceptionhandler.rb +39 -0
  49. data/test-unit/lib/test/unit/failure.rb +136 -0
  50. data/test-unit/lib/test/unit/fixture.rb +176 -0
  51. data/test-unit/lib/test/unit/notification.rb +129 -0
  52. data/test-unit/lib/test/unit/omission.rb +191 -0
  53. data/test-unit/lib/test/unit/pending.rb +150 -0
  54. data/test-unit/lib/test/unit/priority.rb +180 -0
  55. data/test-unit/lib/test/unit/runner/console.rb +52 -0
  56. data/test-unit/lib/test/unit/runner/emacs.rb +8 -0
  57. data/test-unit/lib/test/unit/runner/tap.rb +8 -0
  58. data/test-unit/lib/test/unit/testcase.rb +476 -0
  59. data/test-unit/lib/test/unit/testresult.rb +89 -0
  60. data/test-unit/lib/test/unit/testsuite.rb +110 -0
  61. data/test-unit/lib/test/unit/ui/console/outputlevel.rb +14 -0
  62. data/test-unit/lib/test/unit/ui/console/testrunner.rb +466 -0
  63. data/test-unit/lib/test/unit/ui/emacs/testrunner.rb +63 -0
  64. data/test-unit/lib/test/unit/ui/tap/testrunner.rb +92 -0
  65. data/test-unit/lib/test/unit/ui/testrunner.rb +28 -0
  66. data/test-unit/lib/test/unit/ui/testrunnermediator.rb +77 -0
  67. data/test-unit/lib/test/unit/ui/testrunnerutilities.rb +41 -0
  68. data/test-unit/lib/test/unit/util/backtracefilter.rb +41 -0
  69. data/test-unit/lib/test/unit/util/method-owner-finder.rb +28 -0
  70. data/test-unit/lib/test/unit/util/observable.rb +90 -0
  71. data/test-unit/lib/test/unit/util/procwrapper.rb +48 -0
  72. data/test-unit/lib/test/unit/version.rb +7 -0
  73. data/test-unit/sample/adder.rb +13 -0
  74. data/test-unit/sample/subtracter.rb +12 -0
  75. data/test-unit/sample/test_adder.rb +20 -0
  76. data/test-unit/sample/test_subtracter.rb +20 -0
  77. data/test-unit/sample/test_user.rb +23 -0
  78. data/test-unit/test/collector/test-descendant.rb +133 -0
  79. data/test-unit/test/collector/test-load.rb +442 -0
  80. data/test-unit/test/collector/test_dir.rb +406 -0
  81. data/test-unit/test/collector/test_objectspace.rb +100 -0
  82. data/test-unit/test/run-test.rb +15 -0
  83. data/test-unit/test/test-attribute.rb +86 -0
  84. data/test-unit/test/test-color-scheme.rb +67 -0
  85. data/test-unit/test/test-color.rb +47 -0
  86. data/test-unit/test/test-diff.rb +518 -0
  87. data/test-unit/test/test-emacs-runner.rb +60 -0
  88. data/test-unit/test/test-fixture.rb +287 -0
  89. data/test-unit/test/test-notification.rb +33 -0
  90. data/test-unit/test/test-omission.rb +81 -0
  91. data/test-unit/test/test-pending.rb +70 -0
  92. data/test-unit/test/test-priority.rb +119 -0
  93. data/test-unit/test/test-testcase.rb +544 -0
  94. data/test-unit/test/test_assertions.rb +1151 -0
  95. data/test-unit/test/test_error.rb +26 -0
  96. data/test-unit/test/test_failure.rb +33 -0
  97. data/test-unit/test/test_testresult.rb +113 -0
  98. data/test-unit/test/test_testsuite.rb +129 -0
  99. data/test-unit/test/testunit-test-util.rb +14 -0
  100. data/test-unit/test/ui/test_testrunmediator.rb +20 -0
  101. data/test-unit/test/util/test-method-owner-finder.rb +38 -0
  102. data/test-unit/test/util/test_backtracefilter.rb +41 -0
  103. data/test-unit/test/util/test_observable.rb +102 -0
  104. data/test-unit/test/util/test_procwrapper.rb +36 -0
  105. data/test/groonga-test-utils.rb +3 -2
  106. data/test/run-test.rb +14 -2
  107. data/test/test-column.rb +7 -7
  108. data/test/test-context-select.rb +34 -11
  109. data/test/test-exception.rb +3 -0
  110. data/test/test-expression-builder.rb +11 -0
  111. data/test/test-expression.rb +3 -6
  112. data/test/test-gqtp.rb +3 -5
  113. data/test/test-pagination.rb +249 -0
  114. data/test/test-record.rb +36 -8
  115. data/test/test-remote.rb +11 -4
  116. data/test/test-schema-create-table.rb +251 -0
  117. data/test/test-schema.rb +4 -24
  118. data/test/test-table-offset-and-limit.rb +3 -5
  119. data/test/test-table-select-mecab.rb +80 -0
  120. data/test/test-table-select-weight.rb +104 -0
  121. data/test/test-table.rb +22 -4
  122. data/test/test-version.rb +1 -1
  123. data/text/TUTORIAL.ja.rdoc +2 -0
  124. data/text/expression.rdoc +1 -0
  125. metadata +96 -35
@@ -0,0 +1,143 @@
1
+ # -*- coding: utf-8 -*-
2
+ #
3
+ # Copyright (C) 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
+ module Groonga
19
+ class TooSmallPage < Error
20
+ attr_reader :page, :available_pages
21
+ def initialize(page, available_pages)
22
+ @page = page
23
+ @available_pages = available_pages
24
+ super("too small page: #{@page}: " +
25
+ "available pages: #{@available_pages.inspect}")
26
+ end
27
+ end
28
+
29
+ class TooLargePage < Error
30
+ attr_reader :page, :available_pages
31
+ def initialize(page, available_pages)
32
+ @page = page
33
+ @available_pages = available_pages
34
+ super("too large page: #{@page}: " +
35
+ "available pages: #{@available_pages.inspect}")
36
+ end
37
+ end
38
+
39
+ class TooSmallPageSize < Error
40
+ attr_reader :page_size, :available_page_sizes
41
+ def initialize(page_size, available_page_sizes)
42
+ @page_size = page_size
43
+ @available_page_sizes = available_page_sizes
44
+ super("too small page size: #{@page_size}: " +
45
+ "available page sizes: #{@available_page_sizes.inspect}")
46
+ end
47
+ end
48
+
49
+ class Table
50
+ def paginate(sort_keys, options={})
51
+ _size = size
52
+ page_size = options[:size] || 10
53
+ minimum_size = [1, _size].min
54
+ if page_size < 1
55
+ raise TooSmallPageSize.new(page_size, minimum_size.._size)
56
+ end
57
+
58
+ max_page = [(_size / page_size.to_f).ceil, 1].max
59
+ page = options[:page] || 1
60
+ if page < 1
61
+ raise TooSmallPage.new(page, 1..max_page)
62
+ elsif max_page < page
63
+ raise TooLargePage.new(page, 1..max_page)
64
+ end
65
+
66
+ offset = (page - 1) * page_size
67
+ limit = page_size
68
+ records = sort(sort_keys, :offset => offset, :limit => limit)
69
+ records.extend(Pagination)
70
+ records.send(:set_pagination_info, page, page_size, _size)
71
+ records
72
+ end
73
+ end
74
+
75
+ # ページネーション機能を追加するモジュール。
76
+ #
77
+ # ページ番号など、0ベースではなく1ベースです。
78
+ module Pagination
79
+ attr_reader :current_page, :page_size, :n_pages, :n_records
80
+
81
+ def have_pages?
82
+ @n_pages > 1
83
+ end
84
+
85
+ def first_page
86
+ 1
87
+ end
88
+
89
+ def first_page?
90
+ @current_page == first_page
91
+ end
92
+
93
+ def last_page
94
+ @n_pages
95
+ end
96
+
97
+ def last_page?
98
+ @current_page == last_page
99
+ end
100
+
101
+ def have_next_page?
102
+ @current_page < @n_pages
103
+ end
104
+
105
+ def next_page
106
+ have_next_page? ? @current_page + 1 : nil
107
+ end
108
+
109
+ def have_previous_page?
110
+ @current_page > 1
111
+ end
112
+
113
+ def previous_page
114
+ have_previous_page? ? @current_page - 1 : nil
115
+ end
116
+
117
+ def n_records_in_page
118
+ size
119
+ end
120
+
121
+ def start_offset
122
+ return nil if @n_records.zero?
123
+ 1 + (@current_page - 1) * @page_size
124
+ end
125
+
126
+ def end_offset
127
+ return nil if @n_records.zero?
128
+ [start_offset + @page_size - 1, @n_records].min
129
+ end
130
+
131
+ def pages
132
+ first_page..last_page
133
+ end
134
+
135
+ private
136
+ def set_pagination_info(current_page, page_size, n_records)
137
+ @current_page = current_page
138
+ @page_size = page_size
139
+ @n_records = n_records
140
+ @n_pages = [(@n_records / @page_size.to_f).ceil, 1].max
141
+ end
142
+ end
143
+ end
@@ -15,6 +15,8 @@
15
15
  # License along with this library; if not, write to the Free Software
16
16
  # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
17
 
18
+ require 'English'
19
+
18
20
  module Groonga
19
21
  class Record
20
22
  # レコードが所属するテーブル
@@ -43,6 +43,77 @@ module Groonga
43
43
  # end
44
44
  # end
45
45
  class Schema
46
+ # スキーマ操作で発生する例外のスーパークラス。
47
+ class Error < Groonga::Error
48
+ end
49
+
50
+ # テーブルが存在しないときに発生する。
51
+ class TableNotExists < Error
52
+ attr_reader :name
53
+ def initialize(name)
54
+ @name = name
55
+ super("table doesn't exist: <#{@name}>")
56
+ end
57
+ end
58
+
59
+ # すでに存在するテーブルと違うオプションでテーブルを作ろ
60
+ # うとしたときに発生する。
61
+ class TableCreationWithDifferentOptions < Error
62
+ attr_reader :table, :options
63
+ def initialize(table, options)
64
+ @table = table
65
+ @options = options
66
+ super("creating table with differnt options: " +
67
+ "#{@table.inspect}: #{@options.inspect}")
68
+ end
69
+ end
70
+
71
+ # すでに存在するカラムと違うオプションでテーブルを作ろ
72
+ # うとしたときに発生する。
73
+ class ColumnCreationWithDifferentOptions < Error
74
+ attr_reader :column, :options
75
+ def initialize(column, options)
76
+ @column = column
77
+ @options = options
78
+ super("creating column with differnt option: " +
79
+ "#{@column.inspect}: #{@options.inspect}")
80
+ end
81
+ end
82
+
83
+ # 未知のインデックス対象を指定したときに発生する。
84
+ class UnknownIndexTarget < Error
85
+ attr_reader :target_name
86
+ def initialize(target_name)
87
+ @target_name = target_name
88
+ super("unknown index target: <#{@target_name}>")
89
+ end
90
+ end
91
+
92
+ # 未知のオプションを指定したときに発生する。
93
+ class UnknownOptions < Error
94
+ attr_reader :options, :unknown_keys, :available_keys
95
+ def initialize(options, unknown_keys, available_keys)
96
+ @options = options
97
+ @unknown_keys = unknown_keys
98
+ @available_keys = available_keys
99
+ message = "unknown keys are specified: #{u@nknown_keys.inspect}"
100
+ message << ": available keys: #{@available_keys.inspect}"
101
+ message << ": options: #{@options.inspect}"
102
+ super(message)
103
+ end
104
+ end
105
+
106
+ # 未知のテーブルの種類を指定したときに発生する。
107
+ class UnknownTableType < Error
108
+ attr_reader :type, :available_types
109
+ def initialize(type, available_types)
110
+ @type = type
111
+ @available_types = available_types
112
+ super("unknown table type: #{@type.inspect}: " +
113
+ "available types: #{@available_types.inspect}")
114
+ end
115
+ end
116
+
46
117
  class << self
47
118
 
48
119
  # call-seq:
@@ -144,11 +215,14 @@ module Groonga
144
215
  # ルにGroonga::IndexColumnを定義する場合は
145
216
  # <tt>"TokenBigram"</tt>などを指定する必要がある。
146
217
  #
147
- # 以下は+:type+に+:patricia_trie+を指定した時に指定可能。
218
+ # 以下は+:type+に+:hash+または+:patricia_trie+を指定し
219
+ # た時に指定可能。
148
220
  #
149
221
  # [+:key_normalize+]
150
222
  # +true+を指定するとキーを正規化する。
151
223
  #
224
+ # 以下は+:type+に+:patricia_trie+を指定した時に指定可能。
225
+ #
152
226
  # [+:key_with_sis+]
153
227
  # +true+を指定するとキーの文字列の全suffixが自動的に
154
228
  # 登録される。
@@ -569,11 +643,18 @@ module Groonga
569
643
  def define # :nodoc:
570
644
  table = context[@name]
571
645
  if @options[:change]
572
- raise ArgumentError, "table doesn't exist: #{@name}" if table.nil?
646
+ raise TableNotExists.new(@name) if table.nil?
573
647
  else
574
- if table and @options[:force]
575
- table.remove
576
- table = nil
648
+ if table
649
+ unless same_table?(table, create_options)
650
+ if @options[:force]
651
+ table.remove
652
+ table = nil
653
+ else
654
+ options = create_options
655
+ raise TableCreationWithDifferentOptions.new(table, options)
656
+ end
657
+ end
577
658
  end
578
659
  table ||= @table_type.create(create_options)
579
660
  end
@@ -832,9 +913,7 @@ module Groonga
832
913
  return if options.nil?
833
914
  unknown_keys = options.keys - AVAILABLE_OPTION_KEYS
834
915
  unless unknown_keys.empty?
835
- message = "unknown keys are specified: #{unknown_keys.inspect}"
836
- message << ": available keys: #{AVAILABLE_OPTION_KEYS.inspect}"
837
- raise ArgumentError, message
916
+ raise UnknownOptions.new(options, unknown_keys, AVAILABLE_OPTION_KEYS)
838
917
  end
839
918
  end
840
919
 
@@ -848,7 +927,7 @@ module Groonga
848
927
  when :patricia_trie
849
928
  Groonga::PatriciaTrie
850
929
  else
851
- raise ArgumentError, "unknown table type: #{type.inspect}"
930
+ raise UnknownTableType.new(type, [nil, :array, :hash, :patricia_trie])
852
931
  end
853
932
  end
854
933
 
@@ -863,6 +942,7 @@ module Groonga
863
942
  }
864
943
  key_support_table_common = {
865
944
  :key_type => Schema.normalize_type(@options[:key_type]),
945
+ :key_normalize => @options[:key_normalize],
866
946
  :default_tokenizer => @options[:default_tokenizer],
867
947
  }
868
948
 
@@ -872,12 +952,9 @@ module Groonga
872
952
  common.merge(key_support_table_common)
873
953
  elsif @table_type == Groonga::PatriciaTrie
874
954
  options = {
875
- :key_normalize => @options[:key_normalize],
876
955
  :key_with_sis => @options[:key_with_sis],
877
956
  }
878
957
  common.merge(key_support_table_common).merge(options)
879
- else
880
- raise ArgumentError, "unknown table type: #{@table_type.inspect}"
881
958
  end
882
959
  end
883
960
 
@@ -903,6 +980,44 @@ module Groonga
903
980
  definition.options.merge!(column_options.merge(options))
904
981
  self
905
982
  end
983
+
984
+ def same_table?(table, options)
985
+ return false unless table.class == @table_type
986
+ return false unless table.range == resolve_name(options[:value_type])
987
+ sub_records = options[:sub_records]
988
+ sub_records = false if sub_records.nil?
989
+ return false unless table.support_sub_records? == sub_records
990
+
991
+ case table
992
+ when Groonga::Array
993
+ true
994
+ when Groonga::Hash, Groonga::PatriciaTrie
995
+ return false unless table.domain == resolve_name(options[:key_type])
996
+ default_tokenizer = resolve_name(options[:default_tokenizer])
997
+ return false unless table.default_tokenizer == default_tokenizer
998
+ key_normalize = options[:key_normalize]
999
+ key_normalize = false if key_normalize.nil?
1000
+ return false unless table.normalize_key? == key_normalize
1001
+ if table.is_a?(Groonga::PatriciaTrie)
1002
+ key_with_sis = options[:key_with_sis]
1003
+ key_with_sis = false if key_with_sis.nil?
1004
+ return false unless table.register_key_with_sis? == key_with_sis
1005
+ end
1006
+ true
1007
+ else
1008
+ false
1009
+ end
1010
+ end
1011
+
1012
+ def resolve_name(type)
1013
+ if type.nil?
1014
+ nil
1015
+ elsif type.is_a?(String)
1016
+ context[type]
1017
+ else
1018
+ type
1019
+ end
1020
+ end
906
1021
  end
907
1022
 
908
1023
  class TableRemoveDefinition # :nodoc:
@@ -935,7 +1050,7 @@ module Groonga
935
1050
  def define # :nodoc:
936
1051
  view = context[@name]
937
1052
  if @options[:change]
938
- raise ArgumentError, "view doesn't exist: #{@name}" if view.nil?
1053
+ raise TableNotExists.new(@name) if view.nil?
939
1054
  else
940
1055
  if view and @options[:force]
941
1056
  view.remove
@@ -945,9 +1060,11 @@ module Groonga
945
1060
  end
946
1061
  _context = context
947
1062
  @tables.each do |table|
948
- _table = table
949
- table = context[table] unless table.is_a?(Groonga::Table)
950
- raise ArgumentError, "table doesn't exist: #{_table}" if table.nil?
1063
+ unless table.is_a?(Groonga::Table)
1064
+ table_name = table
1065
+ table = context[table_name]
1066
+ raise TableNotExists.new(table_name) if table.nil?
1067
+ end
951
1068
  view.add_table(table)
952
1069
  end
953
1070
  view
@@ -971,9 +1088,7 @@ module Groonga
971
1088
  return if options.nil?
972
1089
  unknown_keys = options.keys - AVAILABLE_OPTION_KEYS
973
1090
  unless unknown_keys.empty?
974
- message = "unknown keys are specified: #{unknown_keys.inspect}"
975
- message << ": available keys: #{AVAILABLE_OPTION_KEYS.inspect}"
976
- raise ArgumentError, message
1091
+ raise UnknownOptions.new(options, unknown_keys, AVAILABLE_OPTION_KEYS)
977
1092
  end
978
1093
  end
979
1094
 
@@ -1021,10 +1136,8 @@ module Groonga
1021
1136
  if @options.delete(:force)
1022
1137
  column.remove
1023
1138
  else
1024
- raise ArgumentError,
1025
- "the same name column with different type is " +
1026
- "already defined: #{@type.inspect}(#{@options.inspect}): " +
1027
- "#{column.inspect}"
1139
+ options = @options.merge(:type => @type)
1140
+ raise ColumnCreationWithDifferentOptions.new(column, options)
1028
1141
  end
1029
1142
  end
1030
1143
  table.define_column(@name,
@@ -1073,7 +1186,7 @@ module Groonga
1073
1186
  if target_table.nil? or
1074
1187
  !(@target_column == "_key" or
1075
1188
  target_table.have_column?(@target_column))
1076
- raise ArgumentError, "Unknown index target: <#{target_name}>"
1189
+ raise UnknownIndexTarget.new(target_name)
1077
1190
  end
1078
1191
  index = table.column(@name)
1079
1192
  if index
@@ -1081,11 +1194,9 @@ module Groonga
1081
1194
  if @options.delete(:force)
1082
1195
  index.remove
1083
1196
  else
1084
- raise ArgumentError,
1085
- "the same name index column with " +
1086
- "different target or options is " +
1087
- "already defined: #{target_name.inspect}" +
1088
- "(#{@options.inspect}): #{index.inspect}"
1197
+ options = @options.merge(:type => :index,
1198
+ :target_name => target_name)
1199
+ raise ColumnCreationWithDifferentOptions.new(index, options)
1089
1200
  end
1090
1201
  end
1091
1202
  index = table.define_index_column(@name,
data/rroonga-build.rb CHANGED
@@ -18,8 +18,8 @@
18
18
  module RroongaBuild
19
19
  module RequiredGroongaVersion
20
20
  MAJOR = 0
21
- MINOR = 1
22
- MICRO = 9
21
+ MINOR = 7
22
+ MICRO = 4
23
23
  VERSION = [MAJOR, MINOR, MICRO]
24
24
  end
25
25
 
@@ -0,0 +1,40 @@
1
+ # -*- ruby -*-
2
+
3
+ require 'rubygems'
4
+ gem 'rdoc'
5
+ require 'hoe'
6
+ require './lib/test/unit/version.rb'
7
+
8
+ ENV["NODOT"] = "yes"
9
+
10
+ version = Test::Unit::VERSION
11
+ ENV["VERSION"] = version
12
+ Hoe.spec('test-unit') do |p|
13
+ Hoe::Test::SUPPORTED_TEST_FRAMEWORKS[:testunit2] = "test/run-test.rb"
14
+ p.version = version
15
+ p.developer('Kouhei Sutou', 'kou@cozmixng.org')
16
+ p.developer('Ryan Davis', 'ryand-ruby@zenspider.com')
17
+
18
+ # Ex-Parrot:
19
+ # p.developer('Nathaniel Talbott', 'nathaniel@talbott.ws')
20
+ end
21
+
22
+ task :check_manifest => :clean_test_result
23
+ task :check_manifest => :clean_coverage
24
+
25
+ task :clean_test_result do
26
+ test_results = Dir.glob("**/.test-result")
27
+ sh("rm", "-rf", *test_results) unless test_results.empty?
28
+ end
29
+
30
+ task :clean_coverage do
31
+ sh("rm", "-rf", "coverage")
32
+ end
33
+
34
+ task :tag do
35
+ message = "Released Test::Unit #{version}!"
36
+ base = "svn+ssh://#{ENV['USER']}@rubyforge.org/var/svn/test-unit/"
37
+ sh 'svn', 'copy', '-m', message, "#{base}trunk", "#{base}tags/#{version}"
38
+ end
39
+
40
+ # vim: syntax=Ruby