Skip to content

Commit

Permalink
0.01
Browse files Browse the repository at this point in the history
  • Loading branch information
ingydotnet committed Nov 22, 2014
1 parent 6589e52 commit adfd619
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 68 deletions.
2 changes: 1 addition & 1 deletion Changes
@@ -1,5 +1,5 @@
---
version: 0.01
date: Tue Nov 18 18:43:42 UTC 2014
date: Sat Nov 22 07:08:31 UTC 2014
changes:
- Initial release
26 changes: 15 additions & 11 deletions ReadMe.pod
Expand Up @@ -8,32 +8,36 @@ See http://github.com/ingydotnet/swim-pm#readme

=head1 NAME

Module::Install::TestML - Module::Install Support for TestML
Module::Install::InlineModule - Module::Install Support for Inline::Module

=head1 SYNOPSIS

use inc::Module::Install;

name 'Foo';
all_from 'lib/Foo.pm';
name 'Foo-Bar';
all_from 'lib/Foo/Bar.pm';

use_testml_tap;
inline module => 'Foo::Bar';

WriteAll;

=head1 DESCRIPTION

This module adds the C<use_testml_tap> directive to Module::Install.
This module adds the C<inline> directive to Module::Install.

Now you can get full TestML support for your module with no external
dependency on TestML.
You can use it to ship Inline::Module based modules.

Just add this line to your Makefile.PL:
=head1 SEE

use_testml_tap;
=over

That's it. Really. Now Test::Base is bundled into your module, so that it is
no longer any burden on the person installing your module.
=item * L<Inline::Module>

=item * L<Module::Install>

=item * L<Alt::Acme::Math::XS::ModuleInstall>

=back

=head1 AUTHOR

Expand Down
26 changes: 12 additions & 14 deletions doc/Module/Install/InlineModule.swim
@@ -1,32 +1,30 @@
Module::Install::TestML
=======================
Module::Install::InlineModule
=============================

Module::Install Support for TestML
Module::Install Support for Inline::Module

= Synopsis

use inc::Module::Install;

name 'Foo';
all_from 'lib/Foo.pm';
name 'Foo-Bar';
all_from 'lib/Foo/Bar.pm';

use_testml_tap;
inline module => 'Foo::Bar';

WriteAll;

= Description

This module adds the `use_testml_tap` directive to Module::Install.
This module adds the `inline` directive to Module::Install.

Now you can get full TestML support for your module with no external
dependency on TestML.
You can use it to ship Inline::Module based modules.

Just add this line to your Makefile.PL:
= See

use_testml_tap;

That's it. Really. Now Test::Base is bundled into your module, so that it is
no longer any burden on the person installing your module.
* [Inline::Module]
* [Module::Install]
* [Alt::Acme::Math::XS::ModuleInstall]

= Author

Expand Down
54 changes: 12 additions & 42 deletions lib/Module/Install/InlineModule.pm
Expand Up @@ -3,53 +3,23 @@ package Module::Install::InlineModule;
our $VERSION = '0.01';

use base 'Module::Install::Base';
use Inline::Module;

use IO::All;

use XXX;
# use XXX;

sub inline {
my ($self, %args) = @_;
die "'inline' directive requires 'module' key/val pair"
unless $args{module};
$args{ilsm} ||= 'Inline::C';

$self->include('Inline');
$self->include('Inline::denter');
$self->include($args{ilsm});
$self->include('Inline::C::Parser::RegExp');
$self->include('Inline::Module');
$self->include('Inline::Module::MakeMaker');

my $makefile = io('Makefile')->all;
$makefile =~ s/^pure_all(\s+):(\s+)/pure_all$1::$2/;
$makefile .= <<"...";

pure_all ::
\t\$(PERL) "-Ilib" "-M$pkg" -e "print '$pkg'->_requires_report()"
...

return $self;
}

my $code_modules = $INLINE->{module};
my $inlined_modules = $INLINE->{inline};
my @included_modules = included_modules();

my $section = <<"...";
distdir ::
\t\$(NOECHO) \$(ABSPERLRUN) -MInline::Module=distdir -e 1 -- \$(DISTVNAME) @$inlined_modules -- @included_modules
pure_all ::
...

for my $module (@$code_modules) {
$section .=
"\t\$(NOECHO) \$(ABSPERLRUN) -Iinc -Ilib -e 'use $module'\n";
my $makemaker = {};
my $postamble = Inline::Module::postamble(
$makemaker,
inline => \%args,
);
$self->postamble($postamble);
my $IM = $Inline::Module::Self;
for my $module ($IM->included_modules) {
$self->include($module);
}
$section .=
"\t\$(NOECHO) \$(ABSPERLRUN) -Iinc -MInline::Module=fixblib -e 1";
}

return $section;
1;

0 comments on commit adfd619

Please sign in to comment.