Pathname.binread
This commit is contained in:
parent
8ad07144f7
commit
fbee511eba
@ -97,6 +97,10 @@ class Pathname
|
|||||||
open("wb", *open_args) { |f| f.write(contents) }
|
open("wb", *open_args) { |f| f.write(contents) }
|
||||||
end unless method_defined?(:binwrite)
|
end unless method_defined?(:binwrite)
|
||||||
|
|
||||||
|
def binread(*open_args)
|
||||||
|
open("rb", *open_args) { |f| f.read }
|
||||||
|
end unless method_defined?(:binread)
|
||||||
|
|
||||||
# NOTE always overwrites
|
# NOTE always overwrites
|
||||||
def atomic_write content
|
def atomic_write content
|
||||||
require "tempfile"
|
require "tempfile"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user