Created
June 21, 2022 11:34
-
-
Save sdondley/9c7620a8945f06847591d6fa6b8ef587 to your computer and use it in GitHub Desktop.
Revisions
-
sdondley created this gist
Jun 21, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,61 @@ use Injector; use Menu::Simple; unit class Distribution::Resources::Menu; class ResourceMenu is export { has CompUnit::Repository::Distribution $.dist is injected<dist>; has Menu $.menu is rw; method action(Str $path) { say $path; my $file = %?RESOURCES{$path}; say $file; } method resources() { self.dist.meta<resources> } method build-menu() { my $menu = Menu.new(); $menu.add-option('test.txt', { self.action('testing/test.txt') }); self.menu = $menu; } method execute-menu() { self.menu.execute; } } =begin pod =head1 NAME Distribution::Resources::Menu - blah blah blah =head1 SYNOPSIS =begin code :lang<raku> use Distribution::Resources::Menu; =end code =head1 DESCRIPTION Distribution::Resources::Menu allows users to navigate and select a file from a distribution's C<resources> directory. =head1 AUTHOR Steve Dondley <[email protected]> =head1 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. =end pod