solr_wrapper 3.1.0 → 3.1.3

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: 215848180bd8aaa7ba6b0817f682d6ba2c0debda6bbaec6945ecd4573dd2bba1
4
- data.tar.gz: 3c253198a29f2623d579e9299c68ff31f8895567cf569db35b9c01771386bdd8
3
+ metadata.gz: e135734d52040fa5877fd21ad5149afc55ba8ffbc282a900ba448a9b2b230c28
4
+ data.tar.gz: 5363eb0bcad04e78b36267dbf35aa03a1fec56ee1487023622d3219a54501f87
5
5
  SHA512:
6
- metadata.gz: 7b1e4948fd49eb9ec0d069c71d60057a3ad1636d9eae592707266403b73e4f9bd2f2d3e76e88267f9e8be9a136fa10da529faef256ef846c4847977a11422f4a
7
- data.tar.gz: ef378700ce2e1fbafa6bcf88fec33f0cf11799a89105bede4372660543cce5d82dd20976bc9e231381dc73c36f1f8ede6a4a2712bd5bc02e4146d2d68076dbe2
6
+ metadata.gz: e0c3fca3bc208c4f9d71c6c14fcb0e99094d737e705ac12620c9ba725cc925b004a2dfa9bdb5210b05863df6ff94f4a3282a23b3e8f6aa4e2ef5de60a78eea2a
7
+ data.tar.gz: 3cd79dcfa0e2b3fd26bb1ce499712e09d019ade55799d9fbbdbdc6e832748df4f0bbc54689a5ba73f7e7d122db55751eff6a75bac37f6c41d19e6df55396b760
@@ -14,7 +14,7 @@ jobs:
14
14
  ruby:
15
15
  - 2.7
16
16
  - 3.0
17
- - jruby-9.2.14.0
17
+ - jruby-9.2.20.0
18
18
  steps:
19
19
  - uses: actions/checkout@v2
20
20
  - name: Set up Ruby
data/exe/solr_wrapper CHANGED
@@ -100,7 +100,7 @@ instance = SolrWrapper.instance(options)
100
100
 
101
101
  case command
102
102
  when 'clean'
103
- if instance.started?
103
+ if instance.managed? && instance.started?
104
104
  $stderr.puts "Please stop solr before cleaning"
105
105
  exit 1
106
106
  end
@@ -94,7 +94,7 @@ module SolrWrapper
94
94
  end
95
95
 
96
96
  def closest_mirror_url
97
- "http://www.apache.org/dyn/closer.lua/lucene/solr/#{version}/solr-#{version}.zip?asjson=true"
97
+ "https://www.apache.org/dyn/closer.lua/lucene/solr/#{version}/solr-#{version}.zip?asjson=true"
98
98
  end
99
99
 
100
100
  def mirror_url
@@ -102,7 +102,7 @@ module SolrWrapper
102
102
  options[:mirror_url] + "lucene/solr/#{version}/solr-#{version}.zip"
103
103
  else
104
104
  begin
105
- json = HTTP.get(closest_mirror_url).body
105
+ json = HTTP.follow.get(closest_mirror_url).body
106
106
  doc = JSON.parse(json)
107
107
  url = doc['preferred'] + doc['path_info']
108
108
 
@@ -186,7 +186,7 @@ module SolrWrapper
186
186
  end
187
187
 
188
188
  def fetch_latest_version
189
- response = HTTP.follow.get(options.fetch(:latest_version_url, 'https://solr.apache.org/solr/downloads.html'))
189
+ response = HTTP.follow.get(options.fetch(:latest_version_url, 'https://solr.apache.org/downloads.html'))
190
190
  response.body.to_s[/Solr \d+\.\d+\.\d+/][/\d+\.\d+\.\d+/]
191
191
  end
192
192
  end
@@ -70,7 +70,7 @@ module SolrWrapper
70
70
  # Start Solr and wait for it to become available
71
71
  def start
72
72
  extract_and_configure
73
- if config.managed?
73
+ if managed?
74
74
  exec('start', p: port, c: config.cloud)
75
75
 
76
76
  # Wait for solr to start
@@ -85,7 +85,7 @@ module SolrWrapper
85
85
  ##
86
86
  # Stop Solr and wait for it to finish exiting
87
87
  def stop
88
- if config.managed? && started?
88
+ if managed? && started?
89
89
  exec('stop', p: port)
90
90
  wait
91
91
  end
@@ -94,7 +94,7 @@ module SolrWrapper
94
94
  ##
95
95
  # Stop Solr and wait for it to finish exiting
96
96
  def restart
97
- if config.managed? && started?
97
+ if managed? && started?
98
98
  exec('restart', p: port, c: config.cloud)
99
99
  end
100
100
  end
@@ -102,7 +102,7 @@ module SolrWrapper
102
102
  ##
103
103
  # Check the status of a managed Solr service
104
104
  def status
105
- return true unless config.managed?
105
+ return true unless managed?
106
106
 
107
107
  out = exec('status').read
108
108
  out =~ /running on port #{port}/
@@ -111,7 +111,7 @@ module SolrWrapper
111
111
  end
112
112
 
113
113
  def pid
114
- return unless config.managed?
114
+ return unless managed?
115
115
 
116
116
  @pid ||= begin
117
117
  out = exec('status').read
@@ -286,6 +286,10 @@ module SolrWrapper
286
286
  end
287
287
  # rubocop:enable Lint/RescueException
288
288
 
289
+ def managed?
290
+ config.managed?
291
+ end
292
+
289
293
  protected
290
294
 
291
295
  def extracted?
@@ -1,3 +1,3 @@
1
1
  module SolrWrapper
2
- VERSION = '3.1.0'
2
+ VERSION = '3.1.3'
3
3
  end
data/lib/solr_wrapper.rb CHANGED
@@ -40,7 +40,7 @@ module SolrWrapper
40
40
  ##
41
41
  # Ensures a Solr service is running before executing the block
42
42
  def self.wrap(options = {}, &block)
43
- instance(options).wrap &block
43
+ instance(options).wrap(&block)
44
44
  end
45
45
 
46
46
  class SolrWrapperError < StandardError; end
@@ -75,7 +75,7 @@ describe SolrWrapper::Configuration do
75
75
  let(:options) { { version: 'latest'} }
76
76
 
77
77
  before do
78
- stub_request(:get, 'https://solr.apache.org/solr/downloads.html').to_return(body: 'Solr 1.2.3 is the latest version')
78
+ stub_request(:get, 'https://solr.apache.org/downloads.html').to_return(body: 'Solr 1.2.3 is the latest version')
79
79
  end
80
80
 
81
81
  it 'fetches the latest version number from apache' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solr_wrapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Beer
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-03-03 00:00:00.000000000 Z
11
+ date: 2022-03-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http
@@ -229,7 +229,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
229
229
  - !ruby/object:Gem::Version
230
230
  version: '0'
231
231
  requirements: []
232
- rubygems_version: 3.2.3
232
+ rubygems_version: 3.2.32
233
233
  signing_key:
234
234
  specification_version: 4
235
235
  summary: Solr service wrapper