Class: Zanders::Base
- Inherits:
-
Object
- Object
- Zanders::Base
- Defined in:
- lib/zanders/base.rb
Direct Known Subclasses
Class Method Summary collapse
Class Method Details
.connect(options = {}) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/zanders/base.rb', line 4 def self.connect( = {}) requires!(, :username, :password) Net::FTP.open(Zanders.config.ftp_host, [:username], [:password]) do |ftp| ftp.passive = true yield ftp end rescue Net::FTPPermError raise Zanders::NotAuthenticated end |