rsolr 1.0.12 → 1.0.13

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a71555285360893206f2b56d3d2b929633d80644
4
- data.tar.gz: b4eb6f363d662aa82a6390ecb860a41c84401925
3
+ metadata.gz: 6e3ceb8a3a7f0e613a2ec1ea63e74f65c6a7f4f8
4
+ data.tar.gz: 0043fbd129fb4ea74585184df9efb71543689eb7
5
5
  SHA512:
6
- metadata.gz: 58bfa89eaf1764f2d6964457aa5be9a56366e31a60ab36af5e84f85080e9574cfc5fe76f2348bf55c980e47806535bea36d317ddaa010b788a1d41c8f30bbb9c
7
- data.tar.gz: 683e472b2e88c3afc76b56f1e3f7085343a810ba911a78b4eaaa4570df8b4d05076d859d09af9732f1dfcca00cc66c0a9c54571d8290fb2d15d922c3a157a207
6
+ metadata.gz: 91eed5ff5587efe17f84b90c1c5cc962a2a4fddda1824002d91a3d8a08ce0eca0123352a736f7f6ab0b119afc54c1705038f886f5e7fbaadbfc02c02f18bfddc
7
+ data.tar.gz: 403a89708dc1ef43fdd2e7b9b776695f766986aae39c6b9a0ca16a6e4c0f3ce65eb2c60f5f815a0d748439d1cf0d107cc5ab81828cf3992b7153e73761afecb5
@@ -6,7 +6,7 @@ module RSolr::Char
6
6
  # that isn't a word character
7
7
  # @deprecated - this is incorrect Solr escaping
8
8
  def escape value
9
- warn "[DEPRECATION] `RSolr.escape` is deprecated (and incorrect). Use `Rsolr.solr_escape` instead."
9
+ warn "[DEPRECATION] `RSolr.escape` is deprecated (and incorrect). Use `RSolr.solr_escape` instead."
10
10
  value.gsub(/(\W)/, '\\\\\1')
11
11
  end
12
12
 
@@ -21,4 +21,4 @@ module RSolr::Char
21
21
  # }.join(delim)
22
22
  # end
23
23
 
24
- end
24
+ end
@@ -289,7 +289,7 @@ class RSolr::Client
289
289
  response[:body]
290
290
  end
291
291
 
292
- if result.is_a?(Hash)
292
+ if result.is_a?(Hash) || request[:method] == :head
293
293
  result = RSolr::HashWithResponse.new(request, response, result)
294
294
  end
295
295
 
@@ -326,7 +326,7 @@ class RSolr::Client
326
326
  return response[:body] unless defined? JSON
327
327
 
328
328
  begin
329
- JSON.parse response[:body].to_s, :symbolize_names => true
329
+ JSON.parse response[:body].to_s
330
330
  rescue JSON::ParserError
331
331
  raise RSolr::Error::InvalidJsonResponse.new request, response
332
332
  end
@@ -90,6 +90,6 @@ class RSolr::HashWithResponse < Hash
90
90
 
91
91
  def initialize(request, response, result)
92
92
  super()
93
- initialize_rsolr_response(request, response, result)
93
+ initialize_rsolr_response(request, response, result || {})
94
94
  end
95
95
  end
@@ -1,5 +1,5 @@
1
1
  module RSolr
2
- VERSION = "1.0.12"
2
+ VERSION = "1.0.13"
3
3
 
4
4
  def self.version
5
5
  VERSION
@@ -201,28 +201,33 @@ describe "RSolr::Client" do
201
201
  context "adapt_response" do
202
202
  include ClientHelper
203
203
  it 'should not try to evaluate ruby when the :qt is not :ruby' do
204
- body = '{:time=>"NOW"}'
204
+ body = '{"time"=>"NOW"}'
205
205
  result = client.adapt_response({:params=>{}}, {:status => 200, :body => body, :headers => {}})
206
206
  expect(result).to eq(body)
207
207
  end
208
208
 
209
209
  it 'should evaluate ruby responses when the :wt is :ruby' do
210
- body = '{:time=>"NOW"}'
210
+ body = '{"time"=>"NOW"}'
211
211
  result = client.adapt_response({:params=>{:wt=>:ruby}}, {:status => 200, :body => body, :headers => {}})
212
- expect(result).to eq({:time=>"NOW"})
212
+ expect(result).to eq({"time"=>"NOW"})
213
213
  end
214
214
 
215
215
  it 'should evaluate json responses when the :wt is :json' do
216
216
  body = '{"time": "NOW"}'
217
217
  result = client.adapt_response({:params=>{:wt=>:json}}, {:status => 200, :body => body, :headers => {}})
218
218
  if defined? JSON
219
- expect(result).to eq({:time=>"NOW"})
219
+ expect(result).to eq({"time"=>"NOW"})
220
220
  else
221
221
  # ruby 1.8 without the JSON gem
222
222
  expect(result).to eq('{"time": "NOW"}')
223
223
  end
224
224
  end
225
225
 
226
+ it 'should return a response for a head request' do
227
+ result = client.adapt_response({:method=>:head,:params=>{}}, {:status => 200, :body => nil, :headers => {}})
228
+ expect(result.response[:status]).to eq 200
229
+ end
230
+
226
231
  it "ought raise a RSolr::Error::InvalidRubyResponse when the ruby is indeed frugged, or even fruggified" do
227
232
  expect {
228
233
  client.adapt_response({:params=>{:wt => :ruby}}, {:status => 200, :body => "<woops/>", :headers => {}})
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rsolr
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.12
4
+ version: 1.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Antoine Latter
@@ -29,7 +29,7 @@ authors:
29
29
  autorequire:
30
30
  bindir: bin
31
31
  cert_chain: []
32
- date: 2015-03-06 00:00:00.000000000 Z
32
+ date: 2015-10-14 00:00:00.000000000 Z
33
33
  dependencies:
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: builder
@@ -172,7 +172,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
172
172
  version: '0'
173
173
  requirements: []
174
174
  rubyforge_project: rsolr
175
- rubygems_version: 2.4.5
175
+ rubygems_version: 2.4.8
176
176
  signing_key:
177
177
  specification_version: 4
178
178
  summary: A Ruby client for Apache Solr