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
0 parents
commit 643c105
Showing
9 changed files
with
281 additions
and
0 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,46 @@ | ||
# DO NOT EDIT | ||
# | ||
# This .travis.yml file generated by Zilla::Dist. To upgrade it, run: | ||
# | ||
# > make update | ||
# | ||
|
||
language: perl | ||
|
||
perl: | ||
- '5.20' | ||
- '5.18' | ||
- '5.16' | ||
- '5.14' | ||
- '5.12' | ||
- '5.10' | ||
- '5.8' | ||
|
||
install: | ||
- cpanm --quiet --notest | ||
Devel::Cover::Report::Coveralls | ||
Inline | ||
Inline::C | ||
|
||
script: | ||
- test -e test && | ||
PERL5OPT=-MDevel::Cover=-coverage,statement,branch,condition,path,subroutine | ||
prove -lv test/ | ||
|| true | ||
- test -e test && cover || true | ||
|
||
after_success: | ||
- cover -report coveralls | ||
|
||
notifications: | ||
irc: | ||
channels: | ||
- irc.perl.org#inline | ||
on_success: change | ||
on_failure: always | ||
skip_join: true | ||
|
||
# Hack to not run on tag pushes: | ||
branches: | ||
except: | ||
- /^v?[0-9]+\.[0-9]+/ |
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,5 @@ | ||
--- | ||
version: 0.0.1 | ||
date: Tue Jan 13 18:09:21 PST 2015 | ||
changes: | ||
- First Release |
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,8 @@ | ||
.git/ | ||
.travis.yml$ | ||
_build/ | ||
Build | ||
Makefile$ | ||
MANIFEST.SKIP$ | ||
MANIFEST.bak$ | ||
MYMETA |
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,39 @@ | ||
use 5.008001; use strict; use warnings; use utf8; | ||
|
||
use lib 'inc'; | ||
use ExtUtils::MakeMaker; | ||
use Inline::Module; | ||
|
||
my $alt = $ENV{PERL_ALT_INSTALL} || ''; | ||
WriteMakefile( | ||
NAME => 'Alt::Acme::Math::XS::EUMM', | ||
VERSION => '0.0.16', | ||
ABSTRACT => 'Math is HARD (faster!)', | ||
AUTHOR => 'Ingy döt Net <ingy@cpan.org>', | ||
LICENSE => 'perl', | ||
MIN_PERL_VERSION => '5.008001', | ||
test => { TESTS => 't/*.t' }, | ||
postamble => { | ||
inline => { | ||
module => 'Acme::Math::XS', | ||
makestub => 1, | ||
}, | ||
}, | ||
META_MERGE => { | ||
'meta-spec' => { version => 2 }, | ||
prereqs => { | ||
develop => { | ||
requires => { | ||
'Inline::C' => '0.68', | ||
}, | ||
}, | ||
}, | ||
no_index => { | ||
directory => [ | ||
'inc', | ||
'lib/Acme', | ||
], | ||
}, | ||
}, | ||
DESTDIR => $alt ? $alt eq 'OVERWRITE' ? '' : $alt : 'no-install-alt', | ||
); |
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,59 @@ | ||
NAME | ||
Acme::Math::XS - Math is HARD (faster!) | ||
|
||
SYNOPSIS | ||
use Acme::Math::XS; | ||
|
||
print "2 + 2 = ${\add(2, 2)}\n"; | ||
|
||
DESCRIPTION | ||
This is a tiny example "XS" module. It was written to show how one would | ||
write the same thing using Inline::Module, Inline, Inline::C and | ||
Inline::CPP. | ||
|
||
It has a pure "XS" version and "Alt"(ternate) modules for all the common | ||
CPAN module frameworks. | ||
|
||
The source code for all these modules is in one git repository, on | ||
separate branches: <https://github.com/ingydotnet/acme-math-xs-pm> | ||
|
||
SEE | ||
Acme::Math::XS | ||
Pure XS version, shipped with ExtUtils::MakeMaker. | ||
|
||
Alt::Acme::Math::XS::EUMM | ||
Inline::Module (using Inline::C) version shipped with plain old | ||
ExtUtils::MakeMaker. | ||
|
||
Alt::Acme::Math::XS::DistZilla | ||
Inline::Module version shipped with Dist::Zilla and | ||
Dist::Zilla::Plugin::InlineModule. | ||
|
||
Alt::Acme::Math::XS::ZillaDist | ||
Inline::Module version shipped with Zilla::Dist. | ||
|
||
Alt::Acme::Math::XS::ModuleBuild | ||
Inline::Module version shipped with Module::Build and | ||
Module::Build::InlineModule. | ||
|
||
Alt::Acme::Math::XS::ModuleInstall | ||
Inline::Module version shipped with Module::Build and | ||
Module::Build::InlineModule. | ||
|
||
Alt::Acme::Math::XS::CPP | ||
Inline::Module (using Inline::CPP) version shipped with | ||
ExtUtils::MakeMaker. | ||
|
||
AUTHORS | ||
* Ingy döt Net <ingy@cpan.org> | ||
|
||
* David Oswald <davido@cpan.org> | ||
|
||
COPYRIGHT | ||
Copyright 2014. Ingy döt Net. | ||
|
||
This program is free software; you can redistribute it and/or modify it | ||
under the same terms as Perl itself. | ||
|
||
See <http://www.perl.com/perl/misc/Artistic.html> | ||
|
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,22 @@ | ||
use strict; use warnings; | ||
package Acme::Math::XS; | ||
# our $VERSION = 'x.x.x'; | ||
use Alt::Acme::Math::XS::EUMM; | ||
|
||
use Exporter 'import'; | ||
our @EXPORT = qw( | ||
add | ||
subtract | ||
); | ||
|
||
use Inline::Module::LeanDist C => <<'...'; | ||
long add(long a, long b) { | ||
return a + b; | ||
} | ||
long subtract(long a, long b) { | ||
return a - b; | ||
} | ||
... | ||
|
||
1; |
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,92 @@ | ||
=pod | ||
|
||
=for comment | ||
DO NOT EDIT. This Pod was generated by Swim v0.1.31. | ||
See http://github.com/ingydotnet/swim-pm#readme | ||
|
||
=encoding utf8 | ||
|
||
=head1 NAME | ||
|
||
Acme::Math::XS - Math is HARD (faster!) | ||
|
||
=for html | ||
<a href="https://travis-ci.org/ingydotnet/acme-math-xs-pm"><img src="https://travis-ci.org/ingydotnet/acme-math-xs-pm.png" alt="acme-math-xs-pm"></a> | ||
|
||
=head1 SYNOPSIS | ||
|
||
use Acme::Math::XS; | ||
|
||
print "2 + 2 = ${\add(2, 2)}\n"; | ||
|
||
=head1 DESCRIPTION | ||
|
||
This is a tiny example "XS" module. It was written to show how one would write | ||
the same thing using L<Inline::Module>, L<Inline>, L<Inline::C> and | ||
L<Inline::CPP>. | ||
|
||
It has a pure "XS" version and "Alt"(ternate) modules for all the common CPAN | ||
module frameworks. | ||
|
||
The source code for all these modules is in one git repository, on separate | ||
branches: <https://github.com/ingydotnet/acme-math-xs-pm> | ||
|
||
=head1 SEE | ||
|
||
=over | ||
|
||
=item L<Acme::Math::XS> | ||
|
||
Pure XS version, shipped with L<ExtUtils::MakeMaker>. | ||
|
||
=item L<Alt::Acme::Math::XS::EUMM> | ||
|
||
L<Inline::Module> (using L<Inline::C>) version shipped with plain old | ||
L<ExtUtils::MakeMaker>. | ||
|
||
=item L<Alt::Acme::Math::XS::DistZilla> | ||
|
||
L<Inline::Module> version shipped with L<Dist::Zilla> and | ||
L<Dist::Zilla::Plugin::InlineModule>. | ||
|
||
=item L<Alt::Acme::Math::XS::ZillaDist> | ||
|
||
L<Inline::Module> version shipped with L<Zilla::Dist>. | ||
|
||
=item L<Alt::Acme::Math::XS::ModuleBuild> | ||
|
||
L<Inline::Module> version shipped with L<Module::Build> and | ||
L<Module::Build::InlineModule>. | ||
|
||
=item L<Alt::Acme::Math::XS::ModuleInstall> | ||
|
||
L<Inline::Module> version shipped with L<Module::Build> and | ||
L<Module::Build::InlineModule>. | ||
|
||
=item L<Alt::Acme::Math::XS::CPP> | ||
|
||
L<Inline::Module> (using L<Inline::CPP>) version shipped with | ||
L<ExtUtils::MakeMaker>. | ||
|
||
=back | ||
|
||
=head1 AUTHORS | ||
|
||
=over | ||
|
||
=item * Ingy döt Net <ingy@cpan.org> | ||
|
||
=item * David Oswald <davido@cpan.org> | ||
|
||
=back | ||
|
||
=head1 COPYRIGHT | ||
|
||
Copyright 2014-2015. Ingy döt Net. | ||
|
||
This program is free software; you can redistribute it and/or modify it under | ||
the same terms as Perl itself. | ||
|
||
See L<http://www.perl.com/perl/misc/Artistic.html> | ||
|
||
=cut |
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,2 @@ | ||
package Alt::Acme::Math::XS::LeanDist; | ||
our $VERSION = '0.0.1'; |
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,8 @@ | ||
use Test::More; | ||
|
||
use Acme::Math::XS; | ||
|
||
is add(2, 2), 4, 'Addition works'; | ||
is subtract(3, 2), 1, 'Subtraction works'; | ||
|
||
done_testing; |