Project

ftp_liar

0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Simple class for test application using Net::FTP object. It is not complete FTP local server.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.10
>= 0
~> 10.0
~> 3.3
 Project Readme

FTPLiar

This is experimental gem to simulate Net::FTP object using temporary directory. You use it or your own risk.

Installation

Add this line to your application's Gemfile:

gem 'ftp_liar'

And then execute:

$ bundle

Or install it yourself as:

$ gem install ftp_liar

Usage

Use FTPLiar class with proxy pattern, override interesting class.

class MyFTP
  def initialize(*args)
    @ftp_liar = FTPLiar::FTPLiar.new(*args)
  end

  def method_missing(name, *args)
    @ftp_liar.send(name, *args)
  end
end

If some method raise NotImplementedError override create your own method like in the example

class MyFTP
  def initialize(*args)
    @ftp_liar = FTPLiar::FTPLiar.new(*args)
  end

  def mdtm(filename)
    # Do here what do you want.
  end

  def method_missing(name, *args)
    @ftp_liar.send(name, *args)
  end
end

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/Draqun/ftp_liar.