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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 030e3ff37721981b2d316720a7c821bab62a3631d875fffbffd7b7a7a1ca2eee
4
- data.tar.gz: fc46f7d4dd1e8d349e0c4c82ef1fbeb2839e4d8f7d6b58d509a0c274548f7e8c
3
+ metadata.gz: 87bd8f1165b0e0136fb357bf5e2509b0915c3f2c678073dff516bf253a220957
4
+ data.tar.gz: 40232c3c4fce234048f506a577afecc02cf2663437305db47ee1264385e9d1e2
5
5
  SHA512:
6
- metadata.gz: 94a8e126c5d60ac4b60fb371c57675a6b5ea12484de73efe9b218bd00b409712b9ae5675f412ab8adca22f3b129cebebd2ac698abc122a6097afb2c264ce9570
7
- data.tar.gz: 10b6e6ae6785940efa6e96b5807bb10314a7d5ea6db24201b1640d47f92671bc4336fb5365f6262d456a8601a6cfacd1f63aaf6e6c8591ef31b42f867f4f2037
6
+ metadata.gz: 46d44e093a9f749da0227708d533af8775a28bc36bac522c2693cbcefe78a5627cdc7e0681180f5feab530c68b9941b94569850353ffcb8510dab08608c1372a
7
+ data.tar.gz: 503dabfa2ff442b73c76f8bffba18f671c3cfd36bbd374877a2c46fd154b199a00c947b0919002cabcab3fdabea53df28efee4f3d4616320658813f7d28161d0
@@ -7,17 +7,25 @@ require 'solr/errors/ambiguous_core_error'
7
7
 
8
8
  module Solr
9
9
  class Configuration
10
- attr_accessor :faraday_options, :cores, :test_connection
11
- attr_reader :url
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: { user_agent: "Solrb v#{Solr::VERSION}" }
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
@@ -1,3 +1,3 @@
1
1
  module Solr
2
- VERSION = '0.1.1'.freeze
2
+ VERSION = '0.1.2'.freeze
3
3
  end
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solrb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adriano Luz