你可以对FakeFTP::Server进行猴子补丁(monkey-patch),或者分叉(fork)它并添加所需的功能。
根据Net::FTP#gettextfile API,可以这样实现:
class FakeFTP::Server
def gettextfile(remotefile, localfile = nil)
content = file(remotefile).data
File.open(localfile, "w+"){|f| f << content} if localfile
yield(content) if block_given?
end
end