Permalink
Browse files

Guard against empty query parameters.

  • Loading branch information...
1 parent d680b9b commit f5ca0f6b7203a721202b75ba6873f83bd0f613df @gkellogg gkellogg committed Jun 3, 2012
Showing with 17 additions and 16 deletions.
  1. +2 −2 .gemspec
  2. +13 −13 Gemfile.lock
  3. +2 −1 lib/sparql/client.rb
View
4 .gemspec
@@ -29,9 +29,9 @@ Gem::Specification.new do |gem|
gem.requirements = []
gem.add_runtime_dependency 'json_pure', '>= 1.6.5' # included in Ruby 1.9.2
gem.add_runtime_dependency 'rdf', '>= 0.3.5'
- gem.add_runtime_dependency 'net-http-persistent', '~> 1.4.1'
+ gem.add_runtime_dependency 'net-http-persistent', '>= 1.4.1'
gem.add_development_dependency 'yard' , '>= 0.7.5'
- gem.add_development_dependency 'rspec', '>= 2.8.0'
+ gem.add_development_dependency 'rspec', '>= 2.10.0'
gem.add_development_dependency 'rdf-spec', '>= 0.3.5'
gem.post_install_message = nil
end
View
26 Gemfile.lock
@@ -1,42 +1,42 @@
PATH
remote: .
specs:
- sparql-client (0.1.0)
+ sparql-client (0.1.1)
json_pure (>= 1.6.5)
- net-http-persistent (~> 1.4.1)
+ net-http-persistent (>= 1.4.1)
rdf (>= 0.3.5)
GEM
remote: http://rubygems.org/
specs:
addressable (2.2.8)
diff-lcs (1.1.3)
- json_pure (1.7.0)
- net-http-persistent (1.4.1)
+ json_pure (1.7.3)
+ net-http-persistent (2.6)
rack (1.4.1)
rdf (0.3.5.2)
addressable (>= 2.2.6)
rdf-spec (0.3.5.1)
rspec (>= 2.8.0)
- rspec (2.9.0)
- rspec-core (~> 2.9.0)
- rspec-expectations (~> 2.9.0)
- rspec-mocks (~> 2.9.0)
- rspec-core (2.9.0)
- rspec-expectations (2.9.0)
+ rspec (2.10.0)
+ rspec-core (~> 2.10.0)
+ rspec-expectations (~> 2.10.0)
+ rspec-mocks (~> 2.10.0)
+ rspec-core (2.10.1)
+ rspec-expectations (2.10.0)
diff-lcs (~> 1.1.3)
- rspec-mocks (2.9.0)
+ rspec-mocks (2.10.1)
shotgun (0.9)
rack (>= 1.0)
wirble (0.1.3)
- yard (0.7.5)
+ yard (0.8.1)
PLATFORMS
ruby
DEPENDENCIES
rdf-spec (>= 0.3.5)
- rspec (>= 2.8.0)
+ rspec (>= 2.10.0)
shotgun
sparql-client!
wirble
View
3 lib/sparql/client.rb
@@ -293,7 +293,8 @@ def http_klass(scheme)
# @return [Net::HTTPResponse]
def get(query, headers = {}, &block)
url = self.url.dup
- url.query_values.merge({:query => query.to_s})
+ url.query_values ||= {}
+ url.query_values.merge!({:query => query.to_s})
request = Net::HTTP::Get.new(url.request_uri, @headers.merge(headers))
request.basic_auth url.user, url.password if url.user && !url.user.empty?

0 comments on commit f5ca0f6

Please sign in to comment.