diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index aa837317..4c49d1f0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,3 +20,7 @@ jobs: run: bundle install - name: Run test run: rake test + - name: Build + run: rake build + env: + LANG: C diff --git a/lib/net/http.rb b/lib/net/http.rb index 9e4f9e84..639cb737 100644 --- a/lib/net/http.rb +++ b/lib/net/http.rb @@ -656,7 +656,7 @@ class HTTPHeaderSyntaxError < StandardError; end # - {:min_version=}[rdoc-ref:Net::HTTP#min_version=]: # Sets the minimum SSL version. # - {#peer_cert}[rdoc-ref:Net::HTTP#peer_cert]: - # Returns the X509 certificate chain for the session's socket peer. + # Returns the X509 certificate chain for the session’s socket peer. # - {:ssl_version}[rdoc-ref:Net::HTTP#ssl_version]: # Returns the SSL version. # - {:ssl_version=}[rdoc-ref:Net::HTTP#ssl_version=]: diff --git a/net-http.gemspec b/net-http.gemspec index a7f122fc..b07a0b60 100644 --- a/net-http.gemspec +++ b/net-http.gemspec @@ -2,9 +2,14 @@ name = File.basename(__FILE__, ".gemspec") version = ["lib", Array.new(name.count("-")+1, "..").join("/")].find do |dir| - break File.foreach(File.join(__dir__, dir, "#{name.tr('-', '/')}.rb")) do |line| - /^\s*VERSION\s*=\s*"(.*)"/ =~ line and break $1 - end rescue nil + file = File.join(__dir__, dir, "#{name.tr('-', '/')}.rb") + begin + break File.foreach(file, mode: "rb") do |line| + /^\s*VERSION\s*=\s*"(.*)"/ =~ line and break $1 + end + rescue SystemCallError + next + end end Gem::Specification.new do |spec| @@ -25,7 +30,7 @@ Gem::Specification.new do |spec| # Specify which files should be added to the gem when it is released. # The `git ls-files -z` loads the files in the RubyGem that have been added into git. spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do - `git ls-files -z 2>/dev/null`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } + `git ls-files -z 2>/dev/null`.split("\x0").reject { |f| f.match(%r{\A(?:(?:test|spec|features)/|\.git)}) } end spec.bindir = "exe" spec.require_paths = ["lib"]