Game-HexDescribe

 view release on metacpan or  search on metacpan

META.json  view on Meta::CPAN

            "ExtUtils::MakeMaker" : "6.52",
            "File::ShareDir::Install" : "0"
         }
      },
      "runtime" : {
         "requires" : {
            "Array::Utils" : "0",
            "File::ShareDir" : "0",
            "IO::Socket::SSL" : "0",
            "List::MoreUtils" : "0",
            "Modern::Perl" : "1.20180701",
            "Mojolicious" : "0",
            "Role::Tiny" : "0",
            "Text::Autoformat" : "0",
            "perl" : "5.026000",
            "strict" : "0",
            "warnings" : "0"
         }
      }
   },
   "release_status" : "stable",

META.yml  view on Meta::CPAN

name: Game-HexDescribe
no_index:
  directory:
    - t
    - inc
requires:
  Array::Utils: '0'
  File::ShareDir: '0'
  IO::Socket::SSL: '0'
  List::MoreUtils: '0'
  Modern::Perl: '1.20180701'
  Mojolicious: '0'
  Role::Tiny: '0'
  Text::Autoformat: '0'
  perl: '5.026000'
  strict: '0'
  warnings: '0'
resources:
  repository: https://alexschroeder.ch/cgit/hex-describe
version: 1.03
x_serialization_backend: 'CPAN::Meta::YAML version 0.018'

Makefile.PL  view on Meta::CPAN

use File::ShareDir::Install;

install_share 'share';

WriteMakefile(
  NAME             => 'Game::HexDescribe',
  VERSION_FROM     => 'lib/Game/HexDescribe.pm',
  ABSTRACT_FROM    => 'lib/Game/HexDescribe.pm',
  AUTHOR           => 'Alex Schroeder',
  LICENSE          => 'agpl_3',
  MIN_PERL_VERSION => '5.26.0', # Modern::Perl '2018'
  EXE_FILES        => [
    'script/hex-describe',
  ],
  PREREQ_PM => {
    'strict' => 0,
    'warnings' => 0,
    'Modern::Perl' => 1.20180701, # for '2018'
    'Mojolicious' => 0,
    'Array::Utils' => 0,
    'List::MoreUtils' => 0,
    'Text::Autoformat' => 0,
    'File::ShareDir' => 0,
    'Role::Tiny' => 0,
    'IO::Socket::SSL' => 0, # if text-mapper requires https
  },
  CONFIGURE_REQUIRES => {
    'ExtUtils::MakeMaker' => '6.52',

README.md  view on Meta::CPAN

[Help](https://campaignwiki.org/hex-describe/help) link.

## Dependencies

Perl Modules (or Debian modules):

* Array::Utils or libarray-utils-perl
* IO::Socket::SSL or libio-socket-ssl-perl
* LWP::UserAgent or liblwp-useragent-perl
* List::MoreUtils or liblist-moreutils-perl
* Modern::Perl or libmodern-perl-perl
* Mojolicious or libmojolicious-perl
* Text::Autoformat or libtext-autoformat-perl
* File::ShareDir or libfile-sharedir-perl
* File::ShareDir::Install or libfile-sharedir-install-perl

The IO::Socket::SSL dependency means that you’ll need OpenSSL
development libraries installed as well: openssl-devel or equivalent,
depending on your package manager.

To install from the working directory (which will also install all the

lib/Game/HexDescribe.pm  view on Meta::CPAN

framework. This class in particular uses L<Mojolicious::Lite>.

See L<Mojolicious::Guides> for more information.

=cut

package Game::HexDescribe;

our $VERSION = 1.03;

use Modern::Perl;
use Mojolicious::Lite;
use Mojo::UserAgent;
use Mojo::Util qw(html_unescape);
use Mojo::ByteStream;
use Game::HexDescribe::Utils qw(init describe_text parse_table load_table
				describe_map parse_map load_map markdown);
use Game::HexDescribe::Log;
use Encode qw(decode_utf8);
use File::ShareDir qw(dist_dir);
use Cwd;

lib/Game/HexDescribe/Command/rule.pm  view on Meta::CPAN

C<hex-describe rule --table=schroeder --rule="orcs" --limit=1>

Print ten orc names:

C<hex-describe rule --table=schroeder --rule="orc name" --separator=\n

=cut

package Game::HexDescribe::Command::rule;

use Modern::Perl '2018';
use Mojo::Base 'Mojolicious::Command';
use Pod::Simple::Text;
use Getopt::Long qw(GetOptionsFromArray);
use Game::HexDescribe::Utils qw(markdown describe_text parse_table load_table list_tables);
use Role::Tiny;
binmode(STDOUT, ':utf8');

has description => 'Print the output of a rule to STDOUT';

has usage => sub { my $self = shift; $self->extract_usage };

lib/Game/HexDescribe/Utils.pm  view on Meta::CPAN


=cut

package Game::HexDescribe::Utils;
require Exporter;
our @ISA = qw(Exporter);
our @EXPORT_OK = qw(init markdown describe_text list_tables parse_table load_table
		    describe_map parse_map load_map);
use Text::Autoformat;
use Game::HexDescribe::Log;
use Modern::Perl;
use Mojo::URL;
use Mojo::File;
use List::Util qw(shuffle);
use Array::Utils qw(intersect);
use Encode qw(decode_utf8);
use utf8;

my $log = Game::HexDescribe::Log->get;

our $face_generator_url;

script/hex-describe  view on Meta::CPAN

=head1 SEE ALSO

For more information, see <Game::HexDescribe>.

=head1 LICENSE

GNU Affero General Public License

=cut

use Modern::Perl;
use FindBin;
use lib "$FindBin::Bin/../lib";
require Game::HexDescribe;

t/basic.t  view on Meta::CPAN

# 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 Affero General Public License for more
# details.
#
# You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see <https://www.gnu.org/licenses/>.

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

# No networking.
$ENV{HEX_DESCRIBE_OFFLINE} = 1;
my $t = Test::Mojo->new('Game::HexDescribe');

$t->get_ok('/')
    ->status_is(200)

t/markdown.t  view on Meta::CPAN

# 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 Affero General Public License for more
# details.
#
# You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see <https://www.gnu.org/licenses/>.

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

# No networking.
$ENV{HEX_DESCRIBE_OFFLINE} = 1;
my $t = Test::Mojo->new('Game::HexDescribe');

$t->post_ok('/describe' => form => {map => "0101 water\n", markdown => "on", load => "schroeder"})
    ->status_is(200)

t/rule.t  view on Meta::CPAN

# 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 Affero General Public License for more
# details.
#
# You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see <https://www.gnu.org/licenses/>.

use Modern::Perl;
use Test::More;
use IPC::Open2;
use Mojo::DOM;
use Test::Mojo;
use Mojo::File;

my $script = Mojo::File->new('script', 'hex-describe');

# random



( run in 0.816 second using v1.01-cache-2.11-cpan-4d50c553e7e )