App-traveller

 view release on metacpan or  search on metacpan

META.json  view on Meta::CPAN

            "ExtUtils::MakeMaker" : "0"
         }
      },
      "configure" : {
         "requires" : {
            "ExtUtils::MakeMaker" : "0"
         }
      },
      "runtime" : {
         "requires" : {
            "Modern::Perl" : "1.20180701",
            "Mojolicious" : "9",
            "perl" : "5.026000"
         }
      },
      "test" : {
         "requires" : {
            "Test::Memory::Cycle" : "0"
         }
      }
   },

META.yml  view on Meta::CPAN

license: open_source
meta-spec:
  url: http://module-build.sourceforge.net/META-spec-v1.4.html
  version: '1.4'
name: App-traveller
no_index:
  directory:
    - t
    - inc
requires:
  Modern::Perl: '1.20180701'
  Mojolicious: '9'
  perl: '5.026000'
resources:
  repository: https://alexschroeder.ch/cgit/traveller
version: 1.01
x_serialization_backend: 'CPAN::Meta::YAML version 0.018'

Makefile.PL  view on Meta::CPAN

use 5.008004;
use ExtUtils::MakeMaker;

WriteMakefile(
  NAME             => 'App::traveller',
  VERSION_FROM     => 'lib/App/traveller.pm',
  ABSTRACT_FROM    => 'lib/App/traveller.pm',
  AUTHOR           => 'Alex Schroeder',
  LICENSE          => 'agpl_3',
  MIN_PERL_VERSION => '5.26.0', # Modern::Perl '2018'
  EXE_FILES        => [
    'script/traveller',
  ],
  PREREQ_PM => {
    'Modern::Perl' => 1.20180701, # for '2018'
    'Mojolicious' => 9.00,       # removed tls_verify from Mojo::IOLoop::TLS 9.0
  },
  TEST_REQUIRES => {
    'Test::Memory::Cycle' => 0,
  },
  META_MERGE => {
    'meta-spec' => { version => 2 },
    resources => {
      repository => {
	type => 'git',

README.md  view on Meta::CPAN

perl Makefile.PL
make
make install
```

## Dependencies

Perl libraries you need to install if you want to run it:

* [Mojolicious](https://metacpan.org/pod/Mojolicious) or `libmojolicious-perl`
* [Modern::Perl](https://metacpan.org/pod/Modern::Perl) or `libmodern-perl-perl`

## Deployment

If you want to know more, see
[Mojolicious::Guides::Tutorial](https://metacpan.org/pod/Mojolicious::Guides::Tutorial),
[Mojolicious::Guides::Cookbook](https://metacpan.org/pod/Mojolicious::Guides::Cookbook),
[Mojo::Server::Hypnotoad](https://metacpan.org/pod/Mojo::Server::Hypnotoad),
and so on.

One way to do it, for `https://campaignwiki.org/traveller`:

lib/Traveller/Util.pm  view on Meta::CPAN

# version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.

package Traveller::Util;
use Modern::Perl;
require Exporter;
use POSIX qw(ceil);
our @ISA = qw(Exporter);
our @EXPORT_OK = qw(in distance nearby flush d);

# These global functions work on things that have x and y members.

sub in {
  my $item = shift;
  foreach (@_) {

script/traveller  view on Meta::CPAN

#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.

package Traveller;
use Traveller::Subsector;
use Traveller::Mapper::Classic::MPTS;
use Traveller::Mapper::Classic;
use Traveller::Mapper;
use Traveller::Util qw(flush);
use Modern::Perl;
use Mojolicious::Lite;
use POSIX qw(INT_MAX);
use utf8;

get '/' => sub {
  my $c = shift;
  $c->redirect_to('main');
};

get '/random' => sub {

t/basic.t  view on Meta::CPAN

# Foundation, either version 3 of the License, or (at your option) any later
# version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.

use Modern::Perl;
use Test::More;
use Test::Mojo;

# Note to self, this is how to print the actual result:
# die $t->get_ok('/')->tx->res->body;
# die $t->get_ok('/')->tx->res->headers->to_string;

require './script/traveller';

my $t = Test::Mojo->new();

t/memory.t  view on Meta::CPAN

# Foundation, either version 3 of the License, or (at your option) any later
# version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.

use Modern::Perl;
use Test::More;
use Test::Memory::Cycle;
use Traveller::Util qw(flush);

require './script/traveller';

my $subsector = Traveller::Subsector->new()->init(32, 40, 'mgp', 0.5);
my $uwp = $subsector->str;

like($uwp, qr/^\w+\s+\d+\s+[A-EX][0-9A-F]{5}[0-9A-K]-(\d|1\d)\s+/, "UWP");

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 1.439 second using v1.00-cache-2.02-grep-82fe00e-cpan-d29e8ade9f55 )