Skip to content

Commit

Permalink
Change 'inline' config key to 'stub'
Browse files Browse the repository at this point in the history
  • Loading branch information
ingydotnet committed Dec 6, 2014
1 parent 0eb056c commit e8d4a0f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions doc/Inline/Module.swim
Expand Up @@ -53,9 +53,9 @@ Arguments are key/value pairs.
Required. This is the module that contains inline `C` or `C++` code. It can
be an array ref of multiple modules.

- `inline`
- `stub`

inline => 'My::Module::Inline',
stub => 'My::Module::Inline',

Optional. This is the name of the Inline::Module generated stub module. It's
value defaults to the `module` argument with '::Inline' appended. It can be
Expand Down
2 changes: 1 addition & 1 deletion doc/Inline/Module/Tutorial.swim
Expand Up @@ -34,7 +34,7 @@ now we'll just show `Makefile.PL` way:
postamble => {
inline => {
module => 'Acme::Math::XS',
inline => 'Acme::Math::XS::Inline',
stub => 'Acme::Math::XS::Inline',
ilsm => 'Inline::C',
},
},
Expand Down
8 changes: 4 additions & 4 deletions lib/Inline/Module.pm
Expand Up @@ -117,14 +117,14 @@ sub postamble {
$self->default_args($inline, $makemaker);

my $code_modules = $self->{module};
my $inlined_modules = $self->{inline};
my $stub_modules = $self->{stub};
my @included_modules = $self->included_modules;

my $section = <<"...";
distdir : distdir_inline
distdir_inline : create_distdir
\t\$(NOECHO) \$(ABSPERLRUN) -MInline::Module=distdir -e 1 -- \$(DISTVNAME) @$inlined_modules -- @included_modules
\t\$(NOECHO) \$(ABSPERLRUN) -MInline::Module=distdir -e 1 -- \$(DISTVNAME) @$stub_modules -- @included_modules
pure_all ::
...
Expand All @@ -142,8 +142,8 @@ sub default_args {
my ($self, $args, $makemaker) = @_;
$args->{module} = $makemaker->{NAME} unless $args->{module};
$args->{module} = [ $args->{module} ] unless ref $args->{module};
$args->{inline} ||= [ map "${_}::Inline", @{$args->{module}} ];
$args->{inline} = [ $args->{inline} ] unless ref $args->{inline};
$args->{stub} ||= [ map "${_}::Inline", @{$args->{module}} ];
$args->{stub} = [ $args->{stub} ] unless ref $args->{stub};
$args->{ilsm} ||= 'Inline::C';
$args->{ilsm} = [ $args->{ilsm} ] unless ref $args->{ilsm};
%$self = %$args;
Expand Down
8 changes: 6 additions & 2 deletions note/ToDo
@@ -1,11 +1,14 @@
== To Do Next

- Use IO::String for autostub handle by default

== Soon

- Add tests
+ Bash test setup
- Write a test/devel test for making a full module like Acme::Math::XS
- Add new plugin sections to the tutorial

== Soon
- Add new plugin sections to the tutorial

- Refactor Dist-Zilla-Plugin-InlineModule to use postamble
- and Alt-Acme-Math-XS-DistZilla
Expand Down Expand Up @@ -42,4 +45,5 @@
+ Get rid of `perl-inline-module` bin script (probably)
+ The ::Inline module can be generated by the Makefile.PL etc
+ It should likely never be committed. (We commit it now)
+ Change 'inline' config key to 'stub'

0 comments on commit e8d4a0f

Please sign in to comment.