Skip to content
This repository
Browse code

Guard against empty query parameters.

  • Loading branch information...
commit f5ca0f6b7203a721202b75ba6873f83bd0f613df 1 parent d680b9b
Gregg Kellogg authored
4  .gemspec
@@ -29,9 +29,9 @@ Gem::Specification.new do |gem|
29 29
   gem.requirements               = []
30 30
   gem.add_runtime_dependency     'json_pure', '>= 1.6.5' # included in Ruby 1.9.2
31 31
   gem.add_runtime_dependency     'rdf',       '>= 0.3.5'
32  
-  gem.add_runtime_dependency     'net-http-persistent',       '~> 1.4.1'
  32
+  gem.add_runtime_dependency     'net-http-persistent',       '>= 1.4.1'
33 33
   gem.add_development_dependency 'yard' ,     '>= 0.7.5'
34  
-  gem.add_development_dependency 'rspec',     '>= 2.8.0'
  34
+  gem.add_development_dependency 'rspec',     '>= 2.10.0'
35 35
   gem.add_development_dependency 'rdf-spec',  '>= 0.3.5'
36 36
   gem.post_install_message       = nil
37 37
 end
26  Gemfile.lock
... ...
@@ -1,9 +1,9 @@
1 1
 PATH
2 2
   remote: .
3 3
   specs:
4  
-    sparql-client (0.1.0)
  4
+    sparql-client (0.1.1)
5 5
       json_pure (>= 1.6.5)
6  
-      net-http-persistent (~> 1.4.1)
  6
+      net-http-persistent (>= 1.4.1)
7 7
       rdf (>= 0.3.5)
8 8
 
9 9
 GEM
@@ -11,32 +11,32 @@ GEM
11 11
   specs:
12 12
     addressable (2.2.8)
13 13
     diff-lcs (1.1.3)
14  
-    json_pure (1.7.0)
15  
-    net-http-persistent (1.4.1)
  14
+    json_pure (1.7.3)
  15
+    net-http-persistent (2.6)
16 16
     rack (1.4.1)
17 17
     rdf (0.3.5.2)
18 18
       addressable (>= 2.2.6)
19 19
     rdf-spec (0.3.5.1)
20 20
       rspec (>= 2.8.0)
21  
-    rspec (2.9.0)
22  
-      rspec-core (~> 2.9.0)
23  
-      rspec-expectations (~> 2.9.0)
24  
-      rspec-mocks (~> 2.9.0)
25  
-    rspec-core (2.9.0)
26  
-    rspec-expectations (2.9.0)
  21
+    rspec (2.10.0)
  22
+      rspec-core (~> 2.10.0)
  23
+      rspec-expectations (~> 2.10.0)
  24
+      rspec-mocks (~> 2.10.0)
  25
+    rspec-core (2.10.1)
  26
+    rspec-expectations (2.10.0)
27 27
       diff-lcs (~> 1.1.3)
28  
-    rspec-mocks (2.9.0)
  28
+    rspec-mocks (2.10.1)
29 29
     shotgun (0.9)
30 30
       rack (>= 1.0)
31 31
     wirble (0.1.3)
32  
-    yard (0.7.5)
  32
+    yard (0.8.1)
33 33
 
34 34
 PLATFORMS
35 35
   ruby
36 36
 
37 37
 DEPENDENCIES
38 38
   rdf-spec (>= 0.3.5)
39  
-  rspec (>= 2.8.0)
  39
+  rspec (>= 2.10.0)
40 40
   shotgun
41 41
   sparql-client!
42 42
   wirble
3  lib/sparql/client.rb
@@ -293,7 +293,8 @@ def http_klass(scheme)
293 293
     # @return [Net::HTTPResponse]
294 294
     def get(query, headers = {}, &block)
295 295
       url = self.url.dup
296  
-      url.query_values.merge({:query => query.to_s})
  296
+      url.query_values ||= {}
  297
+      url.query_values.merge!({:query => query.to_s})
297 298
 
298 299
       request = Net::HTTP::Get.new(url.request_uri, @headers.merge(headers))
299 300
       request.basic_auth url.user, url.password if url.user && !url.user.empty?

0 notes on commit f5ca0f6

Please sign in to comment.
Something went wrong with that request. Please try again.