Skip to content

steijgeler/euromail

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

euromail

Gem to upload pdf data to an SFTP server, like Euromail. Filenames are generated and consist of the application name, customer name and a given identifier.

Usage

Create an instance of the Euromail::SFTPService like this:

EUROMAIL = Euromail::SFTPService.new('some_company', 'some_customer', 'ftp.somehost.com', 'itsme', 'super_secret')

Is is possible to pass additional Net:SSH options when initializing the SFTPService. These are used when connecting to the sftp service. Supported options are listed here: http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start

EUROMAIL = Euromail::SFTPService.new(
  'some_company', 'some_customer', 'ftp.somehost.com', 'itsme', 'super_secret', 
  compression: true, config: true
)

Upload pdf data like this:

EUROMAIL.upload!('pdf string', '213')

Remove a pdf file like this:

EUROMAIL.remove!('213')

Development and test mode

In development mode a connection to the sftp server is never made. Instead, some information of connecting and uploads is logged to $stdout.

In test mode a connection to the sftp server is never made, and nothing is logged. Instead, the 'EUROMAIL.uploaded_files' array keeps track of the uploaded files.

Switch to development or test mode like this:

EUROMAIL.development_mode!
EUROMAIL.test_mode!

About

Gem to use the SFTP service from Euromail

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages