Project

euromail

0.0
No commit activity in last 3 years
No release in over 3 years
Euromail SFTP service
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 2.1.2
 Project Readme

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!