Patch in File::write until the next backports gem is released (fixes #175, fixes #176)

This commit is contained in:
Jordan Sissel 2012-03-19 14:35:58 -07:00
parent 559ae665d5
commit f86c23995e
1 changed files with 11 additions and 0 deletions

11
lib/fpm/monkeypatches.rb Normal file
View File

@ -0,0 +1,11 @@
# Copied from https://raw.github.com/marcandre/backports/master/lib/backports/1.9.3/io.rb
# Also Hacked just to make it work
# This is necessary until a newer version of backports (> 2.3.0) is available
class << IO
# Standard in Ruby 1.9.3 See official documentation[http://ruby-doc.org/core-1.9.3/IO.html#method-c-write]
def write(name, string, offset = nil, options = Backports::Undefined)
File.open(name, "w") do |fd|
fd.write(string)
end
end unless method_defined? :write
end