Skip to content

Commit

Permalink
Starting work on dzil version of Acme::Math::XS
Browse files Browse the repository at this point in the history
  • Loading branch information
ingydotnet committed Nov 14, 2014
0 parents commit 34381e4
Show file tree
Hide file tree
Showing 8 changed files with 190 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]+/
5 changes: 5 additions & 0 deletions Changes
@@ -0,0 +1,5 @@
---
version: 0.0.1
date: Fri Nov 14 20:47:54 UTC 2014
changes:
- First Release
48 changes: 48 additions & 0 deletions dist.ini
@@ -0,0 +1,48 @@
name = Alt-Acme-Math-XS-DistZilla
abstract = Dist::Zilla version of Acme::Math::XS
author = Ingy döt Net <ingy@cpan.org>
license = Perl_5
copyright_holder = Ingy döt Net
version = 0.0.1

[@Filter]
-bundle = @Basic
-remove = MakeMaker
[ChangesFromYaml]
;[ReadmeFromPod]
;filename = lib/Zilla/Dist.pod
[MetaJSON]



; Add this section to support Inline::Module:


; I want people to add these lines, then I get the arg 'module' from inside
; Dist::Zilla::Plugin::InlineModule and do stuff.
[InlineModule]
module = Acme::Math::XS
; [InlineModule::MakeMaker]




[@Git]
[GithubMeta]
user = ingydotnet
issues = 1

[Prereqs]
perl = v5.8.1

[PodSyntaxTests]
[Prereqs / TestRequires]

[PruneFiles]
filename = dist.ini

[MetaNoIndex]
directory = inc
directory = t
directory = xt
directory = example
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;
46 changes: 46 additions & 0 deletions lib/Acme/Math/XS.pod
@@ -0,0 +1,46 @@
=pod

=for comment
DO NOT EDIT. This Pod was generated by Swim v0.1.30.
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
14 changes: 14 additions & 0 deletions lib/Acme/Math/XS/Inline.pm
@@ -0,0 +1,14 @@
# DO NOT EDIT
#
# GENERATED BY: Inline::Module 0.11
#
# 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).

use strict; use warnings;
package Acme::Math::XS::Inline;
use base 'Inline';
use Inline::Module 'v1' => '0.11';

1;
2 changes: 2 additions & 0 deletions lib/Alt/Acme/Math/XS/DistZilla.pm
@@ -0,0 +1,2 @@
package lib::Alt::Acme::Math::XS::DistZilla;
our $VERSION = '0.0.1';
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 34381e4

Please sign in to comment.