Distribution::Resources::Menu

Navigate the files in the resources directory

NAME

Distribution::Resources::Menu - Navigate the files in the resources directory of your Raku distribution from the command line

SYNOPSIS

Place something like the following code into a module in your distribution:

use Injector  # IMPORTANT
use Distribution::Resources::Menu;
unit module Your::Module;

my $rsm = ResourceMenu.new(distribution => $?DISTRIBUTION, resources => $%RESOURCES);

sub execute-the-menu-to-pick-a-file is export {
    $rsm.execute;
}

And now you can execute the menu with something like this:

use Your::Module;

my $resource = execute-the-menu-to-pick-a-file();
# This will display a menu on the command line and prompt the user
# to select a file from the "resources" directory of the distribution

say $resource.file-path;
say $resource.file-content;
my $content = $resource

DESCRIPTION

Distribution::Resources::Menu generates and executes a menu for navigating and selecting files located in a distribution's resources directory.

METHODS

execute

Executes the interactive command-line menu for selecting a file from the resources directory of the distribution.

file-content

Returns the string value of the content of the file.

file-path

Returns the string value of the path to the file contained in the $%RESOURCES variable.

AUTHOR

Steve Dondley [email protected]

COPYRIGHT AND LICENSE

Copyright 2022 Steve Dondley

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.

Distribution::Resources::Menu v0.0.1

Navigate the files in the resources directory

Authors

  • Steve Dondley

License

Artistic-2.0

Dependencies

Menu::Simple

Test Dependencies

Provides

  • Distribution::Resources::Distribution
  • Distribution::Resources::Menu

Documentation

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.