solrb 0.2.7 → 0.2.8
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 +4 -4
- data/.github/workflows/reviewdog.yml +20 -0
- data/.github/workflows/tests.yaml +37 -0
- data/.rubocop.yml +10 -6
- data/lib/solr/cloud/configuration.rb +2 -1
- data/lib/solr/configuration.rb +2 -1
- data/lib/solr/connection.rb +4 -2
- data/lib/solr/query/handler.rb +1 -1
- data/lib/solr/query/http_request_builder.rb +1 -1
- data/lib/solr/request/runner.rb +2 -2
- data/lib/solr/version.rb +1 -1
- data/solrb.gemspec +2 -3
- metadata +17 -32
- data/.circleci/config.yml +0 -69
- data/.circleci/run-with-local-config.sh +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ea33f82de9a9b3bb71a87821df6be65e39e1156704ed713c556752781257012a
|
4
|
+
data.tar.gz: 8b06c57da1f0948858a1ea97c8adc9e318e53f5288549eb80236d1e1c6e54a88
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7b5cd5683b89b389d9d39a8e026a0483a2f9daa6c435a967bc93723150d8fddfc3f804496fece068fb06d9fd2732892fbe9305ca2b3876180f8d8433f270a36
|
7
|
+
data.tar.gz: bf7ca512022d6edbf347c6d0d2697aa90b1d1fc610d6dd8674cc5d78c30ce7e513f463538877857624ae002826e0fa0c3582712c53cd46835c77170a0e960ada
|
@@ -0,0 +1,20 @@
|
|
1
|
+
---
|
2
|
+
name: reviewdog
|
3
|
+
'on': [push]
|
4
|
+
jobs:
|
5
|
+
rubocop:
|
6
|
+
name: runner / rubocop
|
7
|
+
runs-on: ubuntu-latest
|
8
|
+
steps:
|
9
|
+
- uses: actions/checkout@v1
|
10
|
+
- uses: ruby/setup-ruby@v1
|
11
|
+
with:
|
12
|
+
ruby-version: 2.5.1
|
13
|
+
bundler-cache: true
|
14
|
+
- uses: reviewdog/action-rubocop@v1
|
15
|
+
with:
|
16
|
+
github_token: ${{ secrets.GITHUB_TOKEN }}
|
17
|
+
rubocop_version: '0.80.1'
|
18
|
+
rubocop_extensions: ''
|
19
|
+
reporter: github-check
|
20
|
+
fail_on_error: true
|
@@ -0,0 +1,37 @@
|
|
1
|
+
---
|
2
|
+
name: Tests
|
3
|
+
'on': [push]
|
4
|
+
|
5
|
+
env:
|
6
|
+
SOLR_URL: http://localhost:8983/solr/test-core
|
7
|
+
|
8
|
+
jobs:
|
9
|
+
rspec:
|
10
|
+
name: Rspec on Ruby ${{ matrix.ruby }}
|
11
|
+
runs-on: ubuntu-latest
|
12
|
+
strategy:
|
13
|
+
matrix:
|
14
|
+
ruby: ['2.5', '2.6', '2.7', '3.0']
|
15
|
+
services:
|
16
|
+
solr:
|
17
|
+
image: solr:7.4.0
|
18
|
+
ports:
|
19
|
+
- 8983:8983
|
20
|
+
steps:
|
21
|
+
- uses: actions/checkout@v2
|
22
|
+
|
23
|
+
- uses: ruby/setup-ruby@v1
|
24
|
+
with:
|
25
|
+
ruby-version: ${{ matrix.ruby }}
|
26
|
+
bundler-cache: true
|
27
|
+
|
28
|
+
- name: Create a test core
|
29
|
+
run: |
|
30
|
+
curl 'http://localhost:8983/solr/admin/cores?action=CREATE&name=test-core&configSet=_default'
|
31
|
+
|
32
|
+
- name: Disable field type guessing
|
33
|
+
run: |
|
34
|
+
curl http://localhost:8983/solr/test-core/config -d '{"set-user-property": {"update.autoCreateFields":"false"}}'
|
35
|
+
|
36
|
+
- name: Rspec
|
37
|
+
run: bundle exec rspec --format progress
|
data/.rubocop.yml
CHANGED
@@ -1,19 +1,20 @@
|
|
1
1
|
AllCops:
|
2
2
|
Exclude:
|
3
|
-
- db/schema.rb
|
4
|
-
- node_modules/**/*
|
5
3
|
- bin/*
|
4
|
+
- vendor/**/*
|
5
|
+
- pkg/**/*
|
6
6
|
TargetRubyVersion: '2.5'
|
7
|
-
|
7
|
+
DisabledByDefault: true
|
8
|
+
Layout/LineLength:
|
8
9
|
Max: 120
|
9
|
-
Documentation:
|
10
|
+
Style/Documentation:
|
10
11
|
Enabled: false
|
11
|
-
FrozenStringLiteralComment:
|
12
|
+
Style/FrozenStringLiteralComment:
|
12
13
|
Enabled: false
|
13
14
|
Metrics/MethodLength:
|
14
15
|
Max: 20
|
15
16
|
Metrics/AbcSize:
|
16
|
-
|
17
|
+
Enabled: false
|
17
18
|
# Removing Blocks Cop for RSpec
|
18
19
|
Style/BlockDelimiters:
|
19
20
|
Exclude:
|
@@ -28,3 +29,6 @@ Metrics/BlockLength:
|
|
28
29
|
- '**/*.rake'
|
29
30
|
- 'spec/**/*'
|
30
31
|
- 'config/environments/**/*'
|
32
|
+
Layout/SpaceInsideHashLiteralBraces:
|
33
|
+
Exclude:
|
34
|
+
- 'spec/**/*'
|
@@ -18,7 +18,8 @@ module Solr
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def build_zookeeper_connection
|
21
|
-
|
21
|
+
zookeeper_url = zookeeper_url.is_a?(Array) ? zookeeper_url.join(',') : zookeeper_url
|
22
|
+
Solr::Cloud::ZookeeperConnection.new(zookeeper_url: zookeeper_url,
|
22
23
|
zookeeper_auth_user: zookeeper_auth_user,
|
23
24
|
zookeeper_auth_password: zookeeper_auth_password)
|
24
25
|
end
|
data/lib/solr/configuration.rb
CHANGED
@@ -11,7 +11,8 @@ module Solr
|
|
11
11
|
class Configuration
|
12
12
|
extend Forwardable
|
13
13
|
|
14
|
-
delegate [:zookeeper_url, :zookeeper_url=, :zookeeper_auth_user=,
|
14
|
+
delegate [:zookeeper_url, :zookeeper_url=, :zookeeper_auth_user=,
|
15
|
+
:zookeeper_auth_password=] => :@cloud_configuration
|
15
16
|
delegate [:master_url, :master_url=, :slave_url, :slave_url=, :disable_read_from_master,
|
16
17
|
:disable_read_from_master=, :nodes_gray_list, :nodes_gray_list=] => :@master_slave_configuration
|
17
18
|
|
data/lib/solr/connection.rb
CHANGED
@@ -3,9 +3,11 @@ module Solr
|
|
3
3
|
class Connection
|
4
4
|
INSTRUMENT_KEY = 'request.solrb'.freeze
|
5
5
|
|
6
|
-
def initialize(url, faraday_options: Solr.configuration.faraday_options,
|
6
|
+
def initialize(url, faraday_options: Solr.configuration.faraday_options,
|
7
|
+
faraday_configuration: Solr.configuration.faraday_configuration)
|
7
8
|
# Allow mock the connection for testing
|
8
|
-
@raw_connection = Solr.configuration.test_connection
|
9
|
+
@raw_connection = Solr.configuration.test_connection
|
10
|
+
@raw_connection ||= build_faraday_connection(url, faraday_options, faraday_configuration)
|
9
11
|
freeze
|
10
12
|
end
|
11
13
|
|
data/lib/solr/query/handler.rb
CHANGED
data/lib/solr/request/runner.rb
CHANGED
@@ -16,7 +16,7 @@ module Solr
|
|
16
16
|
attr_reader :request, :response_parser, :node_selection_strategy
|
17
17
|
|
18
18
|
def self.call(opts)
|
19
|
-
new(opts).call
|
19
|
+
new(**opts).call
|
20
20
|
end
|
21
21
|
|
22
22
|
def initialize(request:,
|
@@ -39,7 +39,7 @@ module Solr
|
|
39
39
|
solr_response = Solr::Response::Parser.call(raw_response)
|
40
40
|
raise Solr::Errors::SolrQueryError, solr_response.error_message unless solr_response.ok?
|
41
41
|
return solr_response
|
42
|
-
rescue Faraday::ConnectionFailed, Faraday::TimeoutError, Errno::EADDRNOTAVAIL => e
|
42
|
+
rescue Faraday::ConnectionFailed, Faraday::TimeoutError, Errno::EADDRNOTAVAIL, Timeout::Error => e
|
43
43
|
if Solr.master_slave_enabled?
|
44
44
|
Solr.configuration.nodes_gray_list.add(node_url)
|
45
45
|
end
|
data/lib/solr/version.rb
CHANGED
data/solrb.gemspec
CHANGED
@@ -24,12 +24,11 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.add_runtime_dependency 'addressable'
|
25
25
|
spec.add_runtime_dependency 'faraday'
|
26
26
|
|
27
|
-
spec.add_development_dependency 'bundler'
|
27
|
+
spec.add_development_dependency 'bundler'
|
28
28
|
spec.add_development_dependency 'pry'
|
29
29
|
spec.add_development_dependency 'pry-byebug'
|
30
30
|
spec.add_development_dependency 'rake', '~> 10.0'
|
31
31
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
32
|
-
spec.add_development_dependency '
|
33
|
-
spec.add_development_dependency 'rubocop'
|
32
|
+
spec.add_development_dependency 'rubocop', '~> 0.80.1'
|
34
33
|
spec.add_development_dependency 'simplecov'
|
35
34
|
end
|
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solrb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adriano Luz
|
8
8
|
- Valentin Vasilyev
|
9
9
|
- Vladislav Syabruk
|
10
|
-
autorequire:
|
10
|
+
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2021-05-28 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: addressable
|
@@ -44,16 +44,16 @@ dependencies:
|
|
44
44
|
name: bundler
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
|
-
- - "
|
47
|
+
- - ">="
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version: '
|
49
|
+
version: '0'
|
50
50
|
type: :development
|
51
51
|
prerelease: false
|
52
52
|
version_requirements: !ruby/object:Gem::Requirement
|
53
53
|
requirements:
|
54
|
-
- - "
|
54
|
+
- - ">="
|
55
55
|
- !ruby/object:Gem::Version
|
56
|
-
version: '
|
56
|
+
version: '0'
|
57
57
|
- !ruby/object:Gem::Dependency
|
58
58
|
name: pry
|
59
59
|
requirement: !ruby/object:Gem::Requirement
|
@@ -110,34 +110,20 @@ dependencies:
|
|
110
110
|
- - "~>"
|
111
111
|
- !ruby/object:Gem::Version
|
112
112
|
version: '3.0'
|
113
|
-
- !ruby/object:Gem::Dependency
|
114
|
-
name: rspec_junit_formatter
|
115
|
-
requirement: !ruby/object:Gem::Requirement
|
116
|
-
requirements:
|
117
|
-
- - ">="
|
118
|
-
- !ruby/object:Gem::Version
|
119
|
-
version: '0'
|
120
|
-
type: :development
|
121
|
-
prerelease: false
|
122
|
-
version_requirements: !ruby/object:Gem::Requirement
|
123
|
-
requirements:
|
124
|
-
- - ">="
|
125
|
-
- !ruby/object:Gem::Version
|
126
|
-
version: '0'
|
127
113
|
- !ruby/object:Gem::Dependency
|
128
114
|
name: rubocop
|
129
115
|
requirement: !ruby/object:Gem::Requirement
|
130
116
|
requirements:
|
131
|
-
- - "
|
117
|
+
- - "~>"
|
132
118
|
- !ruby/object:Gem::Version
|
133
|
-
version:
|
119
|
+
version: 0.80.1
|
134
120
|
type: :development
|
135
121
|
prerelease: false
|
136
122
|
version_requirements: !ruby/object:Gem::Requirement
|
137
123
|
requirements:
|
138
|
-
- - "
|
124
|
+
- - "~>"
|
139
125
|
- !ruby/object:Gem::Version
|
140
|
-
version:
|
126
|
+
version: 0.80.1
|
141
127
|
- !ruby/object:Gem::Dependency
|
142
128
|
name: simplecov
|
143
129
|
requirement: !ruby/object:Gem::Requirement
|
@@ -152,7 +138,7 @@ dependencies:
|
|
152
138
|
- - ">="
|
153
139
|
- !ruby/object:Gem::Version
|
154
140
|
version: '0'
|
155
|
-
description:
|
141
|
+
description:
|
156
142
|
email:
|
157
143
|
- adriano.luz@machinio.com
|
158
144
|
- valentin@machinio.com
|
@@ -161,8 +147,8 @@ executables: []
|
|
161
147
|
extensions: []
|
162
148
|
extra_rdoc_files: []
|
163
149
|
files:
|
164
|
-
- ".
|
165
|
-
- ".
|
150
|
+
- ".github/workflows/reviewdog.yml"
|
151
|
+
- ".github/workflows/tests.yaml"
|
166
152
|
- ".gitignore"
|
167
153
|
- ".rspec"
|
168
154
|
- ".rubocop.yml"
|
@@ -264,7 +250,7 @@ homepage: https://github.com/machinio/solrb
|
|
264
250
|
licenses:
|
265
251
|
- MIT
|
266
252
|
metadata: {}
|
267
|
-
post_install_message:
|
253
|
+
post_install_message:
|
268
254
|
rdoc_options: []
|
269
255
|
require_paths:
|
270
256
|
- lib
|
@@ -279,9 +265,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
279
265
|
- !ruby/object:Gem::Version
|
280
266
|
version: '0'
|
281
267
|
requirements: []
|
282
|
-
|
283
|
-
|
284
|
-
signing_key:
|
268
|
+
rubygems_version: 3.0.3
|
269
|
+
signing_key:
|
285
270
|
specification_version: 4
|
286
271
|
summary: Solr Ruby client with a nice object-oriented API
|
287
272
|
test_files: []
|
data/.circleci/config.yml
DELETED
@@ -1,69 +0,0 @@
|
|
1
|
-
# Ruby CircleCI 2.0 configuration file
|
2
|
-
#
|
3
|
-
# Check https://circleci.com/docs/2.0/language-ruby/ for more details
|
4
|
-
#
|
5
|
-
version: 2
|
6
|
-
jobs:
|
7
|
-
build:
|
8
|
-
docker:
|
9
|
-
# primary image where all specs are run
|
10
|
-
- image: circleci/ruby:2.5.1-node-browsers
|
11
|
-
environment:
|
12
|
-
SOLR_URL: http://localhost:8983/solr/test-core
|
13
|
-
# service images that primary image will use
|
14
|
-
- image: solr:7.4.0
|
15
|
-
|
16
|
-
working_directory: ~/repo
|
17
|
-
|
18
|
-
steps:
|
19
|
-
- checkout
|
20
|
-
|
21
|
-
# Download and cache dependencies
|
22
|
-
- restore_cache:
|
23
|
-
keys:
|
24
|
-
- v1-dependencies-{{ checksum "Gemfile.lock" }}
|
25
|
-
# fallback to using the latest cache if no exact match is found
|
26
|
-
- v1-dependencies-
|
27
|
-
|
28
|
-
- run:
|
29
|
-
name: install dependencies
|
30
|
-
command: |
|
31
|
-
bundle install --jobs=4 --retry=3 --path vendor/bundle
|
32
|
-
|
33
|
-
- save_cache:
|
34
|
-
paths:
|
35
|
-
- ./vendor/bundle
|
36
|
-
key: v1-dependencies-{{ checksum "Gemfile.lock" }}
|
37
|
-
|
38
|
-
- run:
|
39
|
-
name: Wait for Solr
|
40
|
-
command: dockerize -wait tcp://localhost:8983 -timeout 1m
|
41
|
-
|
42
|
-
- run:
|
43
|
-
name: Create a test core
|
44
|
-
command: curl 'http://localhost:8983/solr/admin/cores?action=CREATE&name=test-core&configSet=_default'
|
45
|
-
|
46
|
-
- run:
|
47
|
-
name: Disable field type guessing
|
48
|
-
command: |
|
49
|
-
curl http://localhost:8983/solr/test-core/config -d '{"set-user-property": {"update.autoCreateFields":"false"}}'
|
50
|
-
|
51
|
-
|
52
|
-
- run:
|
53
|
-
name: run tests
|
54
|
-
command: |
|
55
|
-
mkdir /tmp/test-results
|
56
|
-
TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)"
|
57
|
-
|
58
|
-
bundle exec rspec --format progress \
|
59
|
-
--format RspecJunitFormatter \
|
60
|
-
--out /tmp/test-results/rspec.xml \
|
61
|
-
--format progress \
|
62
|
-
$TEST_FILES
|
63
|
-
|
64
|
-
# collect reports
|
65
|
-
- store_test_results:
|
66
|
-
path: /tmp/test-results
|
67
|
-
- store_artifacts:
|
68
|
-
path: /tmp/test-results
|
69
|
-
destination: test-results
|