Class: IO
- Inherits:
-
Object
- Object
- IO
- Defined in:
- lib/tagen/core/io.rb
Class Method Summary collapse
-
.append(name, string, [offset], [open_args]) ⇒ Object
A convient method to append a file.
-
.write(name, string, [offset], [open_args]) ⇒ Object
(also: write)
Extends IO#write with :mkdir option.
Class Method Details
.append(name, string, [offset], [open_args]) ⇒ Object
A convient method to append a file.
31 32 33 34 35 36 |
# File 'lib/tagen/core/io.rb', line 31 def append(name, string, *args) (offset,), o = args. o[:mode] = "a" write(name, string, offset, o) end |
.write(name, string, [offset], [open_args]) ⇒ Object Also known as: write
Extends IO#write with :mkdir option
10 11 12 13 14 15 |
# File 'lib/tagen/core/io.rb', line 10 def write_with_tagen(name, string, *args) (offset,), o = args. mkdir_p(File.dirname(name)) if o[:mkdir] write_without_tagen(name, string, offset, o) end |