Skip to content

Commit 67c5804

Browse files
committed
Read in binary mode to get rid of invalid byte sequence
1 parent c417354 commit 67c5804

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

net-http.gemspec

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
name = File.basename(__FILE__, ".gemspec")
44
version = ["lib", Array.new(name.count("-")+1, "..").join("/")].find do |dir|
5-
break File.foreach(File.join(__dir__, dir, "#{name.tr('-', '/')}.rb")) do |line|
5+
break File.foreach(File.join(__dir__, dir, "#{name.tr('-', '/')}.rb"), "rb") do |line|
66
/^\s*VERSION\s*=\s*"(.*)"/ =~ line and break $1
77
end rescue nil
8+
rescue SystemCallError
9+
next
810
end
911

1012
Gem::Specification.new do |spec|

0 commit comments

Comments
 (0)