Skip to content

Commit 809a87d

Browse files
authored
Merge pull request #76 from kateinoigakukun/katei/fix-version-extraction
Fix version extraction to work with non ASCII characters with any `LANG`
2 parents 2b25124 + a772f44 commit 809a87d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

net-smtp.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
name = File.basename(__FILE__, ".gemspec")
44
version = ["lib", Array.new(name.count("-"), "..").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"), :encoding => "UTF-8") do |line|
66
/^\s*VERSION\s*=\s*"(.*)"/ =~ line and break $1
77
end rescue nil
88
end

0 commit comments

Comments
 (0)