rroonga 9.0.7 → 10.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b746af2f9292a37577708353f345c6d07f4555be55e75656fe442beadde5ed6b
4
- data.tar.gz: 035b93cdea5b21cb27eba8e9d7780287e8efb7684560c0cda8769ed23de7b27d
3
+ metadata.gz: d4f0e0fdf1d23daf834ebb866894d0f05955af7187e07821154e151090273e06
4
+ data.tar.gz: e1bff6c3547943e270b04f1c2674845ef26bf2f1a64f40ec72f682a0d3b30843
5
5
  SHA512:
6
- metadata.gz: 984a7bbf57965efeaa6167d8258be509a1bce1d3e688fc7b80b83bacdd9393e75a2d43a852f557c44a18007de92171e86218b0db0a5a19acc47d3b956f1f691c
7
- data.tar.gz: 9f2071147b1c8bf0b921f00c52e7fbea18193100e71f9b47610e252425db346680dfed472a73ec5614e1a34c693c94bb73e1d117523a20ea31e664ecc2d6e21a
6
+ metadata.gz: ee1389b602d9544eb31a7273bf313f83da7599bb6317ffd9e83614bfd334af52d2fad638f23790095a4c2f56e8c70f66dc38a43d968e777e0c2fd0c0fa2e33a1
7
+ data.tar.gz: 3de057e696486314205762ea1bc6160c892d422cc04dbc8a98e5458ce2cf3404ba28901668158eb65e8b0af0493e5dad1bb5fd4f3ff7c32d02a7cdec65f22e11
data/Rakefile CHANGED
@@ -1,6 +1,6 @@
1
- # -*- coding: utf-8; mode: ruby -*-
1
+ # -*- ruby -*-
2
2
  #
3
- # Copyright (C) 2009-2019 Kouhei Sutou <kou@clear-code.com>
3
+ # Copyright (C) 2009-2020 Sutou Kouhei <kou@clear-code.com>
4
4
  # Copyright (C) 2017 Masafumi Yokoyama <yokoyama@clear-code.com>
5
5
  #
6
6
  # This library is free software; you can redistribute it and/or
@@ -16,15 +16,9 @@
16
16
  # License along with this library; if not, write to the Free Software
17
17
  # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
18
 
19
- require "find"
20
- require "fileutils"
21
- require "shellwords"
22
- require "pathname"
23
- require "erb"
24
- require "yard"
25
19
  require "bundler/gem_helper"
26
- require "rake/extensiontask"
27
20
  require "packnga"
21
+ require "yard"
28
22
 
29
23
  base_dir = File.join(File.dirname(__FILE__))
30
24
 
@@ -74,51 +68,6 @@ module YARD
74
68
  end
75
69
  end
76
70
 
77
- def windows?(platform=nil)
78
- platform ||= RUBY_PLATFORM
79
- platform =~ /mswin(?!ce)|mingw|cygwin|bccwin/
80
- end
81
-
82
- def collect_binary_files(binary_dir)
83
- binary_files = []
84
- Find.find(binary_dir) do |name|
85
- next unless File.file?(name)
86
- next if /\.zip\z/i =~ name
87
- binary_files << name
88
- end
89
- binary_files
90
- end
91
-
92
- def windows_gem_name(spec, architecture)
93
- "#{spec.name}-#{spec.version}-#{architecture}-mingw32.gem"
94
- end
95
-
96
- relative_vendor_dir = "vendor"
97
- relative_binary_dir = File.join("vendor", "local")
98
- vendor_dir = File.join(base_dir, relative_vendor_dir)
99
- binary_dir = File.join(base_dir, relative_binary_dir)
100
-
101
- groonga_win32_i386_p = ENV["RROONGA_USE_GROONGA_X64"].nil?
102
-
103
- Rake::ExtensionTask.new("groonga", spec) do |ext|
104
- if groonga_win32_i386_p
105
- ext.cross_platform = ["x86-mingw32"]
106
- else
107
- ext.cross_platform = ["x64-mingw32"]
108
- end
109
- if windows?
110
- ext.gem_spec.files += collect_binary_files(relative_binary_dir)
111
- else
112
- ext.cross_compile = true
113
- ext.cross_compiling do |_spec|
114
- if windows?(_spec.platform.to_s)
115
- binary_files = collect_binary_files(relative_binary_dir)
116
- _spec.files += binary_files
117
- end
118
- end
119
- end
120
- end
121
-
122
71
  file "Makefile" => ["extconf.rb", "ext/groonga/extconf.rb"] do
123
72
  extconf_args = []
124
73
  if ENV["TRAVIS"]
@@ -147,64 +96,4 @@ namespace :test do
147
96
  end
148
97
  end
149
98
 
150
- desc "Remove Groonga binary directory"
151
- namespace :clean do
152
- task :groonga do
153
- rm_rf binary_dir
154
- end
155
- end
156
-
157
- windows_architectures = [:x86, :x64]
158
-
159
- namespace :build do
160
- namespace :windows do
161
- ruby_versions = "2.3.0:2.4.0:2.5.0:2.6.0"
162
-
163
- windows_architectures.each do |architecture|
164
- desc "Build gem for Windows #{architecture}"
165
- task architecture do
166
- build_dir = "tmp/windows"
167
- rm_rf build_dir
168
- mkdir_p build_dir
169
-
170
- commands = [
171
- ["git", "clone", "file://#{Dir.pwd}/.git", build_dir],
172
- ["cd", build_dir],
173
- ["gem", "install", "json"],
174
- ["bundle"],
175
- ["rake", "cross", "native", "gem", "RUBY_CC_VERSION=#{ruby_versions}"],
176
- ]
177
- if architecture == :x64
178
- commands.unshift(["export", "RROONGA_USE_GROONGA_X64=true"])
179
- end
180
- raw_commands = commands.collect do |command|
181
- Shellwords.join(command)
182
- end
183
- raw_command_line = raw_commands.join(" && ")
184
-
185
- require "rake_compiler_dock"
186
- RakeCompilerDock.sh(raw_command_line)
187
-
188
- cp("#{build_dir}/pkg/#{windows_gem_name(spec, architecture)}",
189
- "pkg/")
190
- end
191
- end
192
- end
193
-
194
- desc "Build gems for Windows"
195
- build_tasks = windows_architectures.collect do |architecture|
196
- "windows:#{architecture}"
197
- end
198
- task :windows => build_tasks
199
- end
200
-
201
- namespace :release do
202
- desc "Push gems for Windows to RubyGems.org"
203
- task :windows do
204
- windows_architectures.each do |architecture|
205
- ruby("-S", "gem", "push", "pkg/#{windows_gem_name(spec, architecture)}")
206
- end
207
- end
208
- end
209
-
210
99
  task :default => :test
@@ -1,5 +1,19 @@
1
1
  # NEWS
2
2
 
3
+ ## 10.0.1: 2020-04-02 {#version-10-0-1}
4
+
5
+ ### Improvements
6
+
7
+ * Added support for creating a table with normalizer with options
8
+
9
+ * Windows: Added Ruby 2.7 support.
10
+
11
+ * Windows: Dropped Ruby 2.3.
12
+
13
+ * This version has been EOL.
14
+
15
+ * Dropped fat gem support.
16
+
3
17
  ## 9.0.7: 2019-08-29 {#version-9-0-7}
4
18
 
5
19
  ### Improvements
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  #
3
- # Copyright (C) 2009-2019 Kouhei Sutou <kou@clear-code.com>
3
+ # Copyright (C) 2009-2020 Sutou Kouhei <kou@clear-code.com>
4
4
  #
5
5
  # This library is free software; you can redistribute it and/or
6
6
  # modify it under the terms of the GNU Lesser General Public
@@ -49,30 +49,11 @@ def win32?
49
49
  /cygwin|mingw|mswin/ =~ RUBY_PLATFORM
50
50
  end
51
51
 
52
- checking_for(checking_message("Win32 OS")) do
53
- win32 = win32?
54
- if win32
55
- $defs << "-DRB_GRN_PLATFORM_WIN32"
56
- import_library_name = "libruby-#{module_name}.a"
57
- $DLDFLAGS << " -Wl,--out-implib=#{import_library_name}"
58
- $cleanfiles << import_library_name
59
- binary_base_dir = base_dir + "vendor" + "local"
60
- pkg_config_dir = binary_base_dir + "lib" + "pkgconfig"
61
- PKGConfig.add_path(pkg_config_dir.to_s)
62
- PKGConfig.set_override_variable("prefix", binary_base_dir.to_s)
63
- end
64
- win32
65
- end
66
-
67
52
  def install_groonga_locally
68
53
  FileUtils.mkdir_p(local_groonga_base_dir)
69
54
 
70
55
  Dir.chdir(local_groonga_base_dir) do
71
- if win32?
72
- extract_groonga_win32_binary
73
- else
74
- build_groonga
75
- end
56
+ build_groonga
76
57
  end
77
58
 
78
59
  prepend_pkg_config_path_for_local_groonga
@@ -107,50 +88,6 @@ def download(url)
107
88
  end
108
89
  end
109
90
 
110
- def extract_zip(filename, destrination_dir)
111
- require "archive/zip"
112
-
113
- Archive::Zip.extract(filename, destrination_dir)
114
- rescue LoadError
115
- command_line = ["unzip", filename, "-d", destrination_dir]
116
- unless system(*command_line)
117
- raise "Failed to unzip: #{command_line.join(' ')}"
118
- end
119
- end
120
-
121
- def extract_groonga_win32_binary
122
- if ENV["RROONGA_USE_GROONGA_X64"]
123
- architecture = "x64"
124
- else
125
- architecture = "x86"
126
- end
127
- zip = "groonga-latest-#{architecture}.zip"
128
- url = "https://packages.groonga.org/windows/groonga/#{zip}"
129
- install_dir = local_groonga_install_dir
130
-
131
- download(url)
132
-
133
- message("extracting...")
134
- before_paths = Dir.glob("*")
135
- extract_zip(zip, ".")
136
- extracted_dir = (Dir.glob("*") - before_paths).first
137
- message(" done\n")
138
-
139
- if File.exist?(install_dir)
140
- message("removing old install... #{install_dir}")
141
- FileUtils.rm_rf(install_dir)
142
- message(" done\n")
143
- end
144
-
145
- message("installing...")
146
- FileUtils.mv(extracted_dir, install_dir)
147
- message(" done\n")
148
-
149
- message("removing binary archive...")
150
- FileUtils.rm_rf(zip)
151
- message(" done\n")
152
- end
153
-
154
91
  def run_command(start_message, command)
155
92
  message(start_message)
156
93
  if xsystem(command)
@@ -247,6 +184,7 @@ def build_groonga_from_tar_gz
247
184
  FileUtils.mkdir_p(groonga_source_dir)
248
185
 
249
186
  message("extracting...")
187
+ # TODO: Use Zlip::GzipReader and Gem::Package::TarReader
250
188
  if xsystem("tar xfz #{tar_gz} -C #{groonga_source_dir} --strip-components=1")
251
189
  message(" done\n")
252
190
  else
@@ -285,14 +223,8 @@ def install_local_groonga(package_name, major, minor, micro)
285
223
  add_rpath_for_local_groonga
286
224
  end
287
225
 
288
- if win32?
289
- unless have_local_groonga?(package_name, major, minor, micro)
290
- install_local_groonga(package_name, major, minor, micro)
291
- end
292
- else
293
- unless PKGConfig.have_package(package_name, major, minor, micro)
294
- install_local_groonga(package_name, major, minor, micro)
295
- end
226
+ unless PKGConfig.have_package(package_name, major, minor, micro)
227
+ install_local_groonga(package_name, major, minor, micro)
296
228
  end
297
229
 
298
230
  real_version = PKGConfig.modversion(package_name)
@@ -1,6 +1,6 @@
1
1
  /* -*- coding: utf-8; mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
2
  /*
3
- Copyright (C) 2009-2014 Kouhei Sutou <kou@clear-code.com>
3
+ Copyright (C) 2009-2020 Kouhei Sutou <kou@clear-code.com>
4
4
  Copyright (C) 2014-2016 Masafumi Yokoyama <yokoyama@clear-code.com>
5
5
 
6
6
  This library is free software; you can redistribute it and/or
@@ -911,7 +911,9 @@ rb_grn_table_key_support_get_normalizer (VALUE self)
911
911
  * # Specifies normalizer object.
912
912
  * table.normalizer = Groonga::Context["NormalizerNFKC51"]
913
913
  * # Uses auto normalizer that is a normalizer for backward compatibility.
914
- * table.normalizer = "TNormalizerAuto"
914
+ * table.normalizer = "NormalizerAuto"
915
+ * # Uses a normalizer with options.
916
+ * table.normalizer = "NormalizerNFKC121('unify_kana', true)"
915
917
  *
916
918
  * @overload normalizer=(name)
917
919
  * @param [String] name Set a nomalizer named @name@.
@@ -927,7 +929,6 @@ rb_grn_table_key_support_set_normalizer (VALUE self, VALUE rb_normalizer)
927
929
  {
928
930
  grn_ctx *context;
929
931
  grn_obj *table;
930
- grn_obj *normalizer;
931
932
  grn_rc rc;
932
933
 
933
934
  rb_grn_table_key_support_deconstruct(SELF(self), &table, &context,
@@ -935,9 +936,25 @@ rb_grn_table_key_support_set_normalizer (VALUE self, VALUE rb_normalizer)
935
936
  NULL, NULL, NULL,
936
937
  NULL);
937
938
 
938
- normalizer = RVAL2GRNOBJECT(rb_normalizer, &context);
939
- rc = grn_obj_set_info(context, table, GRN_INFO_NORMALIZER, normalizer);
940
- rb_grn_context_check(context, self);
939
+ if (RB_TYPE_P(rb_normalizer, RUBY_T_STRING)) {
940
+ grn_obj normalizer;
941
+ VALUE exception;
942
+ GRN_TEXT_INIT(&normalizer, GRN_OBJ_DO_SHALLOW_COPY);
943
+ GRN_TEXT_SET(context,
944
+ &normalizer,
945
+ RSTRING_PTR(rb_normalizer),
946
+ RSTRING_LEN(rb_normalizer));
947
+ rc = grn_obj_set_info(context, table, GRN_INFO_NORMALIZER, &normalizer);
948
+ exception = rb_grn_context_to_exception(context, self);
949
+ GRN_OBJ_FIN(context, &normalizer);
950
+ if (!NIL_P(exception)) {
951
+ rb_exc_raise(exception);
952
+ }
953
+ } else {
954
+ grn_obj *normalizer = RVAL2GRNOBJECT(rb_normalizer, &context);
955
+ rc = grn_obj_set_info(context, table, GRN_INFO_NORMALIZER, normalizer);
956
+ rb_grn_context_check(context, self);
957
+ }
941
958
  rb_grn_rc_check(rc, self);
942
959
 
943
960
  return Qnil;
@@ -525,8 +525,8 @@ ruby_object_to_column_name (VALUE rb_name,
525
525
  }
526
526
 
527
527
  /*
528
- * テーブルの _name_ に対応するカラムを返す。カラムが存在しな
529
- * い場合は +nil+ を返す。
528
+ * It returns the column has the specified name.
529
+ * If the specified column does not exist, it returns `nil`.
530
530
  *
531
531
  * @overload column(name)
532
532
  * @return [Groonga::Column, nil]
@@ -606,11 +606,15 @@ rb_grn_table_get_column_surely (VALUE self, VALUE rb_name)
606
606
  }
607
607
 
608
608
  /*
609
- * テーブルの全てのカラムを返す。 _name_ が指定された場合はカ
610
- * ラム名の先頭が _name_ で始まるカラムを返す。
609
+ * @overload columns(prefix=nil)
610
+ * It returns the specified columns in the table.
611
611
  *
612
- * @overload columns(name=nil)
613
- * @return [Groonga::Columnの配列]
612
+ * @param prefix [String, nil]
613
+ * If this is `nil`, it returns the all columns in table.
614
+ *
615
+ * Otherwise it returns columns which have name starts with `prefix`.
616
+ *
617
+ * @return [::Array<Groonga::Column>]
614
618
  */
615
619
  static VALUE
616
620
  rb_grn_table_get_columns (int argc, VALUE *argv, VALUE self)
@@ -622,9 +626,9 @@ rb_grn_table_get_columns (int argc, VALUE *argv, VALUE self)
622
626
  grn_rc rc;
623
627
  int n;
624
628
  grn_table_cursor *cursor;
625
- VALUE rb_name, rb_columns;
626
- char *name = NULL;
627
- unsigned name_size = 0;
629
+ VALUE rb_prefix, rb_columns;
630
+ char *prefix = NULL;
631
+ unsigned prefix_size = 0;
628
632
  VALUE exception;
629
633
 
630
634
  rb_grn_table_deconstruct(SELF(self), &table, &context,
@@ -632,18 +636,18 @@ rb_grn_table_get_columns (int argc, VALUE *argv, VALUE self)
632
636
  NULL, NULL, NULL,
633
637
  NULL);
634
638
 
635
- rb_scan_args(argc, argv, "01", &rb_name);
639
+ rb_scan_args(argc, argv, "01", &rb_prefix);
636
640
 
637
- if (!NIL_P(rb_name)) {
638
- name = StringValuePtr(rb_name);
639
- name_size = RSTRING_LEN(rb_name);
641
+ if (!NIL_P(rb_prefix)) {
642
+ prefix = StringValuePtr(rb_prefix);
643
+ prefix_size = RSTRING_LEN(rb_prefix);
640
644
  }
641
645
 
642
646
  key_type = grn_ctx_at(context, GRN_DB_SHORT_TEXT);
643
647
  columns = grn_table_create(context, NULL, 0, NULL, GRN_TABLE_HASH_KEY,
644
648
  key_type, 0);
645
649
  rb_grn_context_check(context, self);
646
- n = grn_table_columns(context, table, name, name_size, columns);
650
+ n = grn_table_columns(context, table, prefix, prefix_size, columns);
647
651
  rb_grn_context_check(context, self);
648
652
 
649
653
  rb_columns = rb_ary_new2(n);
@@ -701,9 +705,10 @@ rb_grn_table_get_columns (int argc, VALUE *argv, VALUE self)
701
705
  }
702
706
 
703
707
  /*
704
- * テーブルが _name_ カラムを持っている場合は +true+ を返す。
708
+ * Checks whether the table has a specified column or not.
705
709
  *
706
710
  * @overload have_column?(name)
711
+ * @return [Boolean] `true` if the table has a `name` column, `false` otherwise.
707
712
  */
708
713
  static VALUE
709
714
  rb_grn_table_have_column (VALUE self, VALUE rb_name)
@@ -884,11 +889,10 @@ rb_grn_table_open_cursor (int argc, VALUE *argv, VALUE self)
884
889
  }
885
890
 
886
891
  /*
887
- * テーブルに登録されている全てのレコードが入っている配列を
888
- * 返す。
889
- *
890
892
  * @overload records
891
- * @return [Groonga::Recordの配列]
893
+ * It returns all records in the table.
894
+ *
895
+ * @return [::Array<Groonga::Record>]
892
896
  */
893
897
  static VALUE
894
898
  rb_grn_table_get_records (int argc, VALUE *argv, VALUE self)
@@ -909,9 +913,9 @@ rb_grn_table_get_records (int argc, VALUE *argv, VALUE self)
909
913
  }
910
914
 
911
915
  /*
912
- * テーブルに登録されているレコード数を返す。
913
- *
914
916
  * @overload size
917
+ * It returns the number of records in the table.
918
+ *
915
919
  * @return [Integer]
916
920
  */
917
921
  static VALUE
@@ -930,9 +934,10 @@ rb_grn_table_get_size (VALUE self)
930
934
  }
931
935
 
932
936
  /*
933
- * テーブルにレコードが登録されていなければ +true+ を返す。
934
- *
935
937
  * @overload empty?
938
+ *
939
+ * @return [Boolean] `true` if the table has no records,
940
+ * `false` otherwise.
936
941
  */
937
942
  static VALUE
938
943
  rb_grn_table_empty_p (VALUE self)
@@ -950,9 +955,11 @@ rb_grn_table_empty_p (VALUE self)
950
955
  }
951
956
 
952
957
  /*
953
- * テーブルの全レコードを一括して削除する。
958
+ * Deletes all records in the table at once.
954
959
  *
955
960
  * @overload truncate
961
+ *
962
+ * @return [void]
956
963
  */
957
964
  static VALUE
958
965
  rb_grn_table_truncate (VALUE self)
@@ -1123,7 +1130,7 @@ rb_grn_table_delete_by_expression (VALUE self)
1123
1130
  *
1124
1131
  * @param id [Integer] The ID of delete target record.
1125
1132
  *
1126
- * @return void
1133
+ * @return [void]
1127
1134
  *
1128
1135
  * @overload delete
1129
1136
  * Delete records that are matched with the given condition
@@ -1141,7 +1148,7 @@ rb_grn_table_delete_by_expression (VALUE self)
1141
1148
  * @yieldreturn [Groonga::ExpressionBuilder]
1142
1149
  * TODO: See #select.
1143
1150
  *
1144
- * @return void
1151
+ * @return [void]
1145
1152
  */
1146
1153
  static VALUE
1147
1154
  rb_grn_table_delete (int argc, VALUE *argv, VALUE self)
@@ -1624,9 +1631,10 @@ rb_grn_table_each_sub_record (VALUE self, VALUE rb_id)
1624
1631
  }
1625
1632
 
1626
1633
  /*
1627
- * _table_ _id_ に対応する {Groonga::Record} を返す。
1634
+ * It returns the {Groonga::Record} for the `id` in the `table`.
1628
1635
  *
1629
- * 0.9.0から値ではなく {Groonga::Record} を返すようになった。
1636
+ * The return value has been changed to {Groonga::Record} from `id`
1637
+ * itself since 0.9.0.
1630
1638
  *
1631
1639
  * @overload [](id)
1632
1640
  * @return [Groonga::Record]
@@ -1664,16 +1672,16 @@ rb_grn_table_get_value (VALUE self, VALUE rb_id)
1664
1672
  }
1665
1673
 
1666
1674
  /*
1667
- * _table_ _id_ に対応する値を返す。
1675
+ * It returns the value for the `id` in the `table`.
1668
1676
  *
1669
- * @:id => true@ が指定できるのは利便性のため。
1670
- * {Groonga::Array} でも {Groonga::Hash} や {Groonga::PatriciaTrie} と
1671
- * 同じ引数で動くようになる。
1677
+ * You can specify `id: true` for the convenience. `id: true` works
1678
+ * with {Groonga::Array} like for {Groonga::Hash},
1679
+ * {Groonga::PatriciaTrie} and so on.
1672
1680
  *
1673
1681
  * @overload value(id)
1674
- * @return []
1675
- * @overload value(id, :id => true)
1676
- * @return []
1682
+ * @return [value]
1683
+ * @overload value(id, id: true)
1684
+ * @return [value]
1677
1685
  */
1678
1686
  static VALUE
1679
1687
  rb_grn_table_get_value_convenience (int argc, VALUE *argv, VALUE self)
@@ -2509,11 +2517,11 @@ rb_grn_table_support_value_p (VALUE self)
2509
2517
  }
2510
2518
 
2511
2519
  /*
2512
- * グループ化したとき、テーブルにグループに含まれるレコード
2513
- * 数を格納できる場合は +true+ 、格納できない場合は +false+ を返
2514
- * す。
2515
- *
2516
2520
  * @overload support_sub_records?
2521
+ *
2522
+ * @return [Boolean] `true` if the table can store the number of
2523
+ * records for each group when the table is grouped, `false`
2524
+ * otherwise.
2517
2525
  */
2518
2526
  static VALUE
2519
2527
  rb_grn_table_support_sub_records_p (VALUE self)
@@ -2578,13 +2586,11 @@ rb_grn_table_have_n_sub_records_space_p (VALUE self)
2578
2586
  }
2579
2587
 
2580
2588
  /*
2581
- * _table_ に _id_ で指定したIDのレコードが存在する場合は +true+ 、
2582
- * 存在しない場合は +false+ を返す。
2583
- *
2584
- * 注意: 実行には相応のコストがかかるのであまり頻繁に呼ばな
2585
- * いようにして下さい。
2586
- *
2587
2589
  * @overload exist?(id)
2590
+ * @return [Boolean] `true` if the table has a record specified ID
2591
+ * by `id`, `false` otherwise.
2592
+ *
2593
+ * @note This method is heavy. You should not call this as much as possible.
2588
2594
  */
2589
2595
  static VALUE
2590
2596
  rb_grn_table_exist_p (VALUE self, VALUE id)
@@ -1,6 +1,6 @@
1
1
  /* -*- coding: utf-8; mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
2
  /*
3
- Copyright (C) 2009-2018 Kouhei Sutou <kou@clear-code.com>
3
+ Copyright (C) 2009-2020 Sutou Kouhei <kou@clear-code.com>
4
4
  Copyright (C) 2015-2017 Masafumi Yokoyama <yokoyama@clear-code.com>
5
5
 
6
6
  This library is free software; you can redistribute it and/or
@@ -73,15 +73,7 @@ RB_GRN_BEGIN_DECLS
73
73
  # define RB_GRN_GNUC_NULL_TERMINATED
74
74
  #endif
75
75
 
76
- #if defined(RUBY_GRN_PLATFORM_WIN32) && !defined(RB_GRN_PLATFORM_WIN32)
77
- # define RB_GRN_PLATFORM_WIN32 RUBY_GRN_PLATFORM_WIN32
78
- #endif
79
-
80
- #if defined(RUBY_GRN_STATIC_COMPILATION) && !defined(RB_GRN_STATIC_COMPILATION)
81
- # define RB_GRN_STATIC_COMPILATION RUBY_GRN_STATIC_COMPILATION
82
- #endif
83
-
84
- #if defined(RB_GRN_PLATFORM_WIN32) && !defined(RB_GRN_STATIC_COMPILATION)
76
+ #ifdef __WIN32__
85
77
  # ifdef RB_GRN_COMPILATION
86
78
  # define RB_GRN_VAR __declspec(dllexport)
87
79
  # else
@@ -97,9 +89,9 @@ RB_GRN_BEGIN_DECLS
97
89
  # define debug(...)
98
90
  #endif
99
91
 
100
- #define RB_GRN_MAJOR_VERSION 9
92
+ #define RB_GRN_MAJOR_VERSION 10
101
93
  #define RB_GRN_MINOR_VERSION 0
102
- #define RB_GRN_MICRO_VERSION 7
94
+ #define RB_GRN_MICRO_VERSION 1
103
95
 
104
96
  #define RB_GRN_OBJECT(object) ((RbGrnObject *)(object))
105
97
  #define RB_GRN_NAMED_OBJECT(object) ((RbGrnNamedObject *)(object))
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2009-2018 Kouhei Sutou <kou@clear-code.com>
1
+ # Copyright (C) 2009-2020 Sutou Kouhei <kou@clear-code.com>
2
2
  #
3
3
  # This library is free software; you can redistribute it and/or
4
4
  # modify it under the terms of the GNU Lesser General Public
@@ -44,12 +44,8 @@ require "groonga/record"
44
44
  require "groonga/expression-builder"
45
45
  require "groonga/posting"
46
46
  require "groonga/index"
47
- begin
48
- major, minor, _ = RUBY_VERSION.split(/\./)
49
- require "#{major}.#{minor}/groonga.so"
50
- rescue LoadError
51
- require "groonga.so"
52
- end
47
+
48
+ require "groonga.so"
53
49
 
54
50
  ##
55
51
  # rroonga用のネームスペース。rroongaのクラスやメソッ
@@ -1,6 +1,6 @@
1
- # -*- mode: ruby; coding: utf-8 -*-
1
+ # -*- ruby -*-
2
2
  #
3
- # Copyright (C) 2012-2016 Kouhei Sutou <kou@clear-code.com>
3
+ # Copyright (C) 2012-2020 Sutou Kouhei <kou@clear-code.com>
4
4
  # Copyright (C) 2017 Masafumi Yokoyama <yokoyama@clear-code.com>
5
5
  #
6
6
  # This library is free software; you can redistribute it and/or
@@ -85,14 +85,13 @@ Gem::Specification.new do |s|
85
85
  s.add_runtime_dependency("pkg-config")
86
86
  s.add_runtime_dependency("groonga-client", ">= 0.0.3")
87
87
  s.add_runtime_dependency("json")
88
- s.add_runtime_dependency("archive-zip")
89
88
  s.add_development_dependency("test-unit", [">= 3.0.0"])
90
89
  s.add_development_dependency("rake")
91
- s.add_development_dependency("rake-compiler", [">= 0.9.5"])
92
- s.add_development_dependency("rake-compiler-dock", [">= 0.6.2"])
93
90
  s.add_development_dependency("bundler")
94
91
  s.add_development_dependency("yard")
95
92
  s.add_development_dependency("packnga", [">= 1.0.0"])
96
93
  s.add_development_dependency("kramdown")
94
+
95
+ s.metadata["msys2_mingw_dependencies"] = "groonga"
97
96
  end
98
97
 
@@ -26,6 +26,7 @@ class RemoteTest < Test::Unit::TestCase
26
26
  else
27
27
  package_config = PKGConfig.package_config("groonga")
28
28
  groonga = package_config.variable("groonga")
29
+ groonga = "groonga" unless File.exist?(groonga)
29
30
  end
30
31
 
31
32
  @host = "127.0.0.1"
@@ -83,6 +84,7 @@ class RemoteTest < Test::Unit::TestCase
83
84
  "command_version",
84
85
  "default_command_version",
85
86
  "max_command_version",
87
+ "n_jobs",
86
88
  "n_queries",
87
89
  "start_time",
88
90
  "starttime",
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2009-2014 Kouhei Sutou <kou@clear-code.com>
1
+ # Copyright (C) 2009-2020 Kouhei Sutou <kou@clear-code.com>
2
2
  # Copyright (C) 2014 Masafumi Yokoyama <myokoym@gmail.com>
3
3
  #
4
4
  # This library is free software; you can redistribute it and/or
@@ -920,6 +920,14 @@ class SchemaTest < Test::Unit::TestCase
920
920
  end
921
921
  end
922
922
 
923
+ def test_normalizer_with_options
924
+ Groonga::Schema.create_table("Names",
925
+ key_type: :short_text,
926
+ normalizer: "NormalizerNFKC121('unify_kana', true)")
927
+ assert_equal(Groonga["NormalizerNFKC121"],
928
+ Groonga["Names"].normalizer)
929
+ end
930
+
923
931
  private
924
932
  def columns_directory_path(table)
925
933
  "#{table.path}.columns"
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2017-2018 Kouhei Sutou <kou@clear-code.com>
1
+ # Copyright (C) 2017-2020 Sutou Kouhei <kou@clear-code.com>
2
2
  #
3
3
  # This library is free software; you can redistribute it and/or
4
4
  # modify it under the terms of the GNU Lesser General Public
@@ -20,6 +20,9 @@ class TableArrowTest < Test::Unit::TestCase
20
20
  setup_database
21
21
 
22
22
  omit("Apache Arrow support is required") unless context.support_arrow?
23
+ if (Groonga::VERSION[0, 3] <=> [9, 1, 2]) <= 0
24
+ omit("Groonga 9.1.2 is buggy")
25
+ end
23
26
  end
24
27
 
25
28
  def assert_dump_load(type, n_records)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rroonga
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.0.7
4
+ version: 10.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kouhei Sutou
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2019-08-29 00:00:00.000000000 Z
15
+ date: 2020-04-06 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: pkg-config
@@ -56,20 +56,6 @@ dependencies:
56
56
  - - ">="
57
57
  - !ruby/object:Gem::Version
58
58
  version: '0'
59
- - !ruby/object:Gem::Dependency
60
- name: archive-zip
61
- requirement: !ruby/object:Gem::Requirement
62
- requirements:
63
- - - ">="
64
- - !ruby/object:Gem::Version
65
- version: '0'
66
- type: :runtime
67
- prerelease: false
68
- version_requirements: !ruby/object:Gem::Requirement
69
- requirements:
70
- - - ">="
71
- - !ruby/object:Gem::Version
72
- version: '0'
73
59
  - !ruby/object:Gem::Dependency
74
60
  name: test-unit
75
61
  requirement: !ruby/object:Gem::Requirement
@@ -98,34 +84,6 @@ dependencies:
98
84
  - - ">="
99
85
  - !ruby/object:Gem::Version
100
86
  version: '0'
101
- - !ruby/object:Gem::Dependency
102
- name: rake-compiler
103
- requirement: !ruby/object:Gem::Requirement
104
- requirements:
105
- - - ">="
106
- - !ruby/object:Gem::Version
107
- version: 0.9.5
108
- type: :development
109
- prerelease: false
110
- version_requirements: !ruby/object:Gem::Requirement
111
- requirements:
112
- - - ">="
113
- - !ruby/object:Gem::Version
114
- version: 0.9.5
115
- - !ruby/object:Gem::Dependency
116
- name: rake-compiler-dock
117
- requirement: !ruby/object:Gem::Requirement
118
- requirements:
119
- - - ">="
120
- - !ruby/object:Gem::Version
121
- version: 0.6.2
122
- type: :development
123
- prerelease: false
124
- version_requirements: !ruby/object:Gem::Requirement
125
- requirements:
126
- - - ">="
127
- - !ruby/object:Gem::Version
128
- version: 0.6.2
129
87
  - !ruby/object:Gem::Dependency
130
88
  name: bundler
131
89
  requirement: !ruby/object:Gem::Requirement
@@ -194,8 +152,8 @@ email:
194
152
  - y.hayamizu@gmail.com
195
153
  - dara@shidara.net
196
154
  executables:
197
- - grndump
198
155
  - groonga-database-inspect
156
+ - grndump
199
157
  - grntest-log-analyze
200
158
  - groonga-index-dump
201
159
  extensions:
@@ -396,7 +354,8 @@ files:
396
354
  homepage: http://ranguba.org/#about-rroonga
397
355
  licenses:
398
356
  - LGPL-2.1
399
- metadata: {}
357
+ metadata:
358
+ msys2_mingw_dependencies: groonga
400
359
  post_install_message:
401
360
  rdoc_options: []
402
361
  require_paths:
@@ -413,79 +372,79 @@ required_rubygems_version: !ruby/object:Gem::Requirement
413
372
  - !ruby/object:Gem::Version
414
373
  version: '0'
415
374
  requirements: []
416
- rubygems_version: 3.0.3
375
+ rubygems_version: 3.1.2
417
376
  signing_key:
418
377
  specification_version: 4
419
378
  summary: Ruby bindings for Groonga that provide full text search and column store
420
379
  features.
421
380
  test_files:
422
- - test/test-column-cache.rb
423
- - test/test-remote.rb
424
- - test/run-test.rb
425
- - test/test-query-logger.rb
426
- - test/test-data-column.rb
427
- - test/test-database-inspector.rb
428
- - test/test-type.rb
429
- - test/test-column.rb
430
- - test/test-expression.rb
431
- - test/test-fix-size-column.rb
432
- - test/test-table-offset-and-limit.rb
433
- - test/test-windows-event-logger.rb
434
- - test/test-lock-timeout.rb
381
+ - test/test-request-canceler.rb
435
382
  - test/test-convert.rb
436
- - test/test-accessor.rb
383
+ - test/test-table-select.rb
384
+ - test/test-table-dumper.rb
385
+ - test/test-table.rb
386
+ - test/test-thread.rb
387
+ - test/test-gqtp.rb
388
+ - test/test-geo-point.rb
389
+ - test/test-variable.rb
390
+ - test/test-operator.rb
391
+ - test/test-table-select-mecab.rb
392
+ - test/test-version.rb
393
+ - test/test-patricia-trie.rb
437
394
  - test/test-context.rb
438
- - test/test-procedure.rb
439
395
  - test/test-table-traverse.rb
440
- - test/test-sub-records.rb
441
- - test/test-package-label.rb
442
- - test/test-logger.rb
443
- - test/test-table-select.rb
396
+ - test/test-memory-pool.rb
444
397
  - test/test-config.rb
445
- - test/test-table-select-weight.rb
446
- - test/test-flushable.rb
398
+ - test/test-data-column.rb
399
+ - test/test-table-offset-and-limit.rb
400
+ - test/test-variable-size-column.rb
401
+ - test/test-fix-size-column.rb
402
+ - test/test-database.rb
447
403
  - test/test-token-regexp.rb
448
- - test/test-variable.rb
449
- - test/test-thread.rb
450
- - test/test-index-cursor.rb
451
- - test/test-table.rb
452
- - test/test-operator.rb
453
- - test/test-default-cache.rb
454
- - test/test-error-message.rb
455
- - test/test-vector-column.rb
456
- - test/test-index-column.rb
457
- - test/test-exception.rb
458
- - test/test-expression-builder.rb
459
- - test/test-double-array-trie.rb
460
- - test/test-plugin.rb
461
- - test/test-table-group.rb
462
- - test/test-snippet.rb
463
404
  - test/test-schema-dumper.rb
464
- - test/test-table-dumper.rb
465
- - test/test-gqtp.rb
466
- - test/test-memory-pool.rb
467
- - test/test-array.rb
405
+ - test/test-database-inspector.rb
406
+ - test/test-logger.rb
407
+ - test/test-windows-event-logger.rb
408
+ - test/test-package-label.rb
409
+ - test/test-flushable.rb
410
+ - test/test-expression-builder.rb
411
+ - test/test-table-arrow.rb
468
412
  - test/groonga-test-utils.rb
469
- - test/test-geo-point.rb
470
- - test/test-table-select-mecab.rb
413
+ - test/test-array.rb
414
+ - test/test-procedure.rb
415
+ - test/test-index-cursor.rb
416
+ - test/test-lock-timeout.rb
417
+ - test/test-double-array-trie.rb
418
+ - test/test-exception.rb
419
+ - test/test-accessor.rb
420
+ - test/test-schema-create-table.rb
421
+ - test/run-test.rb
422
+ - test/test-column-cache.rb
423
+ - test/test-request-timer.rb
424
+ - test/test-sub-records.rb
471
425
  - test/test-normalizer.rb
472
- - test/test-pagination.rb
473
- - test/test-schema-type.rb
474
- - test/test-patricia-trie.rb
426
+ - test/test-error-message.rb
427
+ - test/test-type.rb
475
428
  - test/test-table-select-normalize.rb
476
- - test/test-version.rb
477
- - test/test-hash.rb
478
- - test/test-encoding.rb
429
+ - test/test-snippet.rb
430
+ - test/test-index-column.rb
431
+ - test/test-query-logger.rb
432
+ - test/test-column.rb
479
433
  - test/test-name.rb
480
- - test/test-table-arrow.rb
481
- - test/test-variable-size-column.rb
482
- - test/test-database.rb
483
- - test/test-command-select.rb
434
+ - test/test-table-select-weight.rb
435
+ - test/test-pagination.rb
436
+ - test/test-vector-column.rb
437
+ - test/test-default-cache.rb
438
+ - test/test-id.rb
439
+ - test/test-schema.rb
440
+ - test/test-plugin.rb
441
+ - test/test-table-group.rb
484
442
  - test/test-record.rb
443
+ - test/test-expression.rb
485
444
  - test/test-table-key-support.rb
486
- - test/test-id.rb
487
- - test/test-request-timer.rb
488
- - test/test-request-canceler.rb
445
+ - test/test-remote.rb
446
+ - test/test-encoding.rb
489
447
  - test/test-database-dumper.rb
490
- - test/test-schema-create-table.rb
491
- - test/test-schema.rb
448
+ - test/test-command-select.rb
449
+ - test/test-hash.rb
450
+ - test/test-schema-type.rb