Skip to content

Instantly share code, notes, and snippets.

@sdondley
Created June 21, 2022 11:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sdondley/9c7620a8945f06847591d6fa6b8ef587 to your computer and use it in GitHub Desktop.
Save sdondley/9c7620a8945f06847591d6fa6b8ef587 to your computer and use it in GitHub Desktop.
Early snapshot of Distribution::Resources::Menu
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 <s@dondley.com>
=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
@sdondley
Copy link
Author

Test comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment