Class: Pathname
- Inherits:
-
Object
- Object
- Pathname
- Defined in:
- lib/epub/maker.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.mktmpdir(prefix_suffix = nil, tmpdir = nil) ⇒ Pathname .mktmpdir(prefix_suffix = nil, tmpdir = nil) {|dir| ... } ⇒ Object
103 104 105 106 107 108 109 110 111 |
# File 'lib/epub/maker.rb', line 103 def mktmpdir(prefix_suffix=nil, tmpdir=nil) if block_given? Dir.mktmpdir prefix_suffix, tmpdir do |dir| yield new(dir) end else new(Dir.mktmpdir(prefix_suffix, tmpdir)) end end |
Instance Method Details
#remove_entry_secure ⇒ Object
114 115 116 |
# File 'lib/epub/maker.rb', line 114 def remove_entry_secure FileUtils.remove_entry_secure to_path end |
#write(string, mode = 'w', perm = 0666) ⇒ Object
119 120 121 122 123 |
# File 'lib/epub/maker.rb', line 119 def write(string, mode='w', perm=0666) open mode, perm do |file| file << string end end |