Skip to content

Commit

Permalink
Remake master as a top level pointer branch.
Browse files Browse the repository at this point in the history
  • Loading branch information
ingydotnet committed Nov 16, 2014
0 parents commit f9fef91
Show file tree
Hide file tree
Showing 6 changed files with 151 additions and 0 deletions.
40 changes: 40 additions & 0 deletions About
@@ -0,0 +1,40 @@
This repository has several branches, that support several different (but
similar) CPAN distributions:

- `xs`

[Acme::Math::XS] is a plain old XS version.


- `eumm`

[Alt::Acme::Math::XS::EUMM] is a version written using [Inline::Module] and
[Inline::C] that uses the plain old [ExtUtils::MakeMaker] module framework.

- `dzil`

[Alt::Acme::Math::XS::DistZilla] is a version that uses the [Dist::Zilla]
module framework.

- `m-b`

[Alt::Acme::Math::XS::ModuleBuild] is a version that uses the [Module::Build]
module framework.

- `m-i`

[Alt::Acme::Math::XS::ModuleInstall] is a version that uses the
[Module::Install] module framework.

- `zild`

[Alt::Acme::Math::XS::ZillaDist] is a version that uses the [ZillaDist]
module framework.

- `cpp`

[Alt::Acme::Math::XS::CPP] is a version written using [Inline::Module] and
[Inline::CPP] (C++) (and [ExtUtils::MakeMaker]).

The `master` branch just has the code, doc and tests that should be shared by
every other branch.
6 changes: 6 additions & 0 deletions Makefile
@@ -0,0 +1,6 @@
default:

doc: ReadMe.pod

ReadMe.pod: doc/Acme/Math/XS.swim
swim --pod-cpan $< > $@
46 changes: 46 additions & 0 deletions ReadMe.pod
@@ -0,0 +1,46 @@
=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>
<a href="https://coveralls.io/r/ingydotnet/acme-math-xs-pm?branch=master"><img src="https://coveralls.io/repos/ingydotnet/acme-math-xs-pm/badge.png" alt="acme-math-xs-pm"></a>

=head1 SYNOPSIS

use Acme::Math::XS;

print "2 + 2 = ${\add(2, 2)}\n";

=head1 DESCRIPTION

This is the smallest possible XS module written with Inline::C.

=head1 AUTHORS

=over

=item * Ingy döt Net <ingy@cpan.org>

=item * David Oswald <davido@cpan.org>

=back

=head1 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 L<http://www.perl.com/perl/misc/Artistic.html>

=cut
30 changes: 30 additions & 0 deletions doc/Acme/Math/XS.swim
@@ -0,0 +1,30 @@
Acme::Math::XS
==============

Math is HARD (faster)

<badge travis coveralls ingydotnet/acme-math-xs-pm>

= Synopsis

use Acme::Math::XS;

print "2 + 2 = ${\add(2, 2)}\n";

= Description

This is the smallest possible XS module written with Inline::C.

= 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
21 changes: 21 additions & 0 deletions lib/Acme/Math/XS.pm
@@ -0,0 +1,21 @@
use strict; use warnings;
package Acme::Math::XS;
our $VERSION = '0.0.6';

use Exporter 'import';
our @EXPORT = qw(
add
subtract
);

use Acme::Math::XS::Inline C => <<'...';
long add(long a, long b) {
return a + b;
}
long subtract(long a, long b) {
return a - b;
}
...

1;
8 changes: 8 additions & 0 deletions test/test.t
@@ -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;

0 comments on commit f9fef91

Please sign in to comment.