solr_wrapper 4.1.3 → 4.3.0

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: a95e5af0cdecef5309de51b47fa1b4b4172c5bef9e84d029d7835b208e1dbfd5
4
- data.tar.gz: 9324671fad88ddf5db41b28d5b5082aa4b24ff1e6a017394ac164314e3f307c1
3
+ metadata.gz: 18f3d35de784cb86498a00c3441df0319346e4612cc701a0884285d2d1fec8f7
4
+ data.tar.gz: a2b668dfb513b3c95e0bb9eedb5b891e1121cc329214dee4bc984702f66709ef
5
5
  SHA512:
6
- metadata.gz: 86620b8d9dba64df3d86544bc6224eeeb18cf69f0854e578b3e130af15c90018973a227ce5d98842efe44a99e8d6ae9f80164a8462a4218751dda6ed421549ac
7
- data.tar.gz: 5e5b9769e578bf695ed773e62537c12e0d3640104d39f4656a091f69cea8ea57226a98a69173f03b60c14370f657dcc42f00b96812bf662b4734bb020d0e5d98
6
+ metadata.gz: 5c10dc4da08e95d372b7755ee8c86f42ed6788a002660b226581b38609452808c2219e759739f7ee0da567c40ca40a573617c72bbb25e1ed88edb729ed6e07d0
7
+ data.tar.gz: b17bef09a92418ca361767b867d562bc3110865731abf48d18fa185f279750947e57df7a707315bd4de0b1be5a2495d1b3b31121e7dc1149c0b9221b3b3a413e
@@ -12,14 +12,14 @@ jobs:
12
12
  strategy:
13
13
  matrix:
14
14
  ruby:
15
- - '3.2.5'
16
- - '3.3.4'
17
- - jruby-9.4.8.0
15
+ - '3.4.7'
16
+ - '3.3.10'
17
+ - jruby-9.4.14.0
18
18
  solr_version: ['']
19
19
  include:
20
- - ruby: '3.3.4'
20
+ - ruby: '3.4.7'
21
21
  solr_version: '8.11.4'
22
- - ruby: '3.3.4'
22
+ - ruby: '3.4.7'
23
23
  solr_version: '9.6.1'
24
24
  env:
25
25
  SOLR_WRAPPER_SOLR_VERSION: ${{ matrix.solr_version }}
@@ -150,7 +150,9 @@ module SolrWrapper
150
150
  options[:name] ||= SecureRandom.hex
151
151
 
152
152
  create_options = {}
153
- if version >= '9.7'
153
+ if greater_than_solr98?
154
+ create_options[:s] = config.base_url
155
+ elsif greater_than_solr97?
154
156
  create_options[:url] = config.base_url
155
157
  else
156
158
  create_options[:p] = port
@@ -159,12 +161,17 @@ module SolrWrapper
159
161
  create_options[:n] = options[:config_name] if options[:config_name]
160
162
 
161
163
  if options[:dir]
164
+ # Turn a relative path to absolute. Solr 9.7+ changes relative to be
165
+ # relative to solr instance dir (which can be a temp dir for us),
166
+ # instead of command CWD. Normalize to absolute is good for all.
167
+ options[:dir] = File.absolute_path(options[:dir])
168
+
162
169
  # Solr 9.7 required that the dir argument contain a `conf` directory that
163
170
  # contains the actual configuration files.
164
- if version >= '9.7' && !File.exist?(File.join(options[:dir], 'conf'))
165
-
166
- if options[:dir].match?(/conf\/$/)
167
- create_options[:d] = File.expand_path(options[:dir], '..')
171
+ if greater_than_solr97? && !File.exist?(File.join(options[:dir], 'conf'))
172
+ # ends in `conf` or `conf/`
173
+ if options[:dir].match?(/conf\/?$/)
174
+ create_options[:d] = File.expand_path("..", options[:dir])
168
175
  else
169
176
  tmpdir = Dir.mktmpdir
170
177
 
@@ -234,7 +241,9 @@ module SolrWrapper
234
241
  def delete(name, _options = {})
235
242
  delete_options = { c: name }
236
243
 
237
- if version >= '9.7'
244
+ if greater_than_solr98?
245
+ delete_options[:s] = config.base_url
246
+ elsif greater_than_solr97?
238
247
  delete_options[:url] = config.base_url
239
248
  else
240
249
  delete_options[:p] = port
@@ -390,6 +399,18 @@ module SolrWrapper
390
399
  end
391
400
  end
392
401
 
402
+ def greater_than_solr97?
403
+ Gem::Version.new(version) >= Gem::Version.new('9.7.0')
404
+ rescue ArgumentError
405
+ true
406
+ end
407
+
408
+ def greater_than_solr98?
409
+ Gem::Version.new(version) >= Gem::Version.new('9.8.0')
410
+ rescue ArgumentError
411
+ true
412
+ end
413
+
393
414
  def zkhost
394
415
  "#{config.zookeeper_host}:#{config.zookeeper_port}" if config.cloud
395
416
  end
@@ -1,3 +1,3 @@
1
1
  module SolrWrapper
2
- VERSION = '4.1.3'
2
+ VERSION = '4.3.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solr_wrapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.3
4
+ version: 4.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Beer
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2025-03-18 00:00:00.000000000 Z
10
+ date: 2025-11-19 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: faraday
@@ -182,7 +181,6 @@ dependencies:
182
181
  - - ">="
183
182
  - !ruby/object:Gem::Version
184
183
  version: '0'
185
- description:
186
184
  email:
187
185
  - chris@cbeer.info
188
186
  executables:
@@ -235,7 +233,6 @@ homepage: https://github.com/cbeer/solr_wrapper
235
233
  licenses:
236
234
  - MIT
237
235
  metadata: {}
238
- post_install_message:
239
236
  rdoc_options: []
240
237
  require_paths:
241
238
  - lib
@@ -250,8 +247,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
250
247
  - !ruby/object:Gem::Version
251
248
  version: '0'
252
249
  requirements: []
253
- rubygems_version: 3.5.9
254
- signing_key:
250
+ rubygems_version: 3.6.3
255
251
  specification_version: 4
256
252
  summary: Solr service wrapper
257
253
  test_files: