Skip to content

Commit

Permalink
Merge pull request #76 from kateinoigakukun/katei/fix-version-extraction
Browse files Browse the repository at this point in the history
Fix version extraction to work with non ASCII characters with any `LANG`
  • Loading branch information
hsbt authored Jan 4, 2024
2 parents 2b25124 + a772f44 commit 809a87d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net-smtp.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

name = File.basename(__FILE__, ".gemspec")
version = ["lib", Array.new(name.count("-"), "..").join("/")].find do |dir|
break File.foreach(File.join(__dir__, dir, "#{name.tr('-', '/')}.rb")) do |line|
break File.foreach(File.join(__dir__, dir, "#{name.tr('-', '/')}.rb"), :encoding => "UTF-8") do |line|
/^\s*VERSION\s*=\s*"(.*)"/ =~ line and break $1
end rescue nil
end
Expand Down

0 comments on commit 809a87d

Please sign in to comment.