rroonga 12.1.0 → 15.0.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a85769bf192cecc677daaaddb349b4728bdeb7d240d1ecb4fc9660495c5fa2de
4
- data.tar.gz: 05375332c1e8f93a9e1fb1b584a9e92d8923af6848ffdef223702a17d32852a8
3
+ metadata.gz: a8c53dad486923a4125523854fc1a538064bd66f7eca124a49d41cd8678e36f4
4
+ data.tar.gz: 29f8b4c3ca44a611e5ef943dd021dca22aaf5a749caaa6919092b07cbc521a44
5
5
  SHA512:
6
- metadata.gz: 3ec5e421bb75cdf1c944fcf36f70778f59113da9a8c4c20df7318fd56e21a1f00856fe9a9f308cab584183c32cbf055758b3e6bd52d415771c3f0c28080588bf
7
- data.tar.gz: d7d630a97a5831323c70ececc208016d4a5a02b4ddd476e043038eca71e8b6d37410d01c7eac8d5eb71b0788d7fbcc915d76737dfa38c0f3db02f1cc92b9884f
6
+ metadata.gz: f9953a1cff0d6dd71d32268a37e1f4cf3a00c68b5be4e750b0f52206100252eca38c81f2a4a5c13b2f697f3269247b02be62c899c13fd30424d575302b29cf51
7
+ data.tar.gz: 469bcf0c193330227165df69424cedc00639ef13a31a5c8d0be427ebf242fb374c0bf0fd98bc8c3a41dab197dd445da0ea43259a7523fab9c51767e96dc2e1d4
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- # -*- mode: ruby; coding: utf-8 -*-
1
+ # -*- ruby -*-
2
2
  #
3
3
  # Copyright (C) 2011-2013 Kouhei Sutou <kou@clear-code.com>
4
4
  #
@@ -17,4 +17,13 @@
17
17
 
18
18
  source "https://rubygems.org/"
19
19
 
20
+ plugin "rubygems-requirements-system"
21
+
20
22
  gemspec
23
+
24
+ gem "bundler"
25
+ gem "kramdown"
26
+ gem "packnga", ">= 1.0.0"
27
+ gem "rake"
28
+ gem "test-unit", ">= 3.0.0"
29
+ gem "yard"
data/README.md CHANGED
@@ -1,7 +1,6 @@
1
1
  # README
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/rroonga.svg)](http://badge.fury.io/rb/rroonga)
4
- [![Build Status](https://travis-ci.org/ranguba/rroonga.svg?branch=master)](https://travis-ci.org/ranguba/rroonga)
3
+ [![Gem Version](https://badge.fury.io/rb/rroonga.svg)](https://badge.fury.io/rb/rroonga)
5
4
 
6
5
  ## Name
7
6
 
@@ -19,7 +18,7 @@ functional features from Ruby with Rubyish form.
19
18
 
20
19
  See the following URL about Groonga.
21
20
 
22
- * [The Groonga official site](http://groonga.org/)
21
+ * [The Groonga official site](https://groonga.org/)
23
22
 
24
23
  ## Authors
25
24
 
@@ -44,17 +43,31 @@ contributed patches.)
44
43
 
45
44
  ## Install
46
45
 
47
- % sudo gem install rroonga
46
+ If you're using Bundler, add `plugin "rubygems-requirements-system"`
47
+ and `gem "rroonga"` to your `Gemfile`:
48
+
49
+ ```ruby
50
+ plugin "rubygems-requirements-system"
51
+
52
+ gem "rroonga"
53
+ ```
54
+
55
+ If you're not using Bundler, install `rubygems-requirements-system`
56
+ and `rroonga`:
57
+
58
+ ```bash
59
+ sudo gem install rubygems-requirements-system rroonga
60
+ ```
48
61
 
49
62
  ## Documents
50
63
 
51
- * [Reference manual in English](http://ranguba.org/rroonga/en/)
52
- * [Reference manual in Japanese](http://ranguba.org/rroonga/ja/)
64
+ * [Reference manual in English](https://ranguba.org/rroonga/en/)
65
+ * [Reference manual in Japanese](https://ranguba.org/rroonga/ja/)
53
66
 
54
67
  ## Mailing list
55
68
 
56
- * English: [groonga-talk](http://lists.sourceforge.net/mailman/listinfo/groonga-talk)
57
- * Japanese: [groonga-dev](http://lists.sourceforge.jp/mailman/listinfo/groonga-dev)
69
+ * English: [groonga-talk](https://lists.sourceforge.net/mailman/listinfo/groonga-talk)
70
+ * Japanese: [groonga-dev](https://lists.sourceforge.jp/mailman/listinfo/groonga-dev)
58
71
 
59
72
  ## Thanks
60
73
 
data/Rakefile CHANGED
@@ -47,11 +47,7 @@ Packnga::ReleaseTask.new(spec) do |task|
47
47
  end
48
48
 
49
49
  file "Makefile" => ["extconf.rb", "ext/groonga/extconf.rb"] do
50
- extconf_args = []
51
- if ENV["TRAVIS"]
52
- extconf_args << "--enable-debug-build"
53
- end
54
- ruby("extconf.rb", *extconf_args)
50
+ ruby("extconf.rb")
55
51
  end
56
52
 
57
53
  desc "Configure"
@@ -99,3 +95,13 @@ namespace :version do
99
95
  end
100
96
 
101
97
  task :default => :test
98
+
99
+ release_task = Rake.application["release"]
100
+ # We use Trusted Publishing.
101
+ release_task.prerequisites.delete("build")
102
+ release_task.prerequisites.delete("release:rubygem_push")
103
+ release_task_comment = release_task.comment
104
+ if release_task_comment
105
+ release_task.clear_comments
106
+ release_task.comment = release_task_comment.gsub(/ and build.*$/, "")
107
+ end
data/doc/text/news.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # NEWS
2
2
 
3
+ ## 15.0.4: 2025-03-29 {#version-15-0-4}
4
+
5
+ ### Improvements
6
+
7
+ * Dropped support for
8
+ [native-package-installer](https://rubygems.org/gems/native-package-installer).
9
+ We use only
10
+ [rubygems-requirements-system](https://rubygems.org/gems/rubygems-requirements-system).
11
+
12
+ ## 14.1.2: 2025-01-09 {#version-14-1-2}
13
+
14
+ ### Improvements
15
+
16
+ * Suppressed warnings from Ruby 3.4.
17
+
18
+ * Added support for
19
+ [rubygems-requirements-system](https://rubygems.org/gems/rubygems-requirements-system).
20
+
3
21
  ## 12.1.0: 2022-12-05 {#version-12-1-0}
4
22
 
5
23
  ### Fixes
data/doc/text/release.md CHANGED
@@ -74,18 +74,22 @@ Then, edit PO files:
74
74
 
75
75
  ## 3. Upload gem to RubyGems.org
76
76
 
77
- ### 3-1. For Linux
77
+ ### 3-1. Bump version if need
78
78
 
79
- $ rake release
79
+ Change `RB_GRN_MAJOR_VERSION`, `RB_GRN_MINOR_VERSION` and `RB_GRN_MICRO_VERSION`
80
+ to the same version of the latest Groonga.
81
+
82
+ $ $EDITOR ext/groonga/rb-grn.h
80
83
 
81
- ### 3-2. For Windows
84
+ ### 3-2. Release
82
85
 
83
- $ rake build:windows
84
- $ gem push pkg/rroonga-<the latest release version>-x86-mingw32.gem
85
- $ gem push pkg/rroonga-<the latest release version>-x64-mingw32.gem
86
+ $ rake release
86
87
 
87
88
  ### 3-3. Bump version
88
89
 
90
+ Increment `RB_GRN_MICRO_VERSION`.
91
+ If current `RB_GRN_MICRO_VERSION` is `9`, increment `RB_GRN_MINOR_VERSION` and reset `RB_GRN_MICRO_VERSION` to `0`.
92
+
89
93
  $ $EDITOR ext/groonga/rb-grn.h
90
94
 
91
95
  ## 4. Update ranguba.org
@@ -123,13 +127,17 @@ Second, commit and push the html directory:
123
127
  $ git commit
124
128
  $ git push
125
129
 
126
- ## 5. Announce in mailing lists
130
+ ## 5. Update BloGroonga (blog)
131
+
132
+ Please refer to [Groonga document](https://groonga.org//docs/contribution/development/release.html#blogroonga)
133
+ for how to update BloGroonga.
134
+
135
+ ## 6. Announce
127
136
 
128
- * groonga-talk (English)
129
- * e.g.: http://sourceforge.net/p/groonga/mailman/message/33144993/
130
- * groonga-dev (Japanese)
131
- * e.g.: http://sourceforge.jp/projects/groonga/lists/archive/dev/2014-December/003014.html
132
- * ruby-talk (English) (optional)
137
+ * [GitHub Discussions](https://github.com/ranguba/rroonga/discussions/categories/releases) (English/Japanese)
138
+ * [Twitter](https://twitter.com/groonga) (English/Japanese)
139
+ * [Facebook](https://ja-jp.facebook.com/groonga/) (English/Japanese)
140
+ * ruby-talk (English)
133
141
  * e.g.: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/428992
134
- * ruby-list (Japanese) (optional)
142
+ * ruby-list (Japanese)
135
143
  * e.g.: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-list/50025
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  #
3
- # Copyright (C) 2009-2021 Sutou Kouhei <kou@clear-code.com>
3
+ # Copyright (C) 2009-2025 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
@@ -16,14 +16,15 @@
16
16
  # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
17
 
18
18
  require "English"
19
- require "pathname"
20
- require "mkmf"
19
+ require "etc"
21
20
  require "fileutils"
22
- require "shellwords"
21
+ require "mkmf"
23
22
  require "open-uri"
23
+ require "pathname"
24
+ require "shellwords"
25
+ require "tmpdir"
24
26
  require "uri"
25
27
 
26
- require "native-package-installer"
27
28
  require "pkg-config"
28
29
 
29
30
  base_dir = Pathname(__FILE__).dirname.parent.parent.expand_path
@@ -60,7 +61,7 @@ def install_groonga_locally
60
61
  prepend_pkg_config_path_for_local_groonga
61
62
  end
62
63
 
63
- def download(url)
64
+ def download(url, output_path)
64
65
  message("downloading %s...", url)
65
66
  base_name = File.basename(url)
66
67
  if File.exist?(base_name)
@@ -79,19 +80,17 @@ def download(url)
79
80
  end
80
81
  end
81
82
  URI.open(url, "rb", *options) do |input|
82
- File.open(base_name, "wb") do |output|
83
- while (buffer = input.read(1024))
84
- output.print(buffer)
85
- end
83
+ File.open(output_path, "wb") do |output|
84
+ IO.copy_stream(input, output)
86
85
  end
87
86
  end
88
87
  message(" done\n")
89
88
  end
90
89
  end
91
90
 
92
- def run_command(start_message, command)
91
+ def run_command(start_message, command_line)
93
92
  message(start_message)
94
- if xsystem(command)
93
+ if xsystem(command_line)
95
94
  message(" done\n")
96
95
  else
97
96
  message(" failed\n")
@@ -99,111 +98,77 @@ def run_command(start_message, command)
99
98
  end
100
99
  end
101
100
 
102
- def configure_command_line(prefix)
103
- command_line = ["./configure"]
101
+ def cmake_command_line(source_dir, build_dir, install_dir)
102
+ command_line = ["cmake", "-S", source_dir, "-B", build_dir]
104
103
  debug_build_p = ENV["RROONGA_DEBUG_BUILD"] == "yes"
105
- command_line.concat("--enable-debug") if debug_build_p
106
- command_line << "--prefix=#{prefix}"
107
- command_line << "--disable-static"
108
- command_line << "--disable-document"
109
- command_line << "--disable-benchmark"
110
- command_line << "--disable-groonga-httpd"
111
- command_line << "--without-cutter"
112
- escaped_command_line = command_line.collect do |command|
113
- Shellwords.escape(command)
104
+ if debug_build_p
105
+ command_line << "-DCMAKE_BUILD_TYPE=Debug"
106
+ else
107
+ command_line << "-DCMAKE_BUILD_TYPE=RelWithDebInfo"
114
108
  end
115
- custom_command_line_options = with_config("groonga-configure-options")
109
+ command_line << "-DCMAKE_INSTALL_PREFIX=#{install_dir}"
110
+ custom_command_line_options = with_config("groonga-cmake-options")
116
111
  if custom_command_line_options.is_a?(String)
117
- escaped_command_line << custom_command_line_options
118
- end
119
- escaped_command_line.join(" ")
120
- end
121
-
122
- def guess_make
123
- env_make = ENV["MAKE"]
124
- return env_make if env_make
125
-
126
- candidates = ["gmake", "make"]
127
- candidates.each do |candidate|
128
- (ENV["PATH"] || "").split(File::PATH_SEPARATOR).each do |path|
129
- return candidate if File.executable?(File.join(path, candidate))
130
- end
131
- end
132
-
133
- "make"
134
- end
135
-
136
- def n_processors
137
- proc_file = "/proc/cpuinfo"
138
- if File.exist?(proc_file)
139
- File.readlines(proc_file).grep(/^processor/).size
140
- elsif /darwin/ =~ RUBY_PLATFORM
141
- `sysctl -n hw.ncpu`.to_i
142
- else
143
- 1
112
+ command_line.concat(Shellwords.split(custom_command_line_options))
144
113
  end
114
+ command_line
145
115
  end
146
116
 
147
- def install_for_gnu_build_system(install_dir)
148
- make = guess_make
117
+ def install_with_cmake(source_dir, build_dir, install_dir)
149
118
  run_command("configuring...",
150
- configure_command_line(install_dir))
119
+ cmake_command_line(source_dir, build_dir, install_dir))
151
120
  run_command("building (maybe long time)...",
152
- "#{make} -j#{n_processors}")
121
+ [{"CMAKE_BUILD_PARALLEL_LEVEL" => Etc.nprocessors.to_s},
122
+ "cmake", "--build", build_dir])
153
123
  run_command("installing...",
154
- "#{make} install")
124
+ ["cmake", "--install", build_dir])
155
125
  end
156
126
 
157
127
  def build_groonga_from_git
158
- message("removing old cloned repository...")
159
- FileUtils.rm_rf("groonga")
160
- message(" done\n")
161
-
162
- repository_url = "https://github.com/groonga/groonga.git"
163
- run_command("cloning...",
164
- "git clone --recursive --depth 1 #{repository_url}")
165
-
166
- Dir.chdir("groonga") do
167
- run_command("running autogen.sh...",
168
- "./autogen.sh")
169
- install_for_gnu_build_system(local_groonga_install_dir)
128
+ Dir.mktmpdir do |source_base_dir|
129
+ source_dir = File.join(source_base_dir, "groonga")
130
+ repository_url = "https://github.com/groonga/groonga.git"
131
+ run_command("cloning...",
132
+ [
133
+ "git",
134
+ "clone",
135
+ "--recursive",
136
+ "--depth=1",
137
+ repository_url,
138
+ source_dir,
139
+ ])
140
+
141
+ Dir.mktmpdir do |build_dir|
142
+ install_with_cmake(source_dir, build_dir, local_groonga_install_dir)
143
+ end
170
144
  end
171
-
172
- message("removing cloned repository...")
173
- FileUtils.rm_rf("groonga")
174
- message(" done\n")
175
145
  end
176
146
 
177
147
  def build_groonga_from_tar_gz
178
148
  tar_gz = "groonga-latest.tar.gz"
179
149
  url = "https://packages.groonga.org/source/groonga/#{tar_gz}"
180
- groonga_source_dir = "groonga-latest"
181
-
182
- download(url)
183
-
184
- FileUtils.rm_rf(groonga_source_dir)
185
- FileUtils.mkdir_p(groonga_source_dir)
186
-
187
- message("extracting...")
188
- # TODO: Use Zlip::GzipReader and Gem::Package::TarReader
189
- if xsystem("tar xfz #{tar_gz} -C #{groonga_source_dir} --strip-components=1")
190
- message(" done\n")
191
- else
192
- message(" failed\n")
193
- exit(false)
194
- end
150
+ Dir.mktmpdir do |source_base_dir|
151
+ source_tar_gz = File.join(source_base_dir, "groonga")
152
+ source_dir = File.join(source_base_dir, "groonga-latest")
153
+ download(url, source_tar_gz)
154
+
155
+ FileUtils.mkdir_p(source_dir)
156
+ message("extracting...")
157
+ # TODO: Use Zlip::GzipReader and Gem::Package::TarReader
158
+ if xsystem(["tar",
159
+ "-xf", source_tar_gz,
160
+ "-C", source_dir,
161
+ "--strip-components=1"])
162
+ message(" done\n")
163
+ else
164
+ message(" failed\n")
165
+ exit(false)
166
+ end
195
167
 
196
- Dir.chdir(groonga_source_dir) do
197
- install_for_gnu_build_system(local_groonga_install_dir)
168
+ Dir.mktmpdir do |build_dir|
169
+ install_with_cmake(source_dir, build_dir, local_groonga_install_dir)
170
+ end
198
171
  end
199
-
200
- message("removing source...")
201
- FileUtils.rm_rf(groonga_source_dir)
202
- message(" done\n")
203
-
204
- message("removing source archive...")
205
- FileUtils.rm_rf(tar_gz)
206
- message(" done\n")
207
172
  end
208
173
 
209
174
  def build_groonga
@@ -224,18 +189,7 @@ def install_local_groonga(package_name, major, minor, micro)
224
189
  add_rpath_for_local_groonga
225
190
  end
226
191
 
227
- need_auto_groonga_install = false
228
192
  unless PKGConfig.have_package(package_name, major, minor, micro)
229
- if NativePackageInstaller.install(debian: "libgroonga-dev",
230
- homebrew: "groonga",
231
- msys2: "groonga")
232
- need_auto_groonga_install =
233
- !PKGConfig.have_package(package_name, major, minor, micro)
234
- else
235
- need_auto_groonga_install = true
236
- end
237
- end
238
- if need_auto_groonga_install
239
193
  install_local_groonga(package_name, major, minor, micro)
240
194
  end
241
195
 
@@ -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-2016 Kouhei Sutou <kou@clear-code.com>
3
+ Copyright (C) 2009-2025 Sutou Kouhei <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
@@ -104,6 +104,7 @@ static VALUE eGrnCancel;
104
104
  static VALUE eGrnWindowFunctionError;
105
105
  static VALUE eGrnZstdError;
106
106
  static VALUE eGrnConnectionReset;
107
+ static VALUE eGrnBloscError;
107
108
 
108
109
  VALUE
109
110
  rb_grn_rc_to_exception (grn_rc rc)
@@ -357,6 +358,11 @@ rb_grn_rc_to_exception (grn_rc rc)
357
358
  case GRN_CONNECTION_RESET:
358
359
  exception = eGrnConnectionReset;
359
360
  break;
361
+ #if GRN_VERSION_OR_LATER(13, 0, 8)
362
+ case GRN_BLOSC_ERROR:
363
+ exception = eGrnBloscError;
364
+ break;
365
+ #endif
360
366
  }
361
367
 
362
368
  if (NIL_P(exception))
@@ -1086,4 +1092,16 @@ rb_grn_init_exception (VALUE mGrn)
1086
1092
  */
1087
1093
  eGrnConnectionReset =
1088
1094
  rb_define_class_under(mGrn, "ConnectionReset", rb_eGrnError);
1095
+
1096
+ #if GRN_VERSION_OR_LATER(13, 0, 8)
1097
+ /*
1098
+ * Document-class: Groonga::BloscError
1099
+ *
1100
+ * It is used when Blosc reports an error.
1101
+ *
1102
+ * @since 14.1.2
1103
+ */
1104
+ eGrnBloscError =
1105
+ rb_define_class_under(mGrn, "BloscError", rb_eGrnError);
1106
+ #endif
1089
1107
  }
@@ -46,7 +46,7 @@ VALUE rb_cGrnLessOperator;
46
46
  static VALUE
47
47
  rb_grn_less_operator_exec (int argc, VALUE *argv, VALUE self)
48
48
  {
49
- grn_bool less;
49
+ bool less;
50
50
  VALUE rb_x;
51
51
  VALUE rb_y;
52
52
  VALUE rb_options;
@@ -250,7 +250,7 @@ rb_grn_table_key_support_add (int argc, VALUE *argv, VALUE self)
250
250
  {
251
251
  grn_id id;
252
252
  VALUE key, values;
253
- int added = GRN_FALSE;
253
+ int added = false;
254
254
 
255
255
  rb_scan_args(argc, argv, "11", &key, &values);
256
256
  id = rb_grn_table_key_support_add_raw(self, key, &added);
@@ -659,12 +659,12 @@ static VALUE
659
659
  rb_grn_table_key_support_get_value (int argc, VALUE *argv, VALUE self)
660
660
  {
661
661
  VALUE rb_id_or_key, rb_options;
662
- grn_bool use_key;
662
+ bool use_key;
663
663
 
664
664
  rb_scan_args(argc, argv, "11", &rb_id_or_key, &rb_options);
665
665
 
666
666
  if (NIL_P(rb_options)) {
667
- use_key = GRN_TRUE;
667
+ use_key = true;
668
668
  } else {
669
669
  VALUE rb_option_id;
670
670
 
@@ -729,12 +729,12 @@ static VALUE
729
729
  rb_grn_table_key_support_set_value (int argc, VALUE *argv, VALUE self)
730
730
  {
731
731
  VALUE rb_id_or_key, rb_value, rb_options;
732
- grn_bool use_key;
732
+ bool use_key;
733
733
 
734
734
  rb_scan_args(argc, argv, "21", &rb_id_or_key, &rb_value, &rb_options);
735
735
 
736
736
  if (NIL_P(rb_options)) {
737
- use_key = GRN_TRUE;
737
+ use_key = true;
738
738
  } else {
739
739
  VALUE rb_option_id;
740
740
 
@@ -775,7 +775,7 @@ rb_grn_table_key_support_get_default_tokenizer (VALUE self)
775
775
  NULL);
776
776
  rb_grn_context_check(context, self);
777
777
 
778
- return GRNOBJECT2RVAL(Qnil, context, tokenizer, GRN_FALSE);
778
+ return GRNOBJECT2RVAL(Qnil, context, tokenizer, false);
779
779
  }
780
780
 
781
781
  /*
@@ -905,7 +905,7 @@ rb_grn_table_key_support_get_normalizer (VALUE self)
905
905
  normalizer = grn_obj_get_info(context, table, GRN_INFO_NORMALIZER, NULL);
906
906
  rb_grn_context_check(context, self);
907
907
 
908
- return GRNOBJECT2RVAL(Qnil, context, normalizer, GRN_FALSE);
908
+ return GRNOBJECT2RVAL(Qnil, context, normalizer, false);
909
909
  }
910
910
 
911
911
  /*
@@ -1020,7 +1020,7 @@ rb_grn_table_key_support_tokenize (int argc, VALUE *argv, VALUE self)
1020
1020
  grn_obj *table;
1021
1021
  char *string;
1022
1022
  int string_size;
1023
- grn_bool add_p;
1023
+ bool add_p;
1024
1024
  grn_obj tokens;
1025
1025
 
1026
1026
  rb_scan_args(argc, argv, "11", &rb_string, &rb_options);
data/ext/groonga/rb-grn.h CHANGED
@@ -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-2021 Sutou Kouhei <kou@clear-code.com>
3
+ Copyright (C) 2009-2025 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
@@ -91,9 +91,9 @@ RB_GRN_BEGIN_DECLS
91
91
 
92
92
  #define RB_GRN_HAVE_FLOAT32 GRN_VERSION_OR_LATER(10, 0, 2)
93
93
 
94
- #define RB_GRN_MAJOR_VERSION 12
95
- #define RB_GRN_MINOR_VERSION 1
96
- #define RB_GRN_MICRO_VERSION 0
94
+ #define RB_GRN_MAJOR_VERSION 15
95
+ #define RB_GRN_MINOR_VERSION 0
96
+ #define RB_GRN_MICRO_VERSION 4
97
97
 
98
98
  #define RB_GRN_OBJECT(object) ((RbGrnObject *)(object))
99
99
  #define RB_GRN_NAMED_OBJECT(object) ((RbGrnNamedObject *)(object))
@@ -1,6 +1,4 @@
1
- # -*- coding: utf-8 -*-
2
- #
3
- # Copyright (C) 2010-2016 Kouhei Sutou <kou@clear-code.com>
1
+ # Copyright (C) 2010-2025 Sutou Kouhei <kou@clear-code.com>
4
2
  #
5
3
  # This library is free software; you can redistribute it and/or
6
4
  # modify it under the terms of the GNU Lesser General Public
@@ -232,7 +230,7 @@ module Groonga
232
230
  # @yieldparam response [String] A response for a command.
233
231
  # @return [void]
234
232
  def restore(dumped_commands)
235
- buffer = ""
233
+ buffer = +""
236
234
  continued = false
237
235
  dumped_commands.each_line do |line|
238
236
  line = line.chomp
@@ -1,6 +1,4 @@
1
- # -*- coding: utf-8 -*-
2
- #
3
- # Copyright (C) 2011-2016 Kouhei Sutou <kou@clear-code.com>
1
+ # Copyright (C) 2011-2025 Sutou Kouhei <kou@clear-code.com>
4
2
  # Copyright (C) 2014 Masafumi Yokoyama <myokoym@gmail.com>
5
3
  #
6
4
  # This library is free software; you can redistribute it and/or
@@ -26,7 +24,7 @@ module Groonga
26
24
  end
27
25
 
28
26
  def utf8_string
29
- ""
27
+ +""
30
28
  end
31
29
  end
32
30
 
@@ -759,7 +757,7 @@ module Groonga
759
757
  ""
760
758
  else
761
759
  return value unless value.respond_to?(:valid_encoding?)
762
- sanitized_value = ""
760
+ sanitized_value = +""
763
761
  value = fix_encoding(value)
764
762
  value.each_char do |char|
765
763
  if char.valid_encoding?
@@ -1,6 +1,4 @@
1
- # -*- coding: utf-8 -*-
2
- #
3
- # Copyright (C) 2009-2010 Kouhei Sutou <kou@clear-code.com>
1
+ # Copyright (C) 2009-2025 Sutou Kouhei <kou@clear-code.com>
4
2
  #
5
3
  # This library is free software; you can redistribute it and/or
6
4
  # modify it under the terms of the GNU Lesser General Public
@@ -55,7 +53,7 @@ module Groonga
55
53
  options ||= {}
56
54
  other_text_handler = options[:other_text_handler]
57
55
  position = 0
58
- result = ''
56
+ result = +""
59
57
  if text.respond_to?(:encoding)
60
58
  encoding = text.encoding
61
59
  bytes = text.dup.force_encoding("ascii-8bit")
data/rroonga.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  # -*- ruby -*-
2
2
  #
3
- # Copyright (C) 2012-2020 Sutou Kouhei <kou@clear-code.com>
3
+ # Copyright (C) 2012-2025 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,16 +85,48 @@ Gem::Specification.new do |s|
85
85
 
86
86
  s.add_runtime_dependency("groonga-client", ">= 0.0.3")
87
87
  s.add_runtime_dependency("json")
88
- s.add_runtime_dependency("native-package-installer")
89
88
  s.add_runtime_dependency("pkg-config")
90
- s.add_development_dependency("test-unit", [">= 3.0.0"])
91
- s.add_development_dependency("rake")
92
- s.add_development_dependency("bundler")
93
- s.add_development_dependency("yard")
94
- s.add_development_dependency("packnga", [">= 1.0.0"])
95
- s.add_development_dependency("kramdown")
96
89
 
97
90
  required_groonga_version = RroongaBuild::RequiredGroongaVersion::STRING
98
91
  s.metadata["msys2_mingw_dependencies"] = "groonga>=#{required_groonga_version}"
92
+
93
+ package = "groonga>=#{required_groonga_version}"
94
+ groonga_base_url = "https://packages.groonga.org"
95
+ [
96
+ # Try without additional APT repositories
97
+ [
98
+ "debian",
99
+ "libgroonga-dev",
100
+ ],
101
+ [
102
+ "debian",
103
+ "#{groonga_base_url}/%{distribution}/groonga-apt-source-latest-%{code_name}.deb",
104
+ ],
105
+ # Retry with additional APT repositories
106
+ [
107
+ "debian",
108
+ "libgroonga-dev",
109
+ ],
110
+ # Try without additional Yum repositories
111
+ [
112
+ "rhel",
113
+ "pkgconfig(groonga)",
114
+ ],
115
+ [
116
+ "rhel",
117
+ "#{groonga_base_url}/almalinux/%{major_version}/groonga-release-latest.noarch.rpm",
118
+ ],
119
+ # Retry without additional Yum repositories
120
+ [
121
+ "rhel",
122
+ "pkgconfig(groonga)",
123
+ ],
124
+ [
125
+ "homebrew",
126
+ "groonga",
127
+ ],
128
+ ].each do |platform, system_package|
129
+ s.requirements << "system: #{package}: #{platform}: #{system_package}"
130
+ end
99
131
  end
100
132
 
data/test/run-test.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  #
3
- # Copyright (C) 2009-2016 Kouhei Sutou <kou@clear-code.com>
3
+ # Copyright (C) 2009-2025 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
@@ -18,20 +18,21 @@
18
18
  $VERBOSE = true
19
19
 
20
20
  base_dir = File.expand_path(File.join(File.dirname(__FILE__), ".."))
21
- ext_dir = File.join(base_dir, "ext", "groonga")
21
+ build_dir = Dir.pwd
22
+ ext_dir = File.join(build_dir, "ext", "groonga")
22
23
  lib_dir = File.join(base_dir, "lib")
23
24
  test_dir = File.join(base_dir, "test")
24
25
 
25
26
  make = nil
26
27
  if ENV["NO_MAKE"] != "yes"
27
- if system("which gmake > /dev/null")
28
+ if system("which", "gmake", out: IO::NULL)
28
29
  make = "gmake"
29
- elsif system("which make > /dev/null")
30
+ elsif system("which", "make", out: IO::NULL)
30
31
  make = "make"
31
32
  end
32
33
  end
33
34
  if make
34
- system("cd #{base_dir.dump} && #{make} > /dev/null") or exit(false)
35
+ system(make, "-C", build_dir, out: IO::NULL) or exit(false)
35
36
  end
36
37
 
37
38
  require "test-unit"
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2013 Kouhei Sutou <kou@clear-code.com>
1
+ # Copyright (C) 2013-2025 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
@@ -131,7 +131,7 @@ class DatabaseInspectorTest < Test::Unit::TestCase
131
131
  None
132
132
  INSPECTED
133
133
  else
134
- inspected = " Columns:\n"
134
+ inspected = +" Columns:\n"
135
135
  columns.each do |column|
136
136
  inspected << inspect_column(column)
137
137
  end
@@ -270,7 +270,7 @@ Database
270
270
 
271
271
  private
272
272
  def inspected(n_tables)
273
- inspected_tables = " Tables:\n"
273
+ inspected_tables = +" Tables:\n"
274
274
  if @database.tables.empty?
275
275
  inspected_tables << " None\n"
276
276
  else
@@ -475,6 +475,7 @@ class PatriciaTrieTest < Test::Unit::TestCase
475
475
  end
476
476
 
477
477
  def test_defrag
478
+ need_groonga(14, 1, 3) # We'll fix this in 14.1.3.
478
479
  users = Groonga::PatriciaTrie.create(:name => "Users",
479
480
  :key_type => "ShortText")
480
481
  users.define_column("name", "ShortText")
data/test/test-remote.rb CHANGED
@@ -98,11 +98,15 @@ class RemoteTest < Test::Unit::TestCase
98
98
  "alloc_count",
99
99
  "cache_hit_rate",
100
100
  "command_version",
101
+ "cpu",
101
102
  "default_command_version",
103
+ "default_n_workers",
102
104
  "max_command_version",
103
105
  "memory_map_size",
104
106
  "n_jobs",
105
107
  "n_queries",
108
+ "n_workers",
109
+ "os",
106
110
  "start_time",
107
111
  "starttime",
108
112
  "uptime",
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2009-2016 Kouhei Sutou <kou@clear-code.com>
1
+ # Copyright (C) 2009-2025 Sutou Kouhei <kou@clear-code.com>
2
2
  # Copyright (C) 2014-2016 Masafumi Yokoyama <yokoyama@clear-code.com>
3
3
  #
4
4
  # This library is free software; you can redistribute it and/or
@@ -427,7 +427,7 @@ column_create Accounts name COLUMN_SCALAR ShortText
427
427
  class ColumnCompressionTest < self
428
428
  def test_zlib
429
429
  define_column_compression_zlib_schema
430
- flags = "COLUMN_SCALAR"
430
+ flags = +"COLUMN_SCALAR"
431
431
  flags << "|COMPRESS_ZLIB" if context.support_zlib?
432
432
  assert_equal(<<-SCHEMA, dump)
433
433
  table_create Posts TABLE_NO_KEY
@@ -437,7 +437,7 @@ column_create Posts title #{flags} ShortText
437
437
 
438
438
  def test_lz4
439
439
  define_column_compression_lz4_schema
440
- flags = "COLUMN_SCALAR"
440
+ flags = +"COLUMN_SCALAR"
441
441
  flags << "|COMPRESS_LZ4" if context.support_lz4?
442
442
  assert_equal(<<-SCHEMA, dump)
443
443
  table_create Posts TABLE_NO_KEY
@@ -447,7 +447,7 @@ column_create Posts title #{flags} ShortText
447
447
 
448
448
  def test_zstd
449
449
  define_column_compression_zstd_schema
450
- flags = "COLUMN_SCALAR"
450
+ flags = +"COLUMN_SCALAR"
451
451
  flags << "|COMPRESS_ZSTD" if context.support_zstd?
452
452
  assert_equal(<<-SCHEMA, dump)
453
453
  table_create Posts TABLE_NO_KEY
@@ -457,7 +457,7 @@ column_create Posts title #{flags} ShortText
457
457
 
458
458
  def test_with_weight_vector
459
459
  define_column_compression_with_weight_vector_schema
460
- flags = "COLUMN_VECTOR|WITH_WEIGHT"
460
+ flags = +"COLUMN_VECTOR|WITH_WEIGHT"
461
461
  flags << "|COMPRESS_ZLIB" if context.support_zlib?
462
462
  assert_equal(<<-SCHEMA, dump)
463
463
  table_create Posts TABLE_NO_KEY
data/test/test-schema.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2009-2020 Kouhei Sutou <kou@clear-code.com>
1
+ # Copyright (C) 2009-2025 Sutou Kouhei <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
@@ -144,8 +144,7 @@ class SchemaTest < Test::Unit::TestCase
144
144
  end
145
145
  posts = context["Posts"]
146
146
  assert_kind_of(Groonga::Hash, posts)
147
- Groonga::Schema.rename_table("Posts", "Entries") do |table|
148
- end
147
+ Groonga::Schema.rename_table("Posts", "Entries")
149
148
  entries = context["Entries"]
150
149
  assert_kind_of(Groonga::Hash, entries)
151
150
  assert_equal("Entries", posts.name)
@@ -206,8 +205,7 @@ class SchemaTest < Test::Unit::TestCase
206
205
  end
207
206
  posts = context["Posts"]
208
207
  assert_kind_of(Groonga::PatriciaTrie, posts)
209
- Groonga::Schema.rename_table("Posts", "Entries") do |table|
210
- end
208
+ Groonga::Schema.rename_table("Posts", "Entries")
211
209
  entries = context["Entries"]
212
210
  assert_kind_of(Groonga::PatriciaTrie, entries)
213
211
  assert_equal("Entries", posts.name)
@@ -268,8 +266,7 @@ class SchemaTest < Test::Unit::TestCase
268
266
  end
269
267
  posts = context["Posts"]
270
268
  assert_kind_of(Groonga::DoubleArrayTrie, posts)
271
- Groonga::Schema.rename_table("Posts", "Entries") do |table|
272
- end
269
+ Groonga::Schema.rename_table("Posts", "Entries")
273
270
  entries = context["Entries"]
274
271
  assert_kind_of(Groonga::DoubleArrayTrie, entries)
275
272
  assert_equal("Entries", posts.name)
@@ -320,8 +317,7 @@ class SchemaTest < Test::Unit::TestCase
320
317
  end
321
318
  posts = context["Posts"]
322
319
  assert_kind_of(Groonga::Array, posts)
323
- Groonga::Schema.rename_table("Posts", "Entries") do |table|
324
- end
320
+ Groonga::Schema.rename_table("Posts", "Entries")
325
321
  entries = context["Entries"]
326
322
  assert_kind_of(Groonga::Array, entries)
327
323
  assert_equal("Entries", posts.name)
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: 12.1.0
4
+ version: 15.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kouhei Sutou
@@ -9,10 +9,9 @@ authors:
9
9
  - daijiro
10
10
  - Yuto HAYAMIZU
11
11
  - SHIDARA Yoji
12
- autorequire:
13
12
  bindir: bin
14
13
  cert_chain: []
15
- date: 2022-12-06 00:00:00.000000000 Z
14
+ date: 2025-03-29 00:00:00.000000000 Z
16
15
  dependencies:
17
16
  - !ruby/object:Gem::Dependency
18
17
  name: groonga-client
@@ -42,20 +41,6 @@ dependencies:
42
41
  - - ">="
43
42
  - !ruby/object:Gem::Version
44
43
  version: '0'
45
- - !ruby/object:Gem::Dependency
46
- name: native-package-installer
47
- requirement: !ruby/object:Gem::Requirement
48
- requirements:
49
- - - ">="
50
- - !ruby/object:Gem::Version
51
- version: '0'
52
- type: :runtime
53
- prerelease: false
54
- version_requirements: !ruby/object:Gem::Requirement
55
- requirements:
56
- - - ">="
57
- - !ruby/object:Gem::Version
58
- version: '0'
59
44
  - !ruby/object:Gem::Dependency
60
45
  name: pkg-config
61
46
  requirement: !ruby/object:Gem::Requirement
@@ -70,90 +55,6 @@ dependencies:
70
55
  - - ">="
71
56
  - !ruby/object:Gem::Version
72
57
  version: '0'
73
- - !ruby/object:Gem::Dependency
74
- name: test-unit
75
- requirement: !ruby/object:Gem::Requirement
76
- requirements:
77
- - - ">="
78
- - !ruby/object:Gem::Version
79
- version: 3.0.0
80
- type: :development
81
- prerelease: false
82
- version_requirements: !ruby/object:Gem::Requirement
83
- requirements:
84
- - - ">="
85
- - !ruby/object:Gem::Version
86
- version: 3.0.0
87
- - !ruby/object:Gem::Dependency
88
- name: rake
89
- requirement: !ruby/object:Gem::Requirement
90
- requirements:
91
- - - ">="
92
- - !ruby/object:Gem::Version
93
- version: '0'
94
- type: :development
95
- prerelease: false
96
- version_requirements: !ruby/object:Gem::Requirement
97
- requirements:
98
- - - ">="
99
- - !ruby/object:Gem::Version
100
- version: '0'
101
- - !ruby/object:Gem::Dependency
102
- name: bundler
103
- requirement: !ruby/object:Gem::Requirement
104
- requirements:
105
- - - ">="
106
- - !ruby/object:Gem::Version
107
- version: '0'
108
- type: :development
109
- prerelease: false
110
- version_requirements: !ruby/object:Gem::Requirement
111
- requirements:
112
- - - ">="
113
- - !ruby/object:Gem::Version
114
- version: '0'
115
- - !ruby/object:Gem::Dependency
116
- name: yard
117
- requirement: !ruby/object:Gem::Requirement
118
- requirements:
119
- - - ">="
120
- - !ruby/object:Gem::Version
121
- version: '0'
122
- type: :development
123
- prerelease: false
124
- version_requirements: !ruby/object:Gem::Requirement
125
- requirements:
126
- - - ">="
127
- - !ruby/object:Gem::Version
128
- version: '0'
129
- - !ruby/object:Gem::Dependency
130
- name: packnga
131
- requirement: !ruby/object:Gem::Requirement
132
- requirements:
133
- - - ">="
134
- - !ruby/object:Gem::Version
135
- version: 1.0.0
136
- type: :development
137
- prerelease: false
138
- version_requirements: !ruby/object:Gem::Requirement
139
- requirements:
140
- - - ">="
141
- - !ruby/object:Gem::Version
142
- version: 1.0.0
143
- - !ruby/object:Gem::Dependency
144
- name: kramdown
145
- requirement: !ruby/object:Gem::Requirement
146
- requirements:
147
- - - ">="
148
- - !ruby/object:Gem::Version
149
- version: '0'
150
- type: :development
151
- prerelease: false
152
- version_requirements: !ruby/object:Gem::Requirement
153
- requirements:
154
- - - ">="
155
- - !ruby/object:Gem::Version
156
- version: '0'
157
58
  description: |-
158
59
  Rroonga is an extension library to use Groonga's DB-API
159
60
  layer. Rroonga provides Rubyish readable and writable API
@@ -371,7 +272,6 @@ licenses:
371
272
  - LGPL-2.1
372
273
  metadata:
373
274
  msys2_mingw_dependencies: groonga>=12.0.2
374
- post_install_message:
375
275
  rdoc_options: []
376
276
  require_paths:
377
277
  - lib
@@ -386,9 +286,15 @@ required_rubygems_version: !ruby/object:Gem::Requirement
386
286
  - - ">="
387
287
  - !ruby/object:Gem::Version
388
288
  version: '0'
389
- requirements: []
390
- rubygems_version: 3.3.24
391
- signing_key:
289
+ requirements:
290
+ - 'system: groonga>=12.0.2: debian: libgroonga-dev'
291
+ - 'system: groonga>=12.0.2: debian: https://packages.groonga.org/%{distribution}/groonga-apt-source-latest-%{code_name}.deb'
292
+ - 'system: groonga>=12.0.2: debian: libgroonga-dev'
293
+ - 'system: groonga>=12.0.2: rhel: pkgconfig(groonga)'
294
+ - 'system: groonga>=12.0.2: rhel: https://packages.groonga.org/almalinux/%{major_version}/groonga-release-latest.noarch.rpm'
295
+ - 'system: groonga>=12.0.2: rhel: pkgconfig(groonga)'
296
+ - 'system: groonga>=12.0.2: homebrew: groonga'
297
+ rubygems_version: 3.6.2
392
298
  specification_version: 4
393
299
  summary: Ruby bindings for Groonga that provide full text search and column store
394
300
  features.