solrb 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/solr/configuration.rb +11 -3
- data/lib/solr/version.rb +1 -1
- data/solrb.gemspec +0 -9
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 87bd8f1165b0e0136fb357bf5e2509b0915c3f2c678073dff516bf253a220957
|
4
|
+
data.tar.gz: 40232c3c4fce234048f506a577afecc02cf2663437305db47ee1264385e9d1e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 46d44e093a9f749da0227708d533af8775a28bc36bac522c2693cbcefe78a5627cdc7e0681180f5feab530c68b9941b94569850353ffcb8510dab08608c1372a
|
7
|
+
data.tar.gz: 503dabfa2ff442b73c76f8bffba18f671c3cfd36bbd374877a2c46fd154b199a00c947b0919002cabcab3fdabea53df28efee4f3d4616320658813f7d28161d0
|
data/lib/solr/configuration.rb
CHANGED
@@ -7,17 +7,25 @@ require 'solr/errors/ambiguous_core_error'
|
|
7
7
|
|
8
8
|
module Solr
|
9
9
|
class Configuration
|
10
|
-
|
11
|
-
|
10
|
+
SOLRB_USER_AGENT_HEADER = { user_agent: "Solrb v#{Solr::VERSION}" }.freeze
|
11
|
+
|
12
|
+
attr_accessor :cores, :test_connection
|
13
|
+
attr_reader :url, :faraday_options
|
12
14
|
|
13
15
|
def initialize
|
14
16
|
@faraday_options = {
|
15
17
|
request: { timeout: 2, open_timeout: 8 },
|
16
|
-
headers:
|
18
|
+
headers: SOLRB_USER_AGENT_HEADER
|
17
19
|
}
|
18
20
|
@cores = {}
|
19
21
|
end
|
20
22
|
|
23
|
+
def faraday_options=(options)
|
24
|
+
options[:headers] ||= {}
|
25
|
+
options[:headers].merge!(SOLRB_USER_AGENT_HEADER)
|
26
|
+
@faraday_options = options
|
27
|
+
end
|
28
|
+
|
21
29
|
def url=(value)
|
22
30
|
if value.nil?
|
23
31
|
raise ArgumentError, "Solr's URL can't be nil"
|
data/lib/solr/version.rb
CHANGED
data/solrb.gemspec
CHANGED
@@ -12,15 +12,6 @@ Gem::Specification.new do |spec|
|
|
12
12
|
spec.homepage = 'https://github.com/machinio/solrb'
|
13
13
|
spec.license = 'MIT'
|
14
14
|
|
15
|
-
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
16
|
-
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
17
|
-
# if spec.respond_to?(:metadata)
|
18
|
-
# spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
|
19
|
-
# else
|
20
|
-
# raise 'RubyGems 2.0 or newer is required to protect against ' \
|
21
|
-
# 'public gem pushes.'
|
22
|
-
# end
|
23
|
-
|
24
15
|
# Specify which files should be added to the gem when it is released.
|
25
16
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
26
17
|
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|