solr_wrapper 2.0.0 → 2.1.0
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 58da2cf39d47b880c7b1b3adbf446cb9e5d3dece
|
4
|
+
data.tar.gz: c1603b745a74afc2ab39a9ac8fd48954a17c51e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 15233b1419a26bb1914d1826e4f5dcf46044c50a48a0d5693b05af257e7163bca147253ee4c9ee7565afbeec9b65a7d5e22790fddd41e1d01b09f00e8673c8a3
|
7
|
+
data.tar.gz: 9bd88c7b5fffb1f84ef5024cab91be4daf30732e30345fbec3eb7597f2048e233bcac6d5933c7122923b79020890b9f6f81ba59db2b0d2d76a862816f28fa7b3
|
@@ -2,20 +2,18 @@ module SolrWrapper
|
|
2
2
|
class ChecksumValidator
|
3
3
|
attr_reader :config
|
4
4
|
|
5
|
-
ALGORITHM = 'sha1'
|
6
|
-
|
7
5
|
def initialize(config)
|
8
6
|
@config = config
|
9
7
|
end
|
10
8
|
|
11
9
|
def clean!
|
12
|
-
path = checksum_path(
|
10
|
+
path = checksum_path(algorithm)
|
13
11
|
FileUtils.remove_entry(path) if File.exist? path
|
14
12
|
end
|
15
13
|
|
16
14
|
def validate?(file)
|
17
15
|
return true if config.validate == false
|
18
|
-
Digest.const_get(
|
16
|
+
Digest.const_get(algorithm.upcase).file(file).hexdigest == expected_sum(algorithm)
|
19
17
|
end
|
20
18
|
|
21
19
|
def validate!(file)
|
@@ -53,5 +51,12 @@ module SolrWrapper
|
|
53
51
|
end
|
54
52
|
path
|
55
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
|
56
61
|
end
|
57
62
|
end
|
data/lib/solr_wrapper/version.rb
CHANGED
@@ -83,7 +83,8 @@ describe SolrWrapper::Instance do
|
|
83
83
|
solr.downconfig name: config_name, dir: dir
|
84
84
|
end
|
85
85
|
solr.with_collection(config_name: config_name) do |collection_name|
|
86
|
-
|
86
|
+
core_name = client.cores.select { |x| x =~ /^#{collection_name}/ }.first
|
87
|
+
core = client.core(core_name)
|
87
88
|
unless defined? JRUBY_VERSION
|
88
89
|
expect(core.all.size).to eq 0
|
89
90
|
end
|
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: 2.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Beer
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-12-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|