Class: Pathname

Inherits:
Object
  • Object
show all
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

Overloads:

  • .mktmpdir(prefix_suffix = nil, tmpdir = nil) ⇒ Pathname

    Returns path to temporary directory.

    Parameters:

    • prefix_suffix (String|nil) (defaults to: nil)

      see Dir.mktmpdir

    • tmpdir (String|nil) (defaults to: nil)

      see Dir.mktmpdir

    Returns:

    • (Pathname)

      path to temporary directory

  • .mktmpdir(prefix_suffix = nil, tmpdir = nil) {|dir| ... } ⇒ Object

    Returns value of given block.

    Parameters:

    • prefix_suffix (String|nil) (defaults to: nil)

      see Dir.mktmpdir

    • tmpdir (String|nil) (defaults to: nil)

      see Dir.mktmpdir

    Yield Parameters:

    • dir (Pathname)

      path to temporary directory

    Returns:

    • value of given block



145
146
147
148
149
150
151
152
153
# File 'lib/epub/maker.rb', line 145

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_secureObject



156
157
158
# File 'lib/epub/maker.rb', line 156

def remove_entry_secure
  FileUtils.remove_entry_secure to_path
end