lib/hoe.rb in hoe-2.3.1 vs lib/hoe.rb in hoe-2.3.2
- old
+ new
@@ -57,11 +57,11 @@
# end
# end
class Hoe
# duh
- VERSION = '2.3.1'
+ VERSION = '2.3.2'
@@plugins = [:clean, :debug, :deps, :flay, :flog, :package, :publish,
:rcov, :signing, :test]
##
@@ -355,11 +355,11 @@
unless self.version then
version = nil
spec.files.each do |file|
next unless File.exist? file
- version = File.read(file)[/VERSION = ([\"\'])([\d][\d\w\.]+)\1/, 2]
+ version = File.read(file)[/VERSION += +([\"\'])([\d][\d\w\.]+)\1/, 2]
break if version
end
spec.version = self.version = version if version
@@ -562,8 +562,10 @@
end
class File
# Like File::read, but strips out a BOM marker if it exists.
def self.read_utf path
- File.read(path).sub(/\A\xEF\xBB\xBF/, '')
+ open path, 'rb' do |f|
+ f.read.sub %r/\A\xEF\xBB\xBF/, ''
+ end
end
end