class FakeFtp::ServerCommands::Rnfr

Public Instance Methods

run(ctx, rename_from = '', *) click to toggle source
# File lib/fake_ftp/server_commands/rnfr.rb, line 6
def run(ctx, rename_from = '', *)
  return '501 Send path name.' if rename_from.nil? || rename_from.empty?

  ctx.command_state[:rename_from] = if ctx.absolute?
                                      ctx.abspath(rename_from)
                                    else
                                      rename_from
                                    end
  '350 Send RNTO to complete rename.'
end