Apache-Tika-Async

 view release on metacpan or  search on metacpan

META.json  view on Meta::CPAN

            "Future" : "0",
            "Future::HTTP" : "0",
            "JSON::XS" : "0",
            "Moo" : "2",
            "Try::Tiny" : "0",
            "perl" : "5.020"
         }
      },
      "test" : {
         "requires" : {
            "Data::Dumper" : "0",
            "Test::More" : "0"
         }
      }
   },
   "release_status" : "stable",
   "resources" : {
      "license" : [
         "https://dev.perl.org/licenses/"
      ],
      "repository" : {

META.yml  view on Meta::CPAN

---
abstract: 'connect to Apache Tika'
author:
  - 'Max Maischein <corion@cpan.org>'
build_requires:
  Data::Dumper: '0'
  ExtUtils::MakeMaker: '0'
  File::Basename: '0'
  File::Copy: '0'
  File::Find: '0'
  File::Path: '0'
  Test::More: '0'
configure_requires:
  ExtUtils::MakeMaker: '0'
dynamic_config: 0
generated_by: 'ExtUtils::MakeMaker version 7.44, CPAN::Meta::Converter version 2.150010'

Makefile.PL  view on Meta::CPAN

        # 'Filter::signatures' => 0.15, # we require 5.020 anyway
        'Carp'           => 0,
        'Future'         => 0,
        'Future::HTTP'   => 0,
        'Moo'            => 2,
        'Try::Tiny'      => 0,
        'JSON::XS'       => 0,
    },
    TEST_REQUIRES => {
        'Test::More'   => 0,
        'Data::Dumper' => 0,
    },

    dist                => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
    clean               => { FILES => "$distbase-*" },

    test            => { TESTS => join( ' ', @tests ) },
);

# This is so that we can do
#     require 'Makefile.PL'

README.mkdn  view on Meta::CPAN

Apache::Tika::Async - connect to Apache Tika

# SYNOPSIS

    use Apache::Tika::Async;

    my $tika= Apache::Tika::Async->new;

    my $fn= shift;

    use Data::Dumper;
    my $info = $tika->get_all( $fn );
    print Dumper $info->meta($fn);
    print $info->content($fn);
    # <html><body>...
    print $info->meta->{"meta:language"};
    # en

# ACCESSORS

## **jarfile**

bin/script.pl  view on Meta::CPAN

use strict;
use Apache::Tika::Server;
use Getopt::Long;
use File::Basename;
use File::Spec;

GetOptions(
    'jar|j=s' => \my $tika_path,
);

use Data::Dumper;

if( ! $tika_path ) {
    my $tika_glob = File::Spec->rel2abs( dirname($0) ) . '/../jar/*.jar';
    $tika_path = Apache::Tika::Async->best_jar_file(glob $tika_glob);
    die "Tika not found in '$tika_glob'" unless $tika_path and -f $tika_path; 
}

my $tika= Apache::Tika::Server->new(
    jarfile => $tika_path,
    #connection_class => 'Apache::Tika::Connection::LWP',

lib/Apache/Tika/Async.pm  view on Meta::CPAN

Apache::Tika::Async - connect to Apache Tika

=head1 SYNOPSIS

  use Apache::Tika::Async;

  my $tika= Apache::Tika::Async->new;

  my $fn= shift;

  use Data::Dumper;
  my $info = $tika->get_all( $fn );
  print Dumper $info->meta($fn);
  print $info->content($fn);
  # <html><body>...
  print $info->meta->{"meta:language"};
  # en

=head1 ACCESSORS

=cut

lib/Apache/Tika/Server.pm  view on Meta::CPAN

package Apache::Tika::Server;
use strict;
use Carp qw(croak);
use Moo 2;
use Apache::Tika::DocInfo;
use Data::Dumper;
use Future;
# Consider if we really want/need it, instead of simply staying
# callback-based
#use Future::AsyncAwait;

#use Filter::signatures;
use feature 'signatures';
no warnings 'experimental::signatures';

=head1 NAME

lib/Apache/Tika/Server.pm  view on Meta::CPAN

  use Apache::Tika::Server;

  # Launch our own Apache Tika instance
  my $tika= Apache::Tika::Server->new(
      jarfile => $tika_path,
  );
  $tika->launch;

  my $fn= shift;

  use Data::Dumper;
  my $info = $tika->get_all( $fn );
  print Dumper $info->meta($fn);
  print $info->content($fn);
  # <html><body>...
  print $info->meta->{"meta:language"};
  # en

=cut

our $VERSION = '0.11';

xt/99-test-prerequisites.t  view on Meta::CPAN

#!perl -w

use warnings;
use strict;
use Test::More;
use Data::Dumper;
use File::Find;

=head1 DESCRIPTION

This test checks whether all tests still pass when the optional test
prerequisites for the test are not present.

This is done by using L<Test::Without::Module> to rerun the test while excluding
the optional prerequisite.



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