solr_wrapper 1.2.0 → 3.0.1

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: 69b59fa99bc915577bf48a1ccf9a82fbe1a03abf
4
- data.tar.gz: cd5fe1e6bf5d3e16d784606a52f56dd6e57c56fc
2
+ SHA256:
3
+ metadata.gz: 0d9de92fc1086de22c2b921013556b5711f8cc0528d9593f6837423354092b6e
4
+ data.tar.gz: 73ee6d8078bccd94ad74e0798371e368fb7431936c10ea881d0f04efab17eb5b
5
5
  SHA512:
6
- metadata.gz: 70f274a2cc52e3221338eae2833185f21a0ab295b813b917feaae5e190e684a28ca38846efdef148b1747dba58557be677105a499d1443c3fb8a7bfd3233c79c
7
- data.tar.gz: '08b924bbe6bd57633f53865bd893e9e6a486d9821baccb0d1234011f8648ccc223326f065b5acb64ed8809babbe3daf563d992b2318c7ed3915bf86e10f4b3f3'
6
+ metadata.gz: 3151182a0f0fe8a946f88b6b3c12dcbb09b56e70e3cef875b90db8a9fb11aacf2e2d1b2ae50ce506ffe435b37bf0443a00f308db0cc0a76d3a3e9ecfa83ae03c
7
+ data.tar.gz: 58104ed71e1b5a4cb7da2a77a58cafb87514dc674028ef29cfc9d2faa73b3a75f56a6044e2b1c6da79bd92374ed13aadb93ae53969f2561bb88891a6cef8f846
@@ -0,0 +1,29 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [ master ]
6
+ pull_request:
7
+ branches: [ master ]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ ruby:
15
+ - 2.7
16
+ - 3.0
17
+ - jruby-9.2.14.0
18
+ steps:
19
+ - uses: actions/checkout@v2
20
+ - name: Set up Ruby
21
+ uses: ruby/setup-ruby@v1
22
+ with:
23
+ ruby-version: ${{ matrix.ruby }}
24
+ - name: Install dependencies
25
+ run: bundle install
26
+ - name: Run tests
27
+ run: bundle exec rake
28
+ env:
29
+ ENGINE_CART_RAILS_OPTIONS: '--skip-git --skip-listen --skip-spring --skip-keeps --skip-action-cable --skip-coffee --skip-test'
data/README.md CHANGED
@@ -32,16 +32,17 @@ SolrWrapper.wrap port: 8983,
32
32
  |---------------|-----------------------------------------|
33
33
  | instance_dir | Directory to store the solr index files |
34
34
  | url | URL of the Zip file to download |
35
+ | mirror_url | Mirror to download the solr artifacts from (e.g. http://lib-solr-mirror.princeton.edu/dist/)|
35
36
  | version | Solr version to download and install |
36
37
  | port | port to run Solr on |
37
38
  | version_file | Local path to store the currently installed version |
38
39
  | download_dir | Local path for storing the downloaded Solr zip file |
39
40
  | solr_zip_path | Local path to the Solr zip file |
40
- | md5sum | Path/URL to MD5 checksum |
41
+ | checksum | Path/URL to checksum |
41
42
  | solr_xml | Path to Solr configuration |
42
43
  | verbose | (Boolean) |
43
44
  | managed | (Boolean) |
44
- | ignore_md5sum | (Boolean) |
45
+ | ignore_checksum | (Boolean) |
45
46
  | solr_options | (Hash) |
46
47
  | env | (Hash) |
47
48
  | persist | (Boolean) Preserves the data in you collection between startups |
@@ -66,7 +67,7 @@ By default, it looks for configuration files at `.solr_wrapper` and `~/.solr_wra
66
67
 
67
68
  You can also specify a configuration file when launching from the command line as follows:
68
69
  ```
69
- $ solr_wrapper -config <path_to_config_file>
70
+ $ solr_wrapper --config <path_to_config_file>
70
71
  ```
71
72
 
72
73
  ### Cleaning your repository from the command line
@@ -64,7 +64,7 @@ args = OptionParser.new do |opts|
64
64
  end
65
65
 
66
66
  opts.on("--no-checksum", "Skip running checksum validation on the downloaded file") do |d|
67
- options[:ignore_md5sum] = true
67
+ options[:ignore_checksum] = true
68
68
  end
69
69
 
70
70
  opts.separator ""
@@ -1,7 +1,7 @@
1
1
  require 'solr_wrapper/version'
2
2
  require 'solr_wrapper/configuration'
3
3
  require 'solr_wrapper/settings'
4
- require 'solr_wrapper/md5'
4
+ require 'solr_wrapper/checksum_validator'
5
5
  require 'solr_wrapper/downloader'
6
6
  require 'solr_wrapper/instance'
7
7
  require 'solr_wrapper/client'
@@ -0,0 +1,62 @@
1
+ module SolrWrapper
2
+ class ChecksumValidator
3
+ attr_reader :config
4
+
5
+ def initialize(config)
6
+ @config = config
7
+ end
8
+
9
+ def clean!
10
+ path = checksum_path(algorithm)
11
+ FileUtils.remove_entry(path) if File.exist? path
12
+ end
13
+
14
+ def validate?(file)
15
+ return true if config.validate == false
16
+ Digest.const_get(algorithm.upcase).file(file).hexdigest == expected_sum(algorithm)
17
+ end
18
+
19
+ def validate!(file)
20
+ unless validate? file
21
+ raise "Checksum mismatch" unless config.ignore_checksum
22
+ end
23
+ end
24
+
25
+ private
26
+
27
+ def checksumurl(suffix)
28
+ if config.default_download_url == config.static_config.archive_download_url
29
+ "#{config.default_download_url}.#{suffix}"
30
+ else
31
+ "http://www.us.apache.org/dist/lucene/solr/#{config.static_config.version}/solr-#{config.static_config.version}.zip.#{suffix}"
32
+ end
33
+ end
34
+
35
+ def checksum_path(suffix)
36
+ File.join(config.download_dir, File.basename(checksumurl(suffix)))
37
+ end
38
+
39
+ def expected_sum(alg)
40
+ config.checksum || read_file(alg)
41
+ end
42
+
43
+ def read_file(alg)
44
+ open(checksumfile(alg)).read.split(" ").first
45
+ end
46
+
47
+ def checksumfile(alg)
48
+ path = checksum_path(alg)
49
+ unless File.exist? path
50
+ Downloader.fetch_with_progressbar checksumurl(alg), path
51
+ end
52
+ path
53
+ end
54
+
55
+ def algorithm
56
+ return config.static_config.algorithm if config.static_config.algorithm
57
+ return 'sha1' if config.static_config.version =~ /^[1-6]/ || config.static_config.version =~ /^[7]\.[0-4]/
58
+
59
+ 'sha512'
60
+ end
61
+ end
62
+ end
@@ -1,4 +1,4 @@
1
- require 'faraday'
1
+ require 'http'
2
2
  require 'json'
3
3
 
4
4
  module SolrWrapper
@@ -18,19 +18,16 @@ module SolrWrapper
18
18
  private
19
19
 
20
20
  def collection?(name)
21
- response = conn.get('admin/collections?action=LIST&wt=json')
21
+ response = HTTP.get("#{url}admin/collections?action=LIST&wt=json")
22
22
  data = JSON.parse(response.body)
23
23
  return if data['error'] && data['error']['msg'] == 'Solr instance is not running in SolrCloud mode.'
24
+
24
25
  data['collections'].include? name
25
26
  end
26
27
 
27
28
  def core?(name)
28
- response = conn.get('admin/cores?action=STATUS&wt=json&core=' + name)
29
+ response = HTTP.get("#{url}admin/cores?action=STATUS&wt=json&core=#{name}")
29
30
  !JSON.parse(response.body)['status'][name].empty?
30
31
  end
31
-
32
- def conn
33
- @conn ||= Faraday.new(url: url)
34
- end
35
32
  end
36
33
  end
@@ -1,4 +1,4 @@
1
- require 'faraday'
1
+ require 'http'
2
2
 
3
3
  module SolrWrapper
4
4
  class Configuration
@@ -23,12 +23,16 @@ module SolrWrapper
23
23
  options[:validate]
24
24
  end
25
25
 
26
- def ignore_md5sum
27
- options[:ignore_md5sum]
26
+ def ignore_checksum
27
+ options[:ignore_checksum]
28
28
  end
29
29
 
30
- def md5sum
31
- options[:md5sum]
30
+ def checksum
31
+ options[:checksum]
32
+ end
33
+
34
+ def algorithm
35
+ options[:algorithm]
32
36
  end
33
37
 
34
38
  def url
@@ -89,10 +93,36 @@ module SolrWrapper
89
93
  end
90
94
  end
91
95
 
92
- def mirror_url
96
+ def closest_mirror_url
93
97
  "http://www.apache.org/dyn/closer.lua/lucene/solr/#{version}/solr-#{version}.zip?asjson=true"
94
98
  end
95
99
 
100
+ def mirror_url
101
+ @mirror_url ||= if options[:mirror_url]
102
+ options[:mirror_url] + "lucene/solr/#{version}/solr-#{version}.zip"
103
+ else
104
+ begin
105
+ json = HTTP.get(closest_mirror_url).body
106
+ doc = JSON.parse(json)
107
+ url = doc['preferred'] + doc['path_info']
108
+
109
+ response = HTTP.head(url)
110
+
111
+ if response.status.success?
112
+ url
113
+ else
114
+ archive_download_url
115
+ end
116
+ rescue Errno::ECONNRESET, SocketError, HTTP::Error
117
+ archive_download_url
118
+ end
119
+ end
120
+ end
121
+
122
+ def archive_download_url
123
+ "https://archive.apache.org/dist/lucene/solr/#{version}/solr-#{version}.zip"
124
+ end
125
+
96
126
  def cloud
97
127
  options[:cloud]
98
128
  end
@@ -156,8 +186,8 @@ module SolrWrapper
156
186
  end
157
187
 
158
188
  def fetch_latest_version
159
- response = Faraday.get('https://lucene.apache.org/latestversion.html')
160
- response.body[/Apache Solr \d+\.\d+\.\d+/][/\d+\.\d+\.\d+/]
189
+ response = HTTP.get(options.fetch(:latest_version_url, 'https://lucene.apache.org/solr/downloads.html'))
190
+ response.body.to_s[/Solr \d+\.\d+\.\d+/][/\d+\.\d+\.\d+/]
161
191
  end
162
192
  end
163
193
  end
@@ -1,24 +1,34 @@
1
1
  require 'ruby-progressbar'
2
+ require 'http'
2
3
 
3
4
  module SolrWrapper
4
5
  class Downloader
5
6
  def self.fetch_with_progressbar(url, output)
6
7
  pbar = SafeProgressBar.new(title: File.basename(url), total: nil, format: '%t: |%B| %p%% (%e )')
7
- open(url, content_length_proc: ->(bytes) { pbar.total = bytes }, progress_proc: ->(bytes) { pbar.progress = bytes }) do |io|
8
- IO.copy_stream(io, output)
8
+
9
+ response = HTTP.follow.get(url)
10
+ pbar.total = response.headers['content-length'].to_i
11
+
12
+ File.open(output, 'wb') do |f|
13
+ response.body.each do |chunk|
14
+ f.write(chunk)
15
+ pbar.progress += chunk.length
16
+ end
17
+
18
+ nil
9
19
  end
10
- rescue OpenURI::HTTPError => e
11
- raise SolrWrapperError, "Unable to download solr from #{url}\n#{e.message}: #{e.io.read}"
20
+ rescue HTTP::Error => e
21
+ raise SolrWrapperError, "Unable to download solr from #{url}\n#{e}"
12
22
  end
13
23
 
14
24
  class SafeProgressBar < ProgressBar::Base
15
25
  def progress=(new_progress)
16
- self.total = new_progress if total <= new_progress
26
+ self.total = new_progress if total.to_i <= new_progress
17
27
  super
18
28
  end
19
29
 
20
30
  def total=(new_total)
21
- super if new_total && new_total > 0
31
+ super if new_total && new_total >= 0
22
32
  end
23
33
  end
24
34
  end
@@ -13,7 +13,7 @@ require 'retriable'
13
13
 
14
14
  module SolrWrapper
15
15
  class Instance
16
- attr_reader :config, :md5
16
+ attr_reader :config
17
17
 
18
18
  ##
19
19
  # @param [Hash] options
@@ -23,20 +23,19 @@ module SolrWrapper
23
23
  # @option options [String] :port port to run Solr on
24
24
  # @option options [Boolean] :cloud Run solr in cloud mode
25
25
  # @option options [String] :version_file Local path to store the currently installed version
26
- # @option options [String] :download_dir Local directory to store the downloaded Solr zip and its md5 file in (overridden by :solr_zip_path)
26
+ # @option options [String] :download_dir Local directory to store the downloaded Solr zip and its checksum file in (overridden by :solr_zip_path)
27
27
  # @option options [String] :solr_zip_path Local path for storing the downloaded Solr zip file
28
- # @option options [Boolean] :validate Should solr_wrapper download a new md5 and (re-)validate the zip file? (default: trueF)
29
- # @option options [String] :md5sum Path/URL to MD5 checksum
28
+ # @option options [Boolean] :validate Should solr_wrapper download a new checksum and (re-)validate the zip file? (default: trueF)
29
+ # @option options [String] :checksum Path/URL to checksum
30
30
  # @option options [String] :solr_xml Path to Solr configuration
31
31
  # @option options [String] :extra_lib_dir Path to directory containing extra libraries to copy into instance_dir/lib
32
32
  # @option options [Boolean] :verbose return verbose info when running solr commands
33
- # @option options [Boolean] :ignore_md5sum
33
+ # @option options [Boolean] :ignore_checksum
34
34
  # @option options [Hash] :solr_options
35
35
  # @option options [Hash] :env
36
36
  # @option options [String] :config
37
37
  def initialize(options = {})
38
38
  @config = Settings.new(Configuration.new(options))
39
- @md5 = MD5.new(@config)
40
39
  end
41
40
 
42
41
  def host
@@ -228,7 +227,7 @@ module SolrWrapper
228
227
  remove_instance_dir!
229
228
  FileUtils.remove_entry(config.download_dir, true) if File.exist?(config.download_dir)
230
229
  FileUtils.remove_entry(config.tmp_save_dir, true) if File.exist? config.tmp_save_dir
231
- md5.clean!
230
+ checksum_validator.clean!
232
231
  FileUtils.remove_entry(config.version_file) if File.exist? config.version_file
233
232
  end
234
233
 
@@ -294,9 +293,9 @@ module SolrWrapper
294
293
  end
295
294
 
296
295
  def download
297
- unless File.exist?(config.solr_zip_path) && md5.validate?(config.solr_zip_path)
296
+ unless File.exist?(config.solr_zip_path) && checksum_validator.validate?(config.solr_zip_path)
298
297
  Downloader.fetch_with_progressbar config.download_url, config.solr_zip_path
299
- md5.validate! config.solr_zip_path
298
+ checksum_validator.validate! config.solr_zip_path
300
299
  end
301
300
  config.solr_zip_path
302
301
  end
@@ -319,7 +318,7 @@ module SolrWrapper
319
318
  exit_status = runner.run(stringio)
320
319
 
321
320
  if exit_status != 0 && cmd != 'status'
322
- raise "Failed to execute solr #{cmd}: #{stringio.read}. Further information may be available in #{instance_dir}/logs"
321
+ raise "Failed to execute solr #{cmd}: #{stringio.read}. Further information may be available in #{instance_dir}/server/logs"
323
322
  end
324
323
 
325
324
  stringio
@@ -327,6 +326,10 @@ module SolrWrapper
327
326
 
328
327
  private
329
328
 
329
+ def checksum_validator
330
+ @checksum_validator ||= ChecksumValidator.new(config)
331
+ end
332
+
330
333
  def after_start
331
334
  create_configsets if config.cloud
332
335
  end
@@ -1,5 +1,4 @@
1
1
  require 'delegate'
2
- require 'faraday'
3
2
 
4
3
  module SolrWrapper
5
4
  # Configuraton that comes from static and dynamic sources.
@@ -43,7 +42,6 @@ module SolrWrapper
43
42
  @zookeeper_port ||= "#{port.to_i + 1000}"
44
43
  end
45
44
 
46
-
47
45
  ##
48
46
  # Get a (likely) URL to the solr instance
49
47
  def url
@@ -73,18 +71,6 @@ module SolrWrapper
73
71
  static_config.version_file || File.join(instance_dir, "VERSION")
74
72
  end
75
73
 
76
- def md5url
77
- if default_download_url == archive_download_url
78
- "#{archive_download_url}.md5"
79
- else
80
- "http://www.us.apache.org/dist/lucene/solr/#{static_config.version}/solr-#{static_config.version}.zip.md5"
81
- end
82
- end
83
-
84
- def md5sum_path
85
- File.join(download_dir, File.basename(md5url))
86
- end
87
-
88
74
  def solr_binary
89
75
  File.join(instance_dir, "bin", "solr")
90
76
  end
@@ -93,6 +79,10 @@ module SolrWrapper
93
79
  @tmp_save_dir ||= Dir.mktmpdir
94
80
  end
95
81
 
82
+ def default_download_url
83
+ static_config.mirror_url
84
+ end
85
+
96
86
  private
97
87
 
98
88
  def tmpdir
@@ -113,28 +103,6 @@ module SolrWrapper
113
103
  @download_dir
114
104
  end
115
105
 
116
- def default_download_url
117
- @default_url ||= begin
118
- json = open(static_config.mirror_url).read
119
- doc = JSON.parse(json)
120
- url = doc['preferred'] + doc['path_info']
121
-
122
- response = Faraday.head(url)
123
-
124
- if response.success?
125
- url
126
- else
127
- archive_download_url
128
- end
129
- end
130
- rescue Errno::ECONNRESET, SocketError, Faraday::Error
131
- archive_download_url
132
- end
133
-
134
- def archive_download_url
135
- "https://archive.apache.org/dist/lucene/solr/#{static_config.version}/solr-#{static_config.version}.zip"
136
- end
137
-
138
106
  def random_open_port
139
107
  socket = Socket.new(:INET, :STREAM, 0)
140
108
  begin
@@ -1,3 +1,3 @@
1
1
  module SolrWrapper
2
- VERSION = '1.2.0'
2
+ VERSION = '3.0.1'
3
3
  end
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
8
8
  spec.version = SolrWrapper::VERSION
9
9
  spec.authors = ["Chris Beer"]
10
10
  spec.email = ["chris@cbeer.info"]
11
- spec.summary = %q{Solr 5 service wrapper}
11
+ spec.summary = %q{Solr service wrapper}
12
12
  spec.homepage = "https://github.com/cbeer/solr_wrapper"
13
13
  spec.license = "MIT"
14
14
 
@@ -18,16 +18,16 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_dependency "faraday"
21
+ spec.add_dependency "http"
22
22
  spec.add_dependency "rubyzip"
23
23
  spec.add_dependency "ruby-progressbar"
24
24
  spec.add_dependency "retriable"
25
25
 
26
- spec.add_development_dependency "bundler", "~> 1.7"
27
- spec.add_development_dependency "rake", "~> 10.0"
26
+ spec.add_development_dependency "bundler", ">= 1.7", "< 3"
27
+ spec.add_development_dependency "rake", "~> 10.0", "< 13"
28
28
 
29
29
  spec.add_development_dependency "rspec"
30
- spec.add_development_dependency "simple_solr_client"
30
+ spec.add_development_dependency "simple_solr_client", "= 0.2.0" # 0.2.1 removed support for schema retrieval
31
31
  spec.add_development_dependency "coveralls"
32
32
  spec.add_development_dependency "webmock"
33
33
  end
@@ -75,12 +75,34 @@ describe SolrWrapper::Configuration do
75
75
  let(:options) { { version: 'latest'} }
76
76
 
77
77
  before do
78
- stub_request(:get, 'https://lucene.apache.org/latestversion.html').to_return(body: 'Apache Solr 1.2.3')
78
+ stub_request(:get, 'https://lucene.apache.org/solr/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
82
82
  expect(config.version).to eq '1.2.3'
83
83
  end
84
84
  end
85
+
86
+ context 'when it is "latest" and the latest url is configured' do
87
+ let(:options) { { version: 'latest', latest_version_url: 'https://example.com/latest.html'} }
88
+
89
+ before do
90
+ stub_request(:get, 'https://example.com/latest.html').to_return(body: 'Solr 1.2.1')
91
+ end
92
+
93
+ it 'fetches the latest version number from apache' do
94
+ expect(config.version).to eq '1.2.1'
95
+ end
96
+ end
97
+ end
98
+
99
+ describe '#mirror_url' do
100
+ context 'with a preferred mirror' do
101
+ let(:options) { { mirror_url: 'http://lib-solr-mirror.princeton.edu/dist/', version: '7.2.1' } }
102
+
103
+ it 'is the URL to the artifact on the preferred mirror' do
104
+ expect(config.mirror_url).to eq 'http://lib-solr-mirror.princeton.edu/dist/lucene/solr/7.2.1/solr-7.2.1.zip'
105
+ end
106
+ end
85
107
  end
86
108
  end
@@ -1,6 +1,15 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe SolrWrapper::Instance do
4
+ # WebMock messes with HTTP.rbs ability to stream responses
5
+ before(:all) do
6
+ WebMock.disable!
7
+ end
8
+
9
+ after(:all) do
10
+ WebMock.enable!
11
+ end
12
+
4
13
  let(:options) { {} }
5
14
  let(:solr_instance) { SolrWrapper::Instance.new(options) }
6
15
  subject { solr_instance }
@@ -83,7 +92,8 @@ describe SolrWrapper::Instance do
83
92
  solr.downconfig name: config_name, dir: dir
84
93
  end
85
94
  solr.with_collection(config_name: config_name) do |collection_name|
86
- core = client.core(collection_name)
95
+ core_name = client.cores.select { |x| x =~ /^#{collection_name}/ }.first
96
+ core = client.core(core_name)
87
97
  unless defined? JRUBY_VERSION
88
98
  expect(core.all.size).to eq 0
89
99
  end
@@ -159,8 +169,8 @@ describe SolrWrapper::Instance do
159
169
  it { is_expected.to eq 'solr-version-number' }
160
170
  end
161
171
 
162
- describe "#md5" do
163
- subject { solr_instance.md5 }
164
- it { is_expected.to be_instance_of SolrWrapper::MD5 }
172
+ describe "#checksum_validator" do
173
+ subject { solr_instance.send(:checksum_validator) }
174
+ it { is_expected.to be_instance_of SolrWrapper::ChecksumValidator }
165
175
  end
166
176
  end
@@ -1,6 +1,15 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe SolrWrapper do
4
+ # WebMock messes with HTTP.rbs ability to stream responses
5
+ before(:all) do
6
+ WebMock.disable!
7
+ end
8
+
9
+ after(:all) do
10
+ WebMock.enable!
11
+ end
12
+
4
13
  describe ".wrap" do
5
14
  it "should launch solr" do
6
15
  SolrWrapper.wrap do |solr|
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solr_wrapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Beer
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-11-14 00:00:00.000000000 Z
11
+ date: 2021-01-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: faraday
14
+ name: http
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="
@@ -70,16 +70,22 @@ dependencies:
70
70
  name: bundler
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '1.7'
76
+ - - "<"
77
+ - !ruby/object:Gem::Version
78
+ version: '3'
76
79
  type: :development
77
80
  prerelease: false
78
81
  version_requirements: !ruby/object:Gem::Requirement
79
82
  requirements:
80
- - - "~>"
83
+ - - ">="
81
84
  - !ruby/object:Gem::Version
82
85
  version: '1.7'
86
+ - - "<"
87
+ - !ruby/object:Gem::Version
88
+ version: '3'
83
89
  - !ruby/object:Gem::Dependency
84
90
  name: rake
85
91
  requirement: !ruby/object:Gem::Requirement
@@ -87,6 +93,9 @@ dependencies:
87
93
  - - "~>"
88
94
  - !ruby/object:Gem::Version
89
95
  version: '10.0'
96
+ - - "<"
97
+ - !ruby/object:Gem::Version
98
+ version: '13'
90
99
  type: :development
91
100
  prerelease: false
92
101
  version_requirements: !ruby/object:Gem::Requirement
@@ -94,6 +103,9 @@ dependencies:
94
103
  - - "~>"
95
104
  - !ruby/object:Gem::Version
96
105
  version: '10.0'
106
+ - - "<"
107
+ - !ruby/object:Gem::Version
108
+ version: '13'
97
109
  - !ruby/object:Gem::Dependency
98
110
  name: rspec
99
111
  requirement: !ruby/object:Gem::Requirement
@@ -112,16 +124,16 @@ dependencies:
112
124
  name: simple_solr_client
113
125
  requirement: !ruby/object:Gem::Requirement
114
126
  requirements:
115
- - - ">="
127
+ - - '='
116
128
  - !ruby/object:Gem::Version
117
- version: '0'
129
+ version: 0.2.0
118
130
  type: :development
119
131
  prerelease: false
120
132
  version_requirements: !ruby/object:Gem::Requirement
121
133
  requirements:
122
- - - ">="
134
+ - - '='
123
135
  - !ruby/object:Gem::Version
124
- version: '0'
136
+ version: 0.2.0
125
137
  - !ruby/object:Gem::Dependency
126
138
  name: coveralls
127
139
  requirement: !ruby/object:Gem::Requirement
@@ -150,7 +162,7 @@ dependencies:
150
162
  - - ">="
151
163
  - !ruby/object:Gem::Version
152
164
  version: '0'
153
- description:
165
+ description:
154
166
  email:
155
167
  - chris@cbeer.info
156
168
  executables:
@@ -158,24 +170,23 @@ executables:
158
170
  extensions: []
159
171
  extra_rdoc_files: []
160
172
  files:
173
+ - ".github/workflows/ci.yml"
161
174
  - ".gitignore"
162
175
  - ".hound.yml"
163
176
  - ".rspec"
164
177
  - ".rubocop.yml"
165
178
  - ".rubocop_todo.yml"
166
- - ".travis.yml"
167
179
  - Gemfile
168
180
  - LICENSE
169
181
  - README.md
170
182
  - Rakefile
171
- - coveralls.yml
172
183
  - exe/solr_wrapper
173
184
  - lib/solr_wrapper.rb
185
+ - lib/solr_wrapper/checksum_validator.rb
174
186
  - lib/solr_wrapper/client.rb
175
187
  - lib/solr_wrapper/configuration.rb
176
188
  - lib/solr_wrapper/downloader.rb
177
189
  - lib/solr_wrapper/instance.rb
178
- - lib/solr_wrapper/md5.rb
179
190
  - lib/solr_wrapper/popen4_runner.rb
180
191
  - lib/solr_wrapper/popen_runner.rb
181
192
  - lib/solr_wrapper/rake_task.rb
@@ -203,7 +214,7 @@ homepage: https://github.com/cbeer/solr_wrapper
203
214
  licenses:
204
215
  - MIT
205
216
  metadata: {}
206
- post_install_message:
217
+ post_install_message:
207
218
  rdoc_options: []
208
219
  require_paths:
209
220
  - lib
@@ -218,11 +229,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
218
229
  - !ruby/object:Gem::Version
219
230
  version: '0'
220
231
  requirements: []
221
- rubyforge_project:
222
- rubygems_version: 2.6.11
223
- signing_key:
232
+ rubygems_version: 3.2.3
233
+ signing_key:
224
234
  specification_version: 4
225
- summary: Solr 5 service wrapper
235
+ summary: Solr service wrapper
226
236
  test_files:
227
237
  - spec/fixtures/another_sample_config.yml
228
238
  - spec/fixtures/basic_configs/_rest_managed.json
@@ -1,13 +0,0 @@
1
- language: ruby
2
- sudo: false
3
- rvm:
4
- - 2.4.1
5
- - 2.3.4
6
- - jruby-9.1.8.0
7
-
8
- jdk:
9
- - oraclejdk8
10
-
11
- env:
12
- global:
13
- JRUBY_OPTS=-J-Xmx2g
@@ -1 +0,0 @@
1
- service_name: travis-ci
@@ -1,43 +0,0 @@
1
- module SolrWrapper
2
- class MD5
3
- attr_reader :config
4
- def initialize(config)
5
- @config = config
6
- end
7
-
8
- def clean!
9
- FileUtils.remove_entry(config.md5sum_path) if File.exist? config.md5sum_path
10
- end
11
-
12
- def validate?(file)
13
- return true if config.validate == false
14
-
15
- Digest::MD5.file(file).hexdigest == expected_sum
16
- end
17
-
18
- def validate!(file)
19
- unless validate? file
20
- raise "MD5 mismatch" unless config.ignore_md5sum
21
- end
22
- end
23
-
24
- private
25
-
26
- def expected_sum
27
- @md5sum ||= config.md5sum
28
- @md5sum ||= read_file
29
- end
30
-
31
- def read_file
32
- open(md5file).read.split(" ").first
33
- end
34
-
35
- def md5file
36
- unless File.exist? config.md5sum_path
37
- Downloader.fetch_with_progressbar config.md5url, config.md5sum_path
38
- end
39
-
40
- config.md5sum_path
41
- end
42
- end
43
- end