rroonga 12.1.0 → 14.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +6 -7
- data/Rakefile +11 -5
- data/doc/text/news.md +9 -0
- data/doc/text/release.md +21 -13
- data/ext/groonga/extconf.rb +62 -96
- data/ext/groonga/rb-grn-exception.c +19 -1
- data/ext/groonga/rb-grn.h +3 -3
- data/lib/groonga/context.rb +2 -4
- data/lib/groonga/dumper.rb +3 -5
- data/lib/groonga/patricia-trie.rb +2 -4
- data/rroonga.gemspec +39 -0
- data/test/run-test.rb +6 -5
- data/test/test-database-inspector.rb +3 -3
- data/test/test-patricia-trie.rb +1 -0
- data/test/test-remote.rb +4 -0
- data/test/test-schema-dumper.rb +5 -5
- data/test/test-schema.rb +5 -9
- metadata +26 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a0e743a4f12cf79bf5b69af96c6cb7aec72900dcf48316494b9acc41281eb182
|
|
4
|
+
data.tar.gz: 18af75fdf1d051bd57a36642c526fc3bbce572695c09de55912a7998a6030b00
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 91261fdf0a7a10bb90554cd3efb7758df845789c68a972a0dd7336fcc5f427f0f5470e5780d723541477e603c4b22fcaf5fb039bb50363f8f0b2682b9b977c3c
|
|
7
|
+
data.tar.gz: 7ad28c09541ad3b0b676445e6c31c8fcfe1cc417ecbd0e6dd068400aa887e0951b1a865242cc27b667639150cae1afb8f99d0865c6304ad0af21fd5b64c02db9
|
data/README.md
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
# README
|
|
2
2
|
|
|
3
|
-
[](
|
|
4
|
-
[](https://travis-ci.org/ranguba/rroonga)
|
|
3
|
+
[](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](
|
|
21
|
+
* [The Groonga official site](https://groonga.org/)
|
|
23
22
|
|
|
24
23
|
## Authors
|
|
25
24
|
|
|
@@ -48,13 +47,13 @@ contributed patches.)
|
|
|
48
47
|
|
|
49
48
|
## Documents
|
|
50
49
|
|
|
51
|
-
* [Reference manual in English](
|
|
52
|
-
* [Reference manual in Japanese](
|
|
50
|
+
* [Reference manual in English](https://ranguba.org/rroonga/en/)
|
|
51
|
+
* [Reference manual in Japanese](https://ranguba.org/rroonga/ja/)
|
|
53
52
|
|
|
54
53
|
## Mailing list
|
|
55
54
|
|
|
56
|
-
* English: [groonga-talk](
|
|
57
|
-
* Japanese: [groonga-dev](
|
|
55
|
+
* English: [groonga-talk](https://lists.sourceforge.net/mailman/listinfo/groonga-talk)
|
|
56
|
+
* Japanese: [groonga-dev](https://lists.sourceforge.jp/mailman/listinfo/groonga-dev)
|
|
58
57
|
|
|
59
58
|
## Thanks
|
|
60
59
|
|
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
|
-
|
|
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,14 @@
|
|
|
1
1
|
# NEWS
|
|
2
2
|
|
|
3
|
+
## 14.1.2: 2025-01-09 {#version-14-1-2}
|
|
4
|
+
|
|
5
|
+
### Improvements
|
|
6
|
+
|
|
7
|
+
* Suppressed warnings from Ruby 3.4.
|
|
8
|
+
|
|
9
|
+
* Added support for
|
|
10
|
+
[rubygems-requirements-system](https://rubygems.org/gems/rubygems-requirements-system).
|
|
11
|
+
|
|
3
12
|
## 12.1.0: 2022-12-05 {#version-12-1-0}
|
|
4
13
|
|
|
5
14
|
### 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.
|
|
77
|
+
### 3-1. Bump version if need
|
|
78
78
|
|
|
79
|
-
|
|
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.
|
|
84
|
+
### 3-2. Release
|
|
82
85
|
|
|
83
|
-
$ rake
|
|
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.
|
|
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
|
-
*
|
|
129
|
-
|
|
130
|
-
* groonga
|
|
131
|
-
|
|
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)
|
|
142
|
+
* ruby-list (Japanese)
|
|
135
143
|
* e.g.: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-list/50025
|
data/ext/groonga/extconf.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
#
|
|
3
|
-
# Copyright (C) 2009-
|
|
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,11 +16,13 @@
|
|
|
16
16
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
17
17
|
|
|
18
18
|
require "English"
|
|
19
|
-
require "
|
|
20
|
-
require "mkmf"
|
|
19
|
+
require "etc"
|
|
21
20
|
require "fileutils"
|
|
22
|
-
require "
|
|
21
|
+
require "mkmf"
|
|
23
22
|
require "open-uri"
|
|
23
|
+
require "pathname"
|
|
24
|
+
require "shellwords"
|
|
25
|
+
require "tmpdir"
|
|
24
26
|
require "uri"
|
|
25
27
|
|
|
26
28
|
require "native-package-installer"
|
|
@@ -60,7 +62,7 @@ def install_groonga_locally
|
|
|
60
62
|
prepend_pkg_config_path_for_local_groonga
|
|
61
63
|
end
|
|
62
64
|
|
|
63
|
-
def download(url)
|
|
65
|
+
def download(url, output_path)
|
|
64
66
|
message("downloading %s...", url)
|
|
65
67
|
base_name = File.basename(url)
|
|
66
68
|
if File.exist?(base_name)
|
|
@@ -79,19 +81,17 @@ def download(url)
|
|
|
79
81
|
end
|
|
80
82
|
end
|
|
81
83
|
URI.open(url, "rb", *options) do |input|
|
|
82
|
-
File.open(
|
|
83
|
-
|
|
84
|
-
output.print(buffer)
|
|
85
|
-
end
|
|
84
|
+
File.open(output_path, "wb") do |output|
|
|
85
|
+
IO.copy_stream(input, output)
|
|
86
86
|
end
|
|
87
87
|
end
|
|
88
88
|
message(" done\n")
|
|
89
89
|
end
|
|
90
90
|
end
|
|
91
91
|
|
|
92
|
-
def run_command(start_message,
|
|
92
|
+
def run_command(start_message, command_line)
|
|
93
93
|
message(start_message)
|
|
94
|
-
if xsystem(
|
|
94
|
+
if xsystem(command_line)
|
|
95
95
|
message(" done\n")
|
|
96
96
|
else
|
|
97
97
|
message(" failed\n")
|
|
@@ -99,111 +99,77 @@ def run_command(start_message, command)
|
|
|
99
99
|
end
|
|
100
100
|
end
|
|
101
101
|
|
|
102
|
-
def
|
|
103
|
-
command_line = ["
|
|
102
|
+
def cmake_command_line(source_dir, build_dir, install_dir)
|
|
103
|
+
command_line = ["cmake", "-S", source_dir, "-B", build_dir]
|
|
104
104
|
debug_build_p = ENV["RROONGA_DEBUG_BUILD"] == "yes"
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
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)
|
|
105
|
+
if debug_build_p
|
|
106
|
+
command_line << "-DCMAKE_BUILD_TYPE=Debug"
|
|
107
|
+
else
|
|
108
|
+
command_line << "-DCMAKE_BUILD_TYPE=RelWithDebInfo"
|
|
114
109
|
end
|
|
115
|
-
|
|
110
|
+
command_line << "-DCMAKE_INSTALL_PREFIX=#{install_dir}"
|
|
111
|
+
custom_command_line_options = with_config("groonga-cmake-options")
|
|
116
112
|
if custom_command_line_options.is_a?(String)
|
|
117
|
-
|
|
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
|
|
113
|
+
command_line.concat(Shellwords.split(custom_command_line_options))
|
|
131
114
|
end
|
|
132
|
-
|
|
133
|
-
"make"
|
|
115
|
+
command_line
|
|
134
116
|
end
|
|
135
117
|
|
|
136
|
-
def
|
|
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
|
|
144
|
-
end
|
|
145
|
-
end
|
|
146
|
-
|
|
147
|
-
def install_for_gnu_build_system(install_dir)
|
|
148
|
-
make = guess_make
|
|
118
|
+
def install_with_cmake(source_dir, build_dir, install_dir)
|
|
149
119
|
run_command("configuring...",
|
|
150
|
-
|
|
120
|
+
cmake_command_line(source_dir, build_dir, install_dir))
|
|
151
121
|
run_command("building (maybe long time)...",
|
|
152
|
-
"
|
|
122
|
+
[{"CMAKE_BUILD_PARALLEL_LEVEL" => Etc.nprocessors.to_s},
|
|
123
|
+
"cmake", "--build", build_dir])
|
|
153
124
|
run_command("installing...",
|
|
154
|
-
"
|
|
125
|
+
["cmake", "--install", build_dir])
|
|
155
126
|
end
|
|
156
127
|
|
|
157
128
|
def build_groonga_from_git
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
129
|
+
Dir.mktmpdir do |source_base_dir|
|
|
130
|
+
source_dir = File.join(source_base_dir, "groonga")
|
|
131
|
+
repository_url = "https://github.com/groonga/groonga.git"
|
|
132
|
+
run_command("cloning...",
|
|
133
|
+
[
|
|
134
|
+
"git",
|
|
135
|
+
"clone",
|
|
136
|
+
"--recursive",
|
|
137
|
+
"--depth=1",
|
|
138
|
+
repository_url,
|
|
139
|
+
source_dir,
|
|
140
|
+
])
|
|
141
|
+
|
|
142
|
+
Dir.mktmpdir do |build_dir|
|
|
143
|
+
install_with_cmake(source_dir, build_dir, local_groonga_install_dir)
|
|
144
|
+
end
|
|
170
145
|
end
|
|
171
|
-
|
|
172
|
-
message("removing cloned repository...")
|
|
173
|
-
FileUtils.rm_rf("groonga")
|
|
174
|
-
message(" done\n")
|
|
175
146
|
end
|
|
176
147
|
|
|
177
148
|
def build_groonga_from_tar_gz
|
|
178
149
|
tar_gz = "groonga-latest.tar.gz"
|
|
179
150
|
url = "https://packages.groonga.org/source/groonga/#{tar_gz}"
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
151
|
+
Dir.mktmpdir do |source_base_dir|
|
|
152
|
+
source_tar_gz = File.join(source_base_dir, "groonga")
|
|
153
|
+
source_dir = File.join(source_base_dir, "groonga-latest")
|
|
154
|
+
download(url, source_tar_gz)
|
|
155
|
+
|
|
156
|
+
FileUtils.mkdir_p(source_dir)
|
|
157
|
+
message("extracting...")
|
|
158
|
+
# TODO: Use Zlip::GzipReader and Gem::Package::TarReader
|
|
159
|
+
if xsystem(["tar",
|
|
160
|
+
"-xf", source_tar_gz,
|
|
161
|
+
"-C", source_dir,
|
|
162
|
+
"--strip-components=1"])
|
|
163
|
+
message(" done\n")
|
|
164
|
+
else
|
|
165
|
+
message(" failed\n")
|
|
166
|
+
exit(false)
|
|
167
|
+
end
|
|
195
168
|
|
|
196
|
-
|
|
197
|
-
|
|
169
|
+
Dir.mktmpdir do |build_dir|
|
|
170
|
+
install_with_cmake(source_dir, build_dir, local_groonga_install_dir)
|
|
171
|
+
end
|
|
198
172
|
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
173
|
end
|
|
208
174
|
|
|
209
175
|
def build_groonga
|
|
@@ -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-
|
|
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
|
}
|
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-
|
|
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
|
|
94
|
+
#define RB_GRN_MAJOR_VERSION 14
|
|
95
95
|
#define RB_GRN_MINOR_VERSION 1
|
|
96
|
-
#define RB_GRN_MICRO_VERSION
|
|
96
|
+
#define RB_GRN_MICRO_VERSION 2
|
|
97
97
|
|
|
98
98
|
#define RB_GRN_OBJECT(object) ((RbGrnObject *)(object))
|
|
99
99
|
#define RB_GRN_NAMED_OBJECT(object) ((RbGrnNamedObject *)(object))
|
data/lib/groonga/context.rb
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
#
|
|
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
|
data/lib/groonga/dumper.rb
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
#
|
|
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
|
-
#
|
|
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
|
@@ -87,6 +87,7 @@ Gem::Specification.new do |s|
|
|
|
87
87
|
s.add_runtime_dependency("json")
|
|
88
88
|
s.add_runtime_dependency("native-package-installer")
|
|
89
89
|
s.add_runtime_dependency("pkg-config")
|
|
90
|
+
s.add_runtime_dependency("rubygems-requirements-system")
|
|
90
91
|
s.add_development_dependency("test-unit", [">= 3.0.0"])
|
|
91
92
|
s.add_development_dependency("rake")
|
|
92
93
|
s.add_development_dependency("bundler")
|
|
@@ -96,5 +97,43 @@ Gem::Specification.new do |s|
|
|
|
96
97
|
|
|
97
98
|
required_groonga_version = RroongaBuild::RequiredGroongaVersion::STRING
|
|
98
99
|
s.metadata["msys2_mingw_dependencies"] = "groonga>=#{required_groonga_version}"
|
|
100
|
+
|
|
101
|
+
package = "groonga>=#{required_groonga_version}"
|
|
102
|
+
[
|
|
103
|
+
[
|
|
104
|
+
"debian",
|
|
105
|
+
"https://apache.jfrog.io/artifactory/arrow/%{distribution}/apache-arrow-apt-source-latest-%{code_name}.deb",
|
|
106
|
+
],
|
|
107
|
+
[
|
|
108
|
+
"debian",
|
|
109
|
+
"https://packages.groonga.org/%{distribution}/groonga-apt-source-latest-%{code_name}.deb",
|
|
110
|
+
],
|
|
111
|
+
[
|
|
112
|
+
"ubuntu",
|
|
113
|
+
"ppa:groonga/ppa",
|
|
114
|
+
],
|
|
115
|
+
[
|
|
116
|
+
"debian",
|
|
117
|
+
"libgroonga-dev",
|
|
118
|
+
],
|
|
119
|
+
[
|
|
120
|
+
"rhel",
|
|
121
|
+
"https://apache.jfrog.io/artifactory/arrow/almalinux/%{major_version}/apache-arrow-release-latest.rpm",
|
|
122
|
+
],
|
|
123
|
+
[
|
|
124
|
+
"rhel",
|
|
125
|
+
"https://packages.groonga.org/almalinux/%{major_version}/groonga-release-latest.noarch.rpm",
|
|
126
|
+
],
|
|
127
|
+
[
|
|
128
|
+
"rhel",
|
|
129
|
+
"pkgconfig(groonga)",
|
|
130
|
+
],
|
|
131
|
+
[
|
|
132
|
+
"homebrew",
|
|
133
|
+
"groonga",
|
|
134
|
+
],
|
|
135
|
+
].each do |platform, system_package|
|
|
136
|
+
s.requirements << "system: #{package}: #{platform}: #{system_package}"
|
|
137
|
+
end
|
|
99
138
|
end
|
|
100
139
|
|
data/test/run-test.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
#
|
|
3
|
-
# Copyright (C) 2009-
|
|
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
|
-
|
|
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
|
|
28
|
+
if system("which", "gmake", out: IO::NULL)
|
|
28
29
|
make = "gmake"
|
|
29
|
-
elsif system("which make
|
|
30
|
+
elsif system("which", "make", out: IO::NULL)
|
|
30
31
|
make = "make"
|
|
31
32
|
end
|
|
32
33
|
end
|
|
33
34
|
if make
|
|
34
|
-
system("
|
|
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
|
|
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
|
data/test/test-patricia-trie.rb
CHANGED
|
@@ -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",
|
data/test/test-schema-dumper.rb
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (C) 2009-
|
|
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-
|
|
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")
|
|
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")
|
|
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")
|
|
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")
|
|
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:
|
|
4
|
+
version: 14.1.2
|
|
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:
|
|
14
|
+
date: 2025-01-09 00:00:00.000000000 Z
|
|
16
15
|
dependencies:
|
|
17
16
|
- !ruby/object:Gem::Dependency
|
|
18
17
|
name: groonga-client
|
|
@@ -70,6 +69,20 @@ dependencies:
|
|
|
70
69
|
- - ">="
|
|
71
70
|
- !ruby/object:Gem::Version
|
|
72
71
|
version: '0'
|
|
72
|
+
- !ruby/object:Gem::Dependency
|
|
73
|
+
name: rubygems-requirements-system
|
|
74
|
+
requirement: !ruby/object:Gem::Requirement
|
|
75
|
+
requirements:
|
|
76
|
+
- - ">="
|
|
77
|
+
- !ruby/object:Gem::Version
|
|
78
|
+
version: '0'
|
|
79
|
+
type: :runtime
|
|
80
|
+
prerelease: false
|
|
81
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
82
|
+
requirements:
|
|
83
|
+
- - ">="
|
|
84
|
+
- !ruby/object:Gem::Version
|
|
85
|
+
version: '0'
|
|
73
86
|
- !ruby/object:Gem::Dependency
|
|
74
87
|
name: test-unit
|
|
75
88
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -371,7 +384,6 @@ licenses:
|
|
|
371
384
|
- LGPL-2.1
|
|
372
385
|
metadata:
|
|
373
386
|
msys2_mingw_dependencies: groonga>=12.0.2
|
|
374
|
-
post_install_message:
|
|
375
387
|
rdoc_options: []
|
|
376
388
|
require_paths:
|
|
377
389
|
- lib
|
|
@@ -386,9 +398,16 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
386
398
|
- - ">="
|
|
387
399
|
- !ruby/object:Gem::Version
|
|
388
400
|
version: '0'
|
|
389
|
-
requirements:
|
|
390
|
-
|
|
391
|
-
|
|
401
|
+
requirements:
|
|
402
|
+
- 'system: groonga>=12.0.2: debian: https://apache.jfrog.io/artifactory/arrow/%{distribution}/apache-arrow-apt-source-latest-%{code_name}.deb'
|
|
403
|
+
- 'system: groonga>=12.0.2: debian: https://packages.groonga.org/%{distribution}/groonga-apt-source-latest-%{code_name}.deb'
|
|
404
|
+
- 'system: groonga>=12.0.2: ubuntu: ppa:groonga/ppa'
|
|
405
|
+
- 'system: groonga>=12.0.2: debian: libgroonga-dev'
|
|
406
|
+
- 'system: groonga>=12.0.2: rhel: https://apache.jfrog.io/artifactory/arrow/almalinux/%{major_version}/apache-arrow-release-latest.rpm'
|
|
407
|
+
- 'system: groonga>=12.0.2: rhel: https://packages.groonga.org/almalinux/%{major_version}/groonga-release-latest.noarch.rpm'
|
|
408
|
+
- 'system: groonga>=12.0.2: rhel: pkgconfig(groonga)'
|
|
409
|
+
- 'system: groonga>=12.0.2: homebrew: groonga'
|
|
410
|
+
rubygems_version: 3.6.2
|
|
392
411
|
specification_version: 4
|
|
393
412
|
summary: Ruby bindings for Groonga that provide full text search and column store
|
|
394
413
|
features.
|