Name

Exchange files and update issues with your colleagues via an S3 bucket or rsync.

Synopsis

Configure and run an exchanger:

use Data::Exchange;
my $x        = Data::Exchange::new();
$x->user     = q(phil);
$x->bucket   = q(com.appaapps.exchange);
$x->exchange = q(/home/phil/exchange);
$x->start;

Files that end in .txt no matter where they are located below the exchange folder:

$x->exchange

will be merged with files of the same name from your colleagues whose files show up in other folders under the exchange folder, allowing you to share files and update issues with your colleagues.

Issue files that start with a plus sign + in column one of line one are assumed to be work in progress and will be ignored until the initial plus sign is removed.

Lines which start with defined keywords in column one have special meanings if the occur in the first section of an issues file:

to: user

The name of the user to which this issue is addressed otherwise all users will see copies of this issue.

Description

files and update issues with your colleagues via an S3 bucket or rsync.

The following sections describe the methods in each functional area of this module. For an alphabetic listing of all methods by name see Index.

File and Issue Exchanger

Exchange files and update issues with your colleagues via an S3 bucket or rsync.

new(@)

Create a new exchanger for a specified user allowing them to exchange files and issues with their colleagues via an S3 bucket or rsync - see: Data::Exchange Definition for the attributes that can be set by this constructor.

   Parameter  Description
1  @parms     Optional parameters

Example:

my $x        = Data::Exchange::𝗻𝗲𝘄();

Data::Exchange::Details::start()

Start a new exchanger as a service via atq.

Example:

$x->start;

Hash Definitions

Data::Exchange::Details Definition

Exchanger attributes.

boldFilesWithChanges - Bold file names with changed contents

bucket - The meeting point expressed as bucket/optionalPrefix for S3 transport

exchange - Folder containing files locally

ext - Extension of issue files

interval - Interval between exchanges

nexus - The meeting point expressed as a target for rsync transport

quiet - Quiet S3/rsync if true

rsyncOptions - Rsync options

s3Parms - Additional S3 parms

start - Time this exchanger was started

transport - Default file transfer

user - User who owns this instance

Private Methods

Data::Exchange::Details::stamp($)

Match files that have the same file name.

   Parameter  Description
1  $x         Exchanger

replaceWriteLine($$)

Replace the write line in a file

   Parameter  Description
1  $file      File
2  $line      New line

cutByTime($)

Cut a single file into time sections.

   Parameter  Description
1  $file      File

Data::Exchange::Details::findIssueFiles($)

Find all the files that are issues

   Parameter  Description
1  $x         Exchanger

inProgressFile($)

Check whether a file is a work in progress depending on whether it has a plus sign in column 1 of line 1 or not.

   Parameter  Description
1  $file      File

Data::Exchange::Details::findInProgressFiles($)

Find all the files that are in progress.

   Parameter  Description
1  $x         Exchanger

Data::Exchange::Details::assemble($@)

Assemble the time sections in multiple files into one file.

   Parameter  Description
1  $x         Exchanger
2  @files     Files

Data::Exchange::Details::matchFiles($)

Match files that have the same file name.

   Parameter  Description
1  $x         Exchanger

Data::Exchange::Details::listFiles($)

List user files

   Parameter  Description
1  $x         Exchanger

boldFileName($)

Create a bold file name

   Parameter  Description
1  $file      File name

unBoldFileName($)

Remove bolding from file name

   Parameter  Description
1  $file      File name

Data::Exchange::Details::unBoldFiles($)

Make all issue files non bold.

   Parameter  Description
1  $x         Exchanger

Data::Exchange::Details::localFolder($)

The local folder containing the users own files.

   Parameter  Description
1  $x         Exchanger

Data::Exchange::Details::stampUnstampedFiles($)

Add a time stamp to files that are no longer in progress

   Parameter  Description
1  $x         Exchanger

Data::Exchange::Details::exchangeUp($)

Send one set of files.

   Parameter  Description
1  $x         Exchanger

Data::Exchange::Details::exchangeDown($)

Receive one set of files.

   Parameter  Description
1  $x         Exchanger

Data::Exchange::Details::exchangeOneSet($)

Exchange one set of files.

   Parameter  Description
1  $x         Exchanger

Data::Exchange::Details::go($)

Run until forcibly stopped.

   Parameter  Description
1  $x         Exchanger

Index

1 boldFileName - Create a bold file name

2 cutByTime - Cut a single file into time sections.

3 Data::Exchange::Details::assemble - Assemble the time sections in multiple files into one file.

4 Data::Exchange::Details::exchangeDown - Receive one set of files.

5 Data::Exchange::Details::exchangeOneSet - Exchange one set of files.

6 Data::Exchange::Details::exchangeUp - Send one set of files.

7 Data::Exchange::Details::findInProgressFiles - Find all the files that are in progress.

8 Data::Exchange::Details::findIssueFiles - Find all the files that are issues

9 Data::Exchange::Details::go - Run until forcibly stopped.

10 Data::Exchange::Details::listFiles - List user files

11 Data::Exchange::Details::localFolder - The local folder containing the users own files.

12 Data::Exchange::Details::matchFiles - Match files that have the same file name.

13 Data::Exchange::Details::stamp - Match files that have the same file name.

14 Data::Exchange::Details::stampUnstampedFiles - Add a time stamp to files that are no longer in progress

15 Data::Exchange::Details::start - Start a new exchanger as a service via atq.

16 Data::Exchange::Details::unBoldFiles - Make all issue files non bold.

17 inProgressFile - Check whether a file is a work in progress depending on whether it has a plus sign in column 1 of line 1 or not.

18 new - Create a new exchanger for a specified user allowing them to exchange files and issues with their colleagues via an S3 bucket or rsync - see: Data::Exchange Definition for the attributes that can be set by this constructor.

19 replaceWriteLine - Replace the write line in a file

20 unBoldFileName - Remove bolding from file name

Installation

This module is written in 100% Pure Perl and, thus, it is easy to read, comprehend, use, modify and install via cpan:

sudo cpan install Data::Exchange

Author

philiprbrenan@gmail.com

http://www.appaapps.com

Copyright

Copyright (c) 2016-2018 Philip R Brenan.

This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself.