Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ingydotnet committed Dec 22, 2014
0 parents commit 821c2c8
Show file tree
Hide file tree
Showing 12 changed files with 352 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .travis.yml
@@ -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]+/
62 changes: 62 additions & 0 deletions Changes
@@ -0,0 +1,62 @@
---
version: 0.0.12
date: Sun Dec 21 00:36:05 EST 2014
changes:
- Add dev prereqs to Makefile.PL
---
version: 0.0.11
date: Thu Dec 18 18:59:44 PST 2014
changes:
- Fix MANIFEST.SKIP
---
version: 0.0.10
date: Thu Dec 18 18:08:58 PST 2014
changes:
- Build to work on MSWin32
- Remove master/ and .travis.yml from dist
- Update pod
---
version: 0.0.9
date: Wed Dec 17 23:49:19 PST 2014
changes:
- Update README
---
version: 0.0.8
date: Wed Dec 17 23:25:55 PST 2014
changes:
- Release with Inline-Module-0.26
---
version: 0.0.7
date: Tue Dec 16 23:37:39 EST 2014
changes:
- Rebuild with new Inline::Module to avoid test failures
---
version: 0.0.6
date: Sun Dec 14 22:20:03 PST 2014
changes:
- Release using latest Inline::Module
---
version: 0.0.5
date: Sat Dec 6 14:16:37 PST 2014
changes:
- Release using new autostub technique
---
version: 0.0.4
date: Sat Nov 22 05:06:27 UTC 2014
changes:
- Use new postamble style Inline::Module in Makefile.PL
---
version: 0.0.3
date: Wed Nov 19 06:32:20 UTC 2014
changes:
- Inline::Module::MakeMaker changed to Inline::Module in Makefile.PL
---
version: 0.0.2
date: Wed Nov 19 06:32:02 UTC 2014
changes:
- Second Release
---
version: 0.0.1
date: Wed Nov 19 04:55:09 UTC 2014
changes:
- First Release
8 changes: 8 additions & 0 deletions MANIFEST.SKIP
@@ -0,0 +1,8 @@
.git/
.travis.yml$
_build/
Build
Makefile$
MANIFEST.SKIP$
MANIFEST.bak$
MYMETA
37 changes: 37 additions & 0 deletions Makefile.PL
@@ -0,0 +1,37 @@
use 5.008001; use strict; use warnings; use utf8;

use lib 'inc';
use ExtUtils::MakeMaker;
use Inline::Module;

WriteMakefile(
NAME => 'Alt::Acme::Math::XS::EUMM',
VERSION => '0.0.12',
ABSTRACT => 'Math is HARD (faster!)',
AUTHOR => 'Ingy döt Net <ingy@cpan.org>',
LICENSE => 'perl',
MIN_PERL_VERSION => '5.008001',
test => { TESTS => 't/*.t' },
META_MERGE => {
'meta-spec' => { version => 2 },
prereqs => {
develop => {
requires => {
'Inline::CPP' => '0.69',
'Inline::Module' => '0.27',
},
},
},
no_index => {
directory => [
'inc',
'lib/Acme',
],
},
},
postamble => {
inline => {
module => 'Acme::Math::XS',
},
},
);
59 changes: 59 additions & 0 deletions README
@@ -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>

7 changes: 7 additions & 0 deletions lib/Acme/Math/XS.c
@@ -0,0 +1,7 @@
long add(long a, long b) {
return a + b;
}

long subtract(long a, long b) {
return a - b;
}
13 changes: 13 additions & 0 deletions lib/Acme/Math/XS.pm
@@ -0,0 +1,13 @@
use strict; use warnings;
package Acme::Math::XS;
# our $VERSION = '0.0.12';

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

use Acme::Math::XS::Inline C => 'lib/Acme/Math/XS.c';

1;
92 changes: 92 additions & 0 deletions lib/Acme/Math/XS.pod
@@ -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. 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
16 changes: 16 additions & 0 deletions lib/Acme/Math/XS/Inline.pm
@@ -0,0 +1,16 @@
# DO NOT EDIT
#
# GENERATED BY: Inline::Module 0.24
#
# This module is for author-side development only. When this module is shipped
# to CPAN, it will be automagically replaced with content that does not
# require any Inline framework modules (or any other non-core modules).
#
# To regenerate this stub module, run this command:
#
# perl -MInline::Module=makestub,Acme::Math::XS::Inline

use strict; use warnings;
package Acme::Math::XS::Inline;
use Inline::Module stub => 'v2';
1;
2 changes: 2 additions & 0 deletions lib/Alt/Acme/Math/XS/EUMM.pm
@@ -0,0 +1,2 @@
package Alt::Acme::Math::XS::EUMM;
our $VERSION = '0.0.12';
2 changes: 2 additions & 0 deletions lib/Alt/Acme/Math/XS/External.pm
@@ -0,0 +1,2 @@
package Alt::Acme::Math::XS::EUMM;
our $VERSION = '0.0.12';
8 changes: 8 additions & 0 deletions t/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 821c2c8

Please sign in to comment.