Acme-Free-Advice

 view release on metacpan or  search on metacpan

META.json  view on Meta::CPAN

         "author",
         "builder"
      ]
   },
   "optional_features" : {
      "json" : {
         "description" : "-json support in advice.pl",
         "prereqs" : {
            "runtime" : {
               "requires" : {
                  "JSON::Tiny" : "0.58"
               }
            }
         }
      }
   },
   "prereqs" : {
      "configure" : {
         "requires" : {
            "Archive::Tar" : "0",
            "CPAN::Meta" : "0",

META.json  view on Meta::CPAN

         "web" : "https://github.com/sanko/Acme-Free-Advice/issues"
      },
      "homepage" : "https://github.com/sanko/Acme-Free-Advice",
      "repository" : {
         "type" : "git",
         "url" : "https://github.com/sanko/Acme-Free-Advice.git",
         "web" : "https://github.com/sanko/Acme-Free-Advice"
      }
   },
   "version" : "1.1",
   "x_serialization_backend" : "JSON::PP version 4.16",
   "x_static_install" : 1
}

META.yml  view on Meta::CPAN

  directory:
    - t
    - xt
    - eg
    - author
    - builder
optional_features:
  json:
    description: '-json support in advice.pl'
    requires:
      JSON::Tiny: '0.58'
provides:
  Acme::Free::Advice:
    file: lib/Acme/Free/Advice.pm
    version: '1.1'
requires:
  Acme::Free::Advice::Slip: '0'
  Acme::Free::Advice::Unsolicited: '0'
  Getopt::Long: '0'
  perl: v5.38.0
resources:

cpanfile  view on Meta::CPAN

requires 'perl', '5.038000';
requires 'Getopt::Long';
requires 'Acme::Free::Advice::Slip';
requires 'Acme::Free::Advice::Unsolicited';
feature json => '-json support in advice.pl' => sub {
    requires 'JSON::Tiny' => '0.58';
};
on 'test' => sub {
    requires 'Test2::V0' => 0.000159;
    requires 'Capture::Tiny';
};
on 'configure' => sub {
    requires 'Archive::Tar';
    requires 'CPAN::Meta';
    requires 'ExtUtils::Config'  => 0.003;
    requires 'ExtUtils::Helpers' => 0.020;

script/advice.pl  view on Meta::CPAN

#~ @ARGV = qw[-unsolicited];
#~ @ARGV = qw[-unsolicited -json];
#~ @ARGV = qw[-slip];
#~ @ARGV = qw[-slip -json];
#~ @ARGV = qw[-flavors];
#
my $raw = 0;
my $flavor;

sub _echo ($advice) {
    $raw && eval 'require JSON::Tiny' ? JSON::Tiny::encode_json( {%$advice} ) : $advice;
}
GetOptions(
    \my %h, 'language=s',
    'help'         => sub { pod2usage( -exitval => 1 ) },
    'flavors!'     => sub { exit !say 'Supported advice flavors: ' . join ', ', Acme::Free::Advice::flavors() },
    'json!'        => \$raw,
    'slip!'        => sub { $flavor = 'slip' },
    'unsolicited!' => sub { $flavor = 'unsolicited' }
);
my $advice = Acme::Free::Advice::advice($flavor);

script/advice.pl  view on Meta::CPAN

=head1 SYNOPSIS

    advice                               # generate a random advice
    advice -json                         # grab advice if you're a robot
    advice -slip                         # generate an advice slip
    advice -unsolicited                  # generate unsolicited advice from Kevin Kelly
    advice -help                         # get help

=head1 OPTIONS

    -json               Echo raw JSON encoded data
    -flavors            List supported advice flavors
    -slip               Generate an advice with Acme::Free::Advice::Slip
    -unsolicited        Generate an advice with Acme::Free::Advice::Unsolicited
    -help               Display this help message

=head1 DESCRIPTION

This script wraps Acme::Free::Advice.

=head1 LICENSE & LEGAL



( run in 1.292 second using v1.01-cache-2.11-cpan-cdf2f3d4e48 )