Skip to content

Commit

Permalink
Initial commit of code
Browse files Browse the repository at this point in the history
  • Loading branch information
gryphonshafer committed Oct 24, 2023
1 parent dbb170e commit 92cd891
Show file tree
Hide file tree
Showing 10 changed files with 511 additions and 2 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: test
on: [ push, pull_request, workflow_dispatch ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
perl-version: [ 38, 36, 34, 32, 30, 28, 26, 24, 22, 18, 16 ]
container:
image: perldocker/perl-tester:5.${{ matrix.perl-version }}
steps:
- uses: actions/checkout@v3
- run: cpanm --with-develop --with-all-features --installdeps .
env:
PERL_CPANM_OPT: --from https://cpan.metacpan.org/ --notest --force --skip-satisfied
- run: prove --recurse --lib --failures --jobs 4 --timer t
env:
HARNESS_PERL_SWITCHES: -MDevel::Cover
- run: cover -report codecov
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
if: env.CODECOV_TOKEN != null && matrix.perl-version >= 26
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Prove
.prove

# Devel::Cover
cover_db/

# Devel::NYTProf
nytprof/
nytprof.out

# Dizt::Zilla
*.gz
/.build/
4 changes: 4 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Revision history for MojoX::Linda

{{$NEXT}}
- First version, released on an unsuspecting world.
74 changes: 74 additions & 0 deletions Makefile.PL
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.030.
use strict;
use warnings;

use 5.016;

use ExtUtils::MakeMaker;

my %WriteMakefileArgs = (
"ABSTRACT" => "Plausibly helpful (and probably drunk) wrapper around morbo",
"AUTHOR" => "Gryphon Shafer <gryphon\@cpan.org>",
"CONFIGURE_REQUIRES" => {
"ExtUtils::MakeMaker" => 0
},
"DISTNAME" => "MojoX-Linda",
"EXE_FILES" => [
"bin/linda"
],
"LICENSE" => "artistic_2",
"MIN_PERL_VERSION" => "5.016",
"NAME" => "MojoX::Linda",
"PREREQ_PM" => {
"Class::Method::Modifiers" => 0,
"Config::App" => "1.16",
"File::Find" => 0,
"Mojo::File" => 0,
"Mojo::Server::Morbo" => 0,
"exact" => "1.14",
"exact::cli" => 0
},
"TEST_REQUIRES" => {
"File::Spec" => 0,
"IO::Handle" => 0,
"IPC::Open3" => 0,
"Test2::V0" => 0,
"Test::More" => 0,
"strict" => 0,
"warnings" => 0
},
"VERSION" => "1.00",
"test" => {
"TESTS" => "t/*.t"
}
);


my %FallbackPrereqs = (
"Class::Method::Modifiers" => 0,
"Config::App" => "1.16",
"File::Find" => 0,
"File::Spec" => 0,
"IO::Handle" => 0,
"IPC::Open3" => 0,
"Mojo::File" => 0,
"Mojo::Server::Morbo" => 0,
"Test2::V0" => 0,
"Test::More" => 0,
"exact" => "1.14",
"exact::cli" => 0,
"strict" => 0,
"warnings" => 0
);


unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) {
delete $WriteMakefileArgs{TEST_REQUIRES};
delete $WriteMakefileArgs{BUILD_REQUIRES};
$WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs;
}

delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
unless eval { ExtUtils::MakeMaker->VERSION(6.52) };

WriteMakefile(%WriteMakefileArgs);
96 changes: 94 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,94 @@
# -MojoX-Linda
Plausibly helpful (and probably drunk) wrapper around morbo
# NAME

MojoX::Linda - Plausibly helpful (and probably drunk) wrapper around morbo

# VERSION

version 1.00

[![test](https://github.com/gryphonshafer/MojoX-Linda/workflows/test/badge.svg)](https://github.com/gryphonshafer/MojoX-Linda/actions?query=workflow%3Atest)
[![codecov](https://codecov.io/gh/gryphonshafer/MojoX-Linda/graph/badge.svg)](https://codecov.io/gh/gryphonshafer/MojoX-Linda)

# SYNOPSIS

linda [OPTIONS]
-s, --silent
-a, --app APPLICATION
-m, --mode MOJO_MODE
-b, --backend MOJO_MORBO_BACKEND
-l, --listen LISTEN_PATTERN # can be repeated
-w, --watch DIRECTORY_OR_FILE # can be repeated
-h, --help
-m, --man

# DESCRIPTION

`linda` is a plausibly helpful (and probably drunk) wrapper around `morbo`,
provided by [Mojo::Server::Morbo](https://metacpan.org/pod/Mojo%3A%3AServer%3A%3AMorbo). Like `morbo`, `linda` will accept various
configuration settings for server operation; but unlike `morbo`, `linda` will
hallucinate settings that aren't set explicitly.

In theory, if you just call `linda` without any settings, `linda` will call
`morbo` in the way you want. In practice, `linda` will probably act inebriated.

## -s, --silent

This is the inverse of the `morbo` "verbose" flag. If not set, `linda` assumes
you want verbose.

## -a, --app

This is the Mojolicious application you'd like to startup. If not set explicitly,
`linda` will look around (from your current working directory) for an
executable file that has code in it that looks like it's probably a
Mojolicious application.

`linda`'s judgement here should not be trusted.

## -m, --mode

See [Mojo::Server::Morbo](https://metacpan.org/pod/Mojo%3A%3AServer%3A%3AMorbo).

## -b, --backend

See [Mojo::Server::Morbo](https://metacpan.org/pod/Mojo%3A%3AServer%3A%3AMorbo).

## -l, --listen

One or more locations you want to listen on. If not set explicitly, `linda`
will look for open ports starting with 3000 and going up to 3999. The first
open port will be used.

## -w, --watch

See [Mojo::Server::Morbo](https://metacpan.org/pod/Mojo%3A%3AServer%3A%3AMorbo).

# CONFIGURATION

`linda` will initially try to find and load a configuration file via a call to
[Config::App](https://metacpan.org/pod/Config%3A%3AApp)'s `find`. If `find` returns a configuration, `linda` will
look in that configuration under `mojolicious/linda` for settings. Any settings
will be overwritten by any explicit command-line settings.

# SEE ALSO

You can also look for additional information at:

- [GitHub](https://github.com/gryphonshafer/MojoX-Linda)
- [MetaCPAN](https://metacpan.org/pod/MojoX::Linda)
- [GitHub Actions](https://github.com/gryphonshafer/MojoX-Linda/actions)
- [Codecov](https://codecov.io/gh/gryphonshafer/MojoX-Linda)
- [CPANTS](http://cpants.cpanauthors.org/dist/MojoX-Linda)
- [CPAN Testers](http://www.cpantesters.org/distro/M/MojoX-Linda.html)

# AUTHOR

Gryphon Shafer <gryphon@cpan.org>

# COPYRIGHT AND LICENSE

This software is Copyright (c) 2023-2050 by Gryphon Shafer.

This is free software, licensed under:

The Artistic License 2.0 (GPL Compatible)
38 changes: 38 additions & 0 deletions bin/linda
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/env perl
use exact;
use exact::cli;

# PODNAME: linda
# ABSTRACT: Plausibly helpful (and probably drunk) wrapper around morbo
# VERSION

use MojoX::Linda;

sub usage ( $verbose, $message = undef ) {
pod2usage(
'-message' => $message,
'-exitval' => 1,
'-verbose' => $verbose,
'-input' => 'MojoX/Linda.pm',
'-pathlist' => \@INC,
);
}

my $help_man =
( grep { /^\s*\-+\s*h/i } @ARGV ) ? 1 :
( grep { /^\s*\-+\s*m/i } @ARGV ) ? 2 : undef;

usage($help_man) if $help_man;

my $conf = MojoX::Linda::conf( options( qw{
silent|s
app|a=s
mode|m=s
backend|b=s
listen|l=s@
watch|w=s@
} ) );

usage( 1, 'Unable to identify "app" implicitly' ) unless $conf->{app};

exit MojoX::Linda::run($conf);
54 changes: 54 additions & 0 deletions dist.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name = MojoX-Linda
author = Gryphon Shafer <gryphon@cpan.org>
license = Artistic_2_0
copyright_holder = Gryphon Shafer
copyright_year = 2023-2050

[Git::NextVersion]

[@Basic]
[PruneFiles]
match = ^cover_db

[MinimumPerl]

[NextRelease]
[AutoPrereqs]
[OurPkgVersion]
[MetaJSON]
[CPANFile]

[PodWeaver]

[ReadmeAnyFromPod]
type = markdown
location = root
filename = README.md

[Run::BeforeBuild]
run = rm -f Makefile.PL

[Run::AfterBuild]
run = cp %d/Makefile.PL .
run = cp README.md %d/.

[PodCoverageTests]
[PodSyntaxTests]
[Test::NoTabs]
[Test::EOL]
[Test::Compile]
[Test::Portability]
[Test::Synopsis]
[Test::Kwalitee]

[Clean]

[GithubMeta]
issues = 1

[@Git]
untracked_files = ignore

[Prereqs]
exact = 1.14
Config::App = 1.16
Loading

0 comments on commit 92cd891

Please sign in to comment.