rroonga 7.1.1 → 9.0.2

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
- SHA1:
3
- metadata.gz: f0ff170aa9082bbfb76dec6278fdf8e73e63d27b
4
- data.tar.gz: 036da819743397109b89e4bf03c08083bf006cdc
2
+ SHA256:
3
+ metadata.gz: 43bad421fe95e5e2fc151ec07685791eea3af24391b3f304bed7edaf4a134322
4
+ data.tar.gz: c7f44d05c376ad9db717da49587255566196ddbfb35704355dbe7f623fb86248
5
5
  SHA512:
6
- metadata.gz: 1803d21a06243393ec418481e630b190d1b28cbb027fa10d9204967a4af8502ae9cb30ed25ce4acf578fbe62f924cc3fed8be2d6394b6b2e279808f41491c4a0
7
- data.tar.gz: 286a503c57d6c6a82f625fcb893f03bba784020b465b335115c24b28474ea99612868ff4b827f108cb77c23118677a785b4762d31ee40fb98f8ff8cfade16999
6
+ metadata.gz: b336ca9f19ae221c6a67e9b33b36abdcd5df013f8bfbebc3c90394e4c1c67ef9086634357688779122cd528f0266e994ab7e76402fbf5bcfd0fc32adc9e1f027
7
+ data.tar.gz: 6b08a37322b308430e92e8f2878fde3c537b658eeb79f96199c782f95d4225e0cde3483b9ece46fd71423a03afab986fc765f676354ec4f2b269a495c0a283f7
data/Rakefile CHANGED
@@ -1,6 +1,6 @@
1
1
  # -*- coding: utf-8; mode: ruby -*-
2
2
  #
3
- # Copyright (C) 2009-2018 Kouhei Sutou <kou@clear-code.com>
3
+ # Copyright (C) 2009-2019 Kouhei Sutou <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
@@ -132,7 +132,7 @@ task :configure => "Makefile"
132
132
 
133
133
  desc "Run test"
134
134
  task :test => :configure do
135
- ruby("-rubygems", "test/run-test.rb")
135
+ ruby("test/run-test.rb")
136
136
  end
137
137
 
138
138
  namespace :test do
@@ -143,7 +143,7 @@ namespace :test do
143
143
  gem_spec = Gem.source_index.find_name("rroonga").last
144
144
  installed_path = gem_spec.full_gem_path
145
145
  ENV["NO_MAKE"] = "yes"
146
- ruby("-rubygems", "#{installed_path}/test/run-test.rb")
146
+ ruby("#{installed_path}/test/run-test.rb")
147
147
  end
148
148
  end
149
149
 
@@ -1,5 +1,27 @@
1
1
  # NEWS
2
2
 
3
+ ## 9.0.2: 2019-05-10 {#version-9-0-2}
4
+
5
+ ### Improvements
6
+
7
+ * Disable groonga-httpd by default.
8
+
9
+ * Added support for "--with-groonga-configure-options".
10
+ [GitHub#146][Reported by Tomás Pollak]
11
+
12
+ * {Groonga::RegexpExpressionBuilder}: Added support (?-mix:XXX) for searching of regular expression.
13
+ [groonga-dev,04694][Reported by Masatoshi SEKI]
14
+
15
+ * Use "groonga-latest.tar.gz" for build Groonga.
16
+
17
+ * {Groonga::Schema#create_lexicon}: Added.
18
+
19
+ ### Thanks
20
+
21
+ * Tomás Pollak
22
+
23
+ * Masatoshi SEKI
24
+
3
25
  ## 7.1.1: 2018-01-30 {#version-7-1-1}
4
26
 
5
27
  ### Improvements
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  #
3
- # Copyright (C) 2009-2015 Kouhei Sutou <kou@clear-code.com>
3
+ # Copyright (C) 2009-2019 Kouhei Sutou <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
@@ -64,14 +64,14 @@ checking_for(checking_message("Win32 OS")) do
64
64
  win32
65
65
  end
66
66
 
67
- def install_groonga_locally(major, minor, micro)
67
+ def install_groonga_locally
68
68
  FileUtils.mkdir_p(local_groonga_base_dir)
69
69
 
70
70
  Dir.chdir(local_groonga_base_dir) do
71
71
  if win32?
72
- extract_groonga_win32_binary(major, minor, micro)
72
+ extract_groonga_win32_binary
73
73
  else
74
- build_groonga(major, minor, micro)
74
+ build_groonga
75
75
  end
76
76
  end
77
77
 
@@ -118,20 +118,22 @@ rescue LoadError
118
118
  end
119
119
  end
120
120
 
121
- def extract_groonga_win32_binary(major, minor, micro)
121
+ def extract_groonga_win32_binary
122
122
  if ENV["RROONGA_USE_GROONGA_X64"]
123
123
  architecture = "x64"
124
124
  else
125
125
  architecture = "x86"
126
126
  end
127
- zip = "groonga-#{major}.#{minor}.#{micro}-#{architecture}.zip"
128
- url = "http://packages.groonga.org/windows/groonga/#{zip}"
127
+ zip = "groonga-latest-#{architecture}.zip"
128
+ url = "https://packages.groonga.org/windows/groonga/#{zip}"
129
129
  install_dir = local_groonga_install_dir
130
130
 
131
131
  download(url)
132
132
 
133
133
  message("extracting...")
134
+ before_paths = Dir.glob("*")
134
135
  extract_zip(zip, ".")
136
+ extracted_dir = (Dir.glob("*") - before_paths).first
135
137
  message(" done\n")
136
138
 
137
139
  if File.exist?(install_dir)
@@ -141,7 +143,7 @@ def extract_groonga_win32_binary(major, minor, micro)
141
143
  end
142
144
 
143
145
  message("installing...")
144
- FileUtils.mv(File.basename(zip, ".zip"), install_dir)
146
+ FileUtils.mv(extracted_dir, install_dir)
145
147
  message(" done\n")
146
148
 
147
149
  message("removing binary archive...")
@@ -162,16 +164,20 @@ end
162
164
  def configure_command_line(prefix)
163
165
  command_line = ["./configure"]
164
166
  debug_build_p = ENV["RROONGA_DEBUG_BUILD"] == "yes"
165
- debug_flags = ["CFLAGS=-g3 -O0", "CXXFLAGS=-g3 -O0"]
166
- command_line.concat(debug_flags) if debug_build_p
167
+ command_line.concat("--enable-debug") if debug_build_p
167
168
  command_line << "--prefix=#{prefix}"
168
169
  command_line << "--disable-static"
169
170
  command_line << "--disable-document"
170
171
  command_line << "--disable-benchmark"
172
+ command_line << "--disable-groonga-httpd"
171
173
  command_line << "--without-cutter"
172
174
  escaped_command_line = command_line.collect do |command|
173
175
  Shellwords.escape(command)
174
176
  end
177
+ custom_command_line_options = with_config("groonga-configure-options")
178
+ if custom_command_line_options.is_a?(String)
179
+ escaped_command_line << custom_command_line_options
180
+ end
175
181
  escaped_command_line.join(" ")
176
182
  end
177
183
 
@@ -210,7 +216,7 @@ def install_for_gnu_build_system(install_dir)
210
216
  "#{make} install")
211
217
  end
212
218
 
213
- def build_groonga_from_git(major, minor, micro)
219
+ def build_groonga_from_git
214
220
  message("removing old cloned repository...")
215
221
  FileUtils.rm_rf("groonga")
216
222
  message(" done\n")
@@ -230,21 +236,24 @@ def build_groonga_from_git(major, minor, micro)
230
236
  message(" done\n")
231
237
  end
232
238
 
233
- def build_groonga_from_tar_gz(major, minor, micro)
234
- tar_gz = "groonga-#{major}.#{minor}.#{micro}.tar.gz"
235
- url = "http://packages.groonga.org/source/groonga/#{tar_gz}"
239
+ def build_groonga_from_tar_gz
240
+ tar_gz = "groonga-latest.tar.gz"
241
+ url = "https://packages.groonga.org/source/groonga/#{tar_gz}"
242
+ groonga_source_dir = "groonga-latest"
236
243
 
237
244
  download(url)
238
245
 
246
+ FileUtils.rm_rf(groonga_source_dir)
247
+ FileUtils.mkdir_p(groonga_source_dir)
248
+
239
249
  message("extracting...")
240
- if xsystem("tar xfz #{tar_gz}")
250
+ if xsystem("tar xfz #{tar_gz} -C #{groonga_source_dir} --strip-components=1")
241
251
  message(" done\n")
242
252
  else
243
253
  message(" failed\n")
244
254
  exit(false)
245
255
  end
246
256
 
247
- groonga_source_dir = "groonga-#{major}.#{minor}.#{micro}"
248
257
  Dir.chdir(groonga_source_dir) do
249
258
  install_for_gnu_build_system(local_groonga_install_dir)
250
259
  end
@@ -258,23 +267,17 @@ def build_groonga_from_tar_gz(major, minor, micro)
258
267
  message(" done\n")
259
268
  end
260
269
 
261
- def build_groonga(major, minor, micro)
270
+ def build_groonga
262
271
  if RequiredGroongaVersion::RELEASED_DATE > Time.now
263
- build_groonga_from_git(major, minor, micro)
272
+ build_groonga_from_git
264
273
  else
265
- build_groonga_from_tar_gz(major, minor, micro)
274
+ build_groonga_from_tar_gz
266
275
  end
267
276
  end
268
277
 
269
278
  def install_local_groonga(package_name, major, minor, micro)
270
279
  unless have_local_groonga?(package_name, major, minor, micro)
271
- required_version = [major, minor, micro]
272
- if (required_version <=> LatestGroongaVersion::VERSION) < 0
273
- target_version = LatestGroongaVersion::VERSION
274
- else
275
- target_version = required_version
276
- end
277
- install_groonga_locally(*target_version)
280
+ install_groonga_locally
278
281
  end
279
282
  unless PKGConfig.have_package(package_name, major, minor, micro)
280
283
  exit(false)
@@ -97,9 +97,9 @@ RB_GRN_BEGIN_DECLS
97
97
  # define debug(...)
98
98
  #endif
99
99
 
100
- #define RB_GRN_MAJOR_VERSION 7
101
- #define RB_GRN_MINOR_VERSION 1
102
- #define RB_GRN_MICRO_VERSION 1
100
+ #define RB_GRN_MAJOR_VERSION 9
101
+ #define RB_GRN_MINOR_VERSION 0
102
+ #define RB_GRN_MICRO_VERSION 2
103
103
 
104
104
  #define RB_GRN_OBJECT(object) ((RbGrnObject *)(object))
105
105
  #define RB_GRN_NAMED_OBJECT(object) ((RbGrnNamedObject *)(object))
@@ -186,7 +186,7 @@ module Groonga
186
186
  end
187
187
 
188
188
  if other.is_a?(Regexp)
189
- RegexpExpressionBuilder.new(self, normalize(other.source))
189
+ RegexpExpressionBuilder.new(self, normalize(other.to_s))
190
190
  else
191
191
  MatchExpressionBuilder.new(self, normalize(other))
192
192
  end
@@ -672,6 +672,19 @@ module Groonga
672
672
  @definitions << definition
673
673
  end
674
674
 
675
+ def create_lexicon(name,
676
+ use_case: :full_text_search,
677
+ **options, &block)
678
+ case use_case
679
+ when :full_text_search
680
+ options[:type] ||= :patricia_trie
681
+ options[:key_type] ||= :short_text
682
+ options[:default_tokenizer] ||= "TokenBigram"
683
+ options[:normalizer] ||= "NormalizerAuto"
684
+ end
685
+ create_table(name, options, &block)
686
+ end
687
+
675
688
  # 名前が _name_ のテーブルを削除する。
676
689
  #
677
690
  # テーブルの削除は# {define} を呼び出すまでは実行されないこ
@@ -16,18 +16,11 @@
16
16
 
17
17
  module RroongaBuild
18
18
  module RequiredGroongaVersion
19
- MAJOR = 7
20
- MINOR = 1
21
- MICRO = 1
22
- VERSION = [MAJOR, MINOR, MICRO]
23
- RELEASED_DATE = Time.utc(2018, 1, 29)
24
- end
25
-
26
- module LatestGroongaVersion
27
- MAJOR = 7
28
- MINOR = 1
29
- MICRO = 1
19
+ MAJOR = 9
20
+ MINOR = 0
21
+ MICRO = 2
30
22
  VERSION = [MAJOR, MINOR, MICRO]
23
+ RELEASED_DATE = Time.utc(2019, 4, 29)
31
24
  end
32
25
 
33
26
  module_function
@@ -326,6 +326,14 @@ class ExpressionBuilderTest < Test::Unit::TestCase
326
326
  assert_equal(["suzuki"],
327
327
  result.collect {|record| record.key.key}.sort)
328
328
  end
329
+
330
+ def test_option
331
+ result = @users.select do |record|
332
+ record["name"] =~ /Su/i
333
+ end
334
+ assert_equal(["suzuki"],
335
+ result.collect {|record| record.key.key}.sort)
336
+ end
329
337
  end
330
338
 
331
339
  class QueryStringTest < self
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: 7.1.1
4
+ version: 9.0.2
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: 2018-01-31 00:00:00.000000000 Z
15
+ date: 2019-05-10 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: pkg-config
@@ -196,8 +196,8 @@ email:
196
196
  executables:
197
197
  - grntest-log-analyze
198
198
  - groonga-database-inspect
199
- - grndump
200
199
  - groonga-index-dump
200
+ - grndump
201
201
  extensions:
202
202
  - ext/groonga/extconf.rb
203
203
  extra_rdoc_files:
@@ -413,80 +413,79 @@ required_rubygems_version: !ruby/object:Gem::Requirement
413
413
  - !ruby/object:Gem::Version
414
414
  version: '0'
415
415
  requirements: []
416
- rubyforge_project:
417
- rubygems_version: 2.5.2.2
416
+ rubygems_version: 3.0.3
418
417
  signing_key:
419
418
  specification_version: 4
420
419
  summary: Ruby bindings for Groonga that provide full text search and column store
421
420
  features.
422
421
  test_files:
423
- - test/test-context.rb
424
- - test/test-normalizer.rb
425
422
  - test/test-double-array-trie.rb
423
+ - test/test-error-message.rb
426
424
  - test/test-token-regexp.rb
425
+ - test/test-encoding.rb
426
+ - test/test-context.rb
427
+ - test/test-schema-dumper.rb
428
+ - test/test-data-column.rb
429
+ - test/test-lock-timeout.rb
430
+ - test/test-convert.rb
431
+ - test/test-memory-pool.rb
432
+ - test/test-index-column.rb
433
+ - test/test-exception.rb
434
+ - test/test-table.rb
435
+ - test/run-test.rb
436
+ - test/test-flushable.rb
437
+ - test/test-variable-size-column.rb
438
+ - test/test-table-select-mecab.rb
427
439
  - test/test-remote.rb
440
+ - test/test-array.rb
441
+ - test/test-table-select-normalize.rb
442
+ - test/test-geo-point.rb
443
+ - test/test-logger.rb
428
444
  - test/test-expression.rb
429
- - test/test-schema-dumper.rb
430
- - test/test-patricia-trie.rb
431
- - test/test-table-group.rb
432
- - test/test-table-select.rb
433
- - test/test-encoding.rb
445
+ - test/test-procedure.rb
446
+ - test/test-fix-size-column.rb
447
+ - test/test-id.rb
434
448
  - test/test-windows-event-logger.rb
435
- - test/test-plugin.rb
436
- - test/test-table-select-normalize.rb
437
- - test/test-hash.rb
438
- - test/test-gqtp.rb
439
- - test/test-table-dumper.rb
440
- - test/test-data-column.rb
441
- - test/test-pagination.rb
442
- - test/test-column.rb
443
- - test/test-table-traverse.rb
444
- - test/test-default-cache.rb
449
+ - test/test-schema-type.rb
450
+ - test/test-table-select-weight.rb
451
+ - test/test-accessor.rb
445
452
  - test/test-type.rb
446
- - test/test-package-label.rb
447
- - test/groonga-test-utils.rb
448
- - test/test-thread.rb
449
- - test/test-procedure.rb
453
+ - test/test-hash.rb
454
+ - test/test-patricia-trie.rb
450
455
  - test/test-query-logger.rb
451
- - test/test-index-column.rb
456
+ - test/test-record.rb
457
+ - test/test-column.rb
452
458
  - test/test-vector-column.rb
453
- - test/test-fix-size-column.rb
454
- - test/test-error-message.rb
455
- - test/test-operator.rb
456
- - test/test-database-dumper.rb
457
- - test/run-test.rb
458
- - test/test-column-cache.rb
459
- - test/test-index-cursor.rb
460
- - test/test-schema-type.rb
459
+ - test/test-variable.rb
460
+ - test/test-table-group.rb
461
+ - test/test-table-offset-and-limit.rb
462
+ - test/test-default-cache.rb
463
+ - test/test-normalizer.rb
464
+ - test/test-table-key-support.rb
465
+ - test/test-name.rb
461
466
  - test/test-database.rb
462
- - test/test-id.rb
463
- - test/test-request-canceler.rb
464
- - test/test-logger.rb
465
- - test/test-table.rb
466
- - test/test-record.rb
467
467
  - test/test-version.rb
468
- - test/test-table-select-mecab.rb
469
- - test/test-lock-timeout.rb
470
- - test/test-table-select-weight.rb
471
- - test/test-geo-point.rb
472
- - test/test-array.rb
473
- - test/test-request-timer.rb
468
+ - test/test-pagination.rb
469
+ - test/test-database-inspector.rb
474
470
  - test/test-sub-records.rb
471
+ - test/test-gqtp.rb
472
+ - test/test-request-canceler.rb
473
+ - test/test-table-traverse.rb
474
+ - test/test-expression-builder.rb
475
+ - test/test-operator.rb
476
+ - test/test-table-dumper.rb
477
+ - test/test-package-label.rb
478
+ - test/test-plugin.rb
479
+ - test/test-database-dumper.rb
480
+ - test/test-snippet.rb
481
+ - test/test-table-arrow.rb
475
482
  - test/test-schema-create-table.rb
476
- - test/test-name.rb
483
+ - test/groonga-test-utils.rb
484
+ - test/test-thread.rb
477
485
  - test/test-schema.rb
478
- - test/test-command-select.rb
479
- - test/test-expression-builder.rb
480
- - test/test-convert.rb
481
- - test/test-memory-pool.rb
482
- - test/test-flushable.rb
483
- - test/test-table-offset-and-limit.rb
484
- - test/test-exception.rb
485
- - test/test-variable-size-column.rb
486
+ - test/test-request-timer.rb
487
+ - test/test-index-cursor.rb
488
+ - test/test-column-cache.rb
486
489
  - test/test-config.rb
487
- - test/test-table-key-support.rb
488
- - test/test-table-arrow.rb
489
- - test/test-database-inspector.rb
490
- - test/test-variable.rb
491
- - test/test-snippet.rb
492
- - test/test-accessor.rb
490
+ - test/test-command-select.rb
491
+ - test/test-table-select.rb