Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
209 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
use strict; | ||
use warnings FATAL => 'all'; | ||
use Module::Build; | ||
|
||
my $class = Module::Build->subclass( | ||
class => 'Module::Build::ArangoDB', | ||
code => <<'END_OF_CODE', | ||
sub ACTION_test { | ||
my $self = shift; | ||
require App::Prove; | ||
my $prove = App::Prove->new(); | ||
my @args = qw(--lib -Pt::lib::Prove::Plugin::StartArangoDB); | ||
push @args, @{$self->{properties}{test_files}}; | ||
$prove->process_args(@args); | ||
$prove->run(); | ||
} | ||
END_OF_CODE | ||
); | ||
|
||
my $build = $class->new( | ||
name => 'ArangoDB', | ||
module_name => 'ArangoDB', | ||
dist_author => 'Hideaki Ohno<hide.o.j55@gmail.com >', | ||
license => 'perl', | ||
recursive_test_files => 1, | ||
dynamic_config => 0, | ||
build_requires => { | ||
'Test::More' => '0.98', | ||
'Test::Harness' => '3.00', | ||
'Test::Fatal' => 0, | ||
'Test::Deep' => 0, | ||
'Test::TCP' => 0, | ||
'Test::Mock::Guard' => 0, | ||
'File::Temp' => 0, | ||
}, | ||
configure_requires => { 'Module::Build' => '0.38' }, | ||
requires => { | ||
'perl' => '5.008001', | ||
'parent' => 0, | ||
'Scalar::Util' => '1.19', | ||
'Class::Accessor::Lite' => '0.05', | ||
'Carp' => 0, | ||
'JSON' => '2.53', | ||
'List::MoreUtils' => 0, | ||
'Furl' => '0.38', | ||
'MIME::Base64' => 0, | ||
'Data::Util' => '0.59', | ||
}, | ||
recommands => { 'Data::Clone' => 0, }, | ||
no_index => { 'directory' => [ 't', 'xt', 'inc' ] }, | ||
test_files => ( -d '.git' || $ENV{RELEASE_TESTING} ) ? [qw(t/ xt/)] : ['t/'], | ||
create_readme => 1, | ||
create_makefile_pl => 'traditional', | ||
meta_merge => { | ||
keywords => [qw/arngodb database/], | ||
resources => { | ||
repository => 'git://github.com/hideo55/p5-ArangoDB.git', | ||
bugtracker => 'https://github.com/hideo55/p5-ArangoDB/issues', | ||
}, | ||
}, | ||
); | ||
$build->create_build_script(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,33 @@ | ||
use inc::Module::Install; | ||
name 'ArangoDB'; | ||
all_from 'lib/ArangoDB.pm'; | ||
|
||
requires 'parent'; | ||
requires 'Class::Accessor::Lite'; | ||
requires 'Carp'; | ||
requires 'JSON'; | ||
requires 'Scalar::Util'; | ||
requires 'List::MoreUtils'; | ||
requires 'Furl'; | ||
requires 'MIME::Base64'; | ||
requires 'Data::Util'; | ||
|
||
recommends 'Data::Clone'; | ||
|
||
tests 't/*.t'; | ||
author_tests 'xt'; | ||
|
||
test_requires 'Test::More' => '0.94'; | ||
test_requires 'Test::Harness' => '3.00'; | ||
test_requires 'Test::Fatal'; | ||
test_requires 'Test::TCP'; | ||
test_requires 'File::Temp'; | ||
test_requires 'Test::Deep'; | ||
test_requires 'Test::Mock::Guard'; | ||
|
||
auto_set_repository; | ||
auto_include; | ||
WriteAll; | ||
|
||
sub MY::test_via_harness {"\tprove --lib -Pt::lib::Prove::Plugin::StartArangoDB t\n"} | ||
# Note: this file was auto-generated by Module::Build::Compat version 0.4003 | ||
require 5.008001; | ||
use ExtUtils::MakeMaker; | ||
WriteMakefile | ||
( | ||
'PL_FILES' => {}, | ||
'INSTALLDIRS' => 'site', | ||
'test' => { | ||
'TESTS' => 't/*.t t/lib/*.t t/lib/Prove/*.t t/lib/Prove/Plugin/*.t' | ||
}, | ||
'VERSION_FROM' => 'lib/ArangoDB.pm', | ||
'PREREQ_PM' => { | ||
'Test::TCP' => 0, | ||
'Test::More' => '0.98', | ||
'Test::Harness' => '3.00', | ||
'Scalar::Util' => '1.19', | ||
'MIME::Base64' => 0, | ||
'Furl' => '0.38', | ||
'JSON' => '2.53', | ||
'Data::Util' => '0.59', | ||
'parent' => 0, | ||
'Test::Deep' => 0, | ||
'Class::Accessor::Lite' => '0.05', | ||
'Test::Mock::Guard' => 0, | ||
'Test::Fatal' => 0, | ||
'List::MoreUtils' => 0, | ||
'File::Temp' => 0, | ||
'Carp' => 0 | ||
}, | ||
'EXE_FILES' => [], | ||
'NAME' => 'ArangoDB' | ||
) | ||
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
NAME | ||
ArangoDB - ArangoDB client for Perl. | ||
|
||
SYNOPSIS | ||
use ArangoDB; | ||
|
||
my $db = ArangoDB->new({ | ||
host => 'localhost', | ||
port => 8529, | ||
keep_alive => 1, | ||
}); | ||
|
||
# Find or create collection | ||
my $foo = $db->foo; | ||
|
||
# Create new document | ||
$foo->save({ x => 42, y => { a => 1, b => 2, } }); | ||
$foo->save({ x => 1, y => { a => 1, b => 10, } }); | ||
$foo->name('new_name'); # rename the collection | ||
|
||
# Create hash index. | ||
$foo->create_hash_index([qw/x y/]); | ||
|
||
# Simple query | ||
my $cursor = $db->new_name->by_example({ b => 2 }); | ||
while( my $doc = $cursor->next ){ | ||
# do something | ||
} | ||
|
||
# AQL | ||
my $cur = $db->query( | ||
'FOR u IN users FILTER u.age > @age SORT u.name ASC RETURN u' | ||
)->bind( { age => 19 } )->execute(); | ||
|
||
DESCRIPTION | ||
ArangoDB is ArangoDB client for Perl. | ||
|
||
SUPPORT API VERSION | ||
This supports ArangoDB API implementation 1.01. | ||
|
||
METHODS | ||
new($options) | ||
Constructor. | ||
|
||
$options is HASH reference.The attributes of $options are: | ||
|
||
host | ||
Hostname or IP address of ArangoDB server. | ||
|
||
Default: localhost | ||
|
||
port | ||
Port number of ArangoDB server. | ||
|
||
Default: 8529 | ||
|
||
timeout | ||
Seconds of HTTP connection timeout. | ||
|
||
keep_alive | ||
If it is true, use HTTP Keep-Alive connection. | ||
|
||
Default: false | ||
|
||
auth_type | ||
Authentication method. Supporting "Basic" only. | ||
|
||
auth_user | ||
User name for authentication | ||
|
||
auth_passwd | ||
Password for authentication | ||
|
||
proxy | ||
Proxy url for HTTP connection. | ||
|
||
create($name) | ||
Create new collection. Returns instance of ArangoDB::Collection. | ||
|
||
find($name) | ||
Get a Collection based on $name. Returns instance of | ||
ArangoDB::Collection. | ||
|
||
If the collection does not exist, returns "undef". | ||
|
||
collection($name) | ||
Get or create a Collection based on $name. | ||
|
||
If the Collection $name does not exist, Create it. | ||
|
||
collections() | ||
Get all collections. Returns ARRAY reference. | ||
|
||
query($query) | ||
Get AQL statement handler. Returns instance of ArangoDB::Statement. | ||
|
||
AUTHOR | ||
Hideaki Ohno <hide.o.j55 {at} gmail.com> | ||
|
||
SEE ALSO | ||
ArangoDB websie <http://www.arangodb.org/> | ||
|
||
LICENSE | ||
This library is free software; you can redistribute it and/or modify it | ||
under the same terms as Perl itself. | ||
|
This file was deleted.
Oops, something went wrong.