NAME

StandupGenerator::Accessor - opens files for user

DESCRIPTION

The Accessor module surfaces methods to allow the user to open specific standup files. It contains functions to open either one standup file within a directory or a collection of standup files within a directory.

METHODS

open_one

This method lets the user open a single standup file stored in a specific directory. If the .txt file exists, then the method will open it in the user's default editor (e.g., TextEdit). However, nothing will be explicitly returned.

Parameters

$path

A string containing the full file path for the directory containing the standup file. It should begin with /Users/.

$sprint

A number representing the sprint of the standup.

$day

A string containing a two-digit representation of the day of the standup. Single digit numbers will begin with '0'.

Examples

use StandupGenerator::Accessor;
StandupGenerator::Accessor::open_one('/Users/johndoe/projects/super-important-project/standups', 3, '07');

This command will open the file s3d07.txt, stored within the standups directory within the super-important-project directory.

use StandupGenerator::Accessor;
StandupGenerator::Accessor::open_one('/Users/johndoe/projects/super-important-project/standups', 3, 7);

This command will not open any file since the day was not provided as a two-digit string. (The program will not generate any file named s3d7.txt.)

open_many

This method lets the user open a collection of standup files stored in a specific directory. The intent is to open all standups for the past week. It assumes the last standup in the given directory is either a Friday or Monday, and it opens six files as a result (Monday's through Friday's along with the following Monday's). If the path leads to a directory that contains .txt files formatted with the standups naming convention, then the method will open six of those files in the user's default editor (e.g., TextEdit). However, nothing will be explicitly returned.

Parameters

$path

A string containing the full file path for the directory containing the standup files. It should begin with /Users/.

Examples

use StandupGenerator::Accessor;
StandupGenerator::Accessor::open_many('/Users/johndoe/projects/super-important-project/standups');

This command will open six files stored within the standups directory within the super-important-project directory. If the last created file ends in a number greater than five, then the files opened will be d04, d05, d06, d07, d08, and d09 for the current sprint. Otherwise, it will open the files d01, d02, d03, and d04 from the current sprint along with files d09 and d10 from the preceding sprint.

use StandupGenerator::Accessor;
StandupGenerator::Accessor::open_many('/Users/johndoe/projects/super-important-project/');

This command will not open any file since the directory in question does not contain any standups (assuming that's the case with this file structure).