Skip to content

Commit

Permalink
Finish 3.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
gkellogg committed Jan 18, 2021
2 parents ceb41d3 + e77ec5f commit 9c527f0
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Expand Up @@ -24,7 +24,8 @@ jobs:
- 2.5
- 2.6
- 2.7
#- ruby-head # Until net-http-persistent updated
- 3.0
- ruby-head
- jruby
gemfile:
- Gemfile
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Expand Up @@ -5,7 +5,7 @@ gemspec
gem 'rdf', git: "https://github.com/ruby-rdf/rdf", branch: "develop"
gem 'rdf-aggregate-repo', git: "https://github.com/ruby-rdf/rdf-aggregate-repo", branch: "develop"
gem 'sparql', git: "https://github.com/ruby-rdf/sparql", branch: "develop"
gem "nokogiri", '~> 1.8'
gem "nokogiri", '~> 1.11'

group :development, :test do
gem 'ebnf', git: "https://github.com/dryruby/ebnf", branch: "develop"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -126,9 +126,9 @@ sparql.delete_data(data)

* [Ruby](https://ruby-lang.org/) (>= 2.4)
* [RDF.rb](https://rubygems.org/gems/rdf) (~> 3.1)
* [Net::HTTP::Persistent](https://rubygems.org/gems/net-http-persistent) (~> 3.1)
* [Net::HTTP::Persistent](https://rubygems.org/gems/net-http-persistent) (~> 4.0, >= 4.0.1)
* Soft dependency on [SPARQL](https://rubygems.org/gems/sparql) (~> 3.1)
* Soft dependency on [Nokogiri](https://rubygems.org/gems/nokogiri) (>= 1.10)
* Soft dependency on [Nokogiri](https://rubygems.org/gems/nokogiri) (>= 1.11)

## Installation

Expand Down
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
3.1.1
3.1.2
9 changes: 8 additions & 1 deletion lib/sparql/client.rb
Expand Up @@ -102,7 +102,7 @@ def initialize(url, **options, &block)
@http = http_klass(@url.scheme)

# Close the http connection when object is deallocated
ObjectSpace.define_finalizer(self, proc {@http.shutdown if @http.respond_to?(:shutdown)})
ObjectSpace.define_finalizer(self, self.class.finalize(@http))
end

if block_given?
Expand All @@ -113,6 +113,13 @@ def initialize(url, **options, &block)
end
end

# Close the http connection when object is deallocated
def self.finalize(klass)
proc do
klass.shutdown if klass.respond_to?(:shutdown)
end
end

##
# Closes a client instance by finishing the connection.
# The client is unavailable for any further data operations; an IOError is raised if such an attempt is made. I/O streams are automatically closed when they are claimed by the garbage collector.
Expand Down
2 changes: 1 addition & 1 deletion sparql-client.gemspec
Expand Up @@ -25,7 +25,7 @@ Gem::Specification.new do |gem|
gem.required_ruby_version = '>= 2.4'
gem.requirements = []
gem.add_runtime_dependency 'rdf', '~> 3.1'
gem.add_runtime_dependency 'net-http-persistent', '~> 4.0'
gem.add_runtime_dependency 'net-http-persistent', '~> 4.0', '>= 4.0.1'
gem.add_development_dependency 'rdf-spec', '~> 3.1'
gem.add_development_dependency 'sparql', '~> 3.1'
gem.add_development_dependency 'rspec', '~> 3.10'
Expand Down

0 comments on commit 9c527f0

Please sign in to comment.