Git Product home page Git Product logo

exporter-declare's Introduction

Exodist's GitHub stats

exporter-declare's People

Contributors

dsteinbrunner avatar exodist avatar kyzn avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

exporter-declare's Issues

Autoloading of recipe's instead of listing them in Declare.pm

The bundled recipes should not be loaded at startup, they should instead be loaded when needed. The get_recipe() method should see if it knows how to load a recipe that isn't registered using a table containing the bundled ones.

This should also make Devel::BeginLift drop-able as a dependency. Tests for the Begin recipe should skip if its not installed. Begin itself should give a useful die message if Devel::BeginLift is not installed.

Incorrect exporter synopsis

Exporter synopsis:

...
# You can create a function to mangle the arguments before they are
# parsed into a Exporter::Declare::Spec object.
sub alter_import_args {
   my ($class, $args) = @_;

   # fiddle with args before importing routines are called
   @$args = grep { !/^skip_/ } @$args
}
...

Exporter::Declare v0.113 passes to alter_import_args 3 arguments: class, name of importer package, and reference to args, so synopsis should look like

sub alter_import_args {
   my ($class, $importer, $args) = @_;

test prereqs are declared in 'build' category

The prereqs needed for testing are improperly declared in the 'build' category, meaning they (and all downstream dependents) are unneccessarily installed in environments that skip testing.

It would also be straightforward to switch off of Module::Build at the same time, but that's a much less significant issue.

Typo in NAME section

Exporter::Declare::Meta:

NAME
Exporter::Declare::Meta - The mata object which stoes meta-data
for all exporters.

Note typos: "mata", "stoes". Also, abstract is a bit confusing. Do you really mean one meta object stores meta-data for all exporters? The next section, DESCRIPTION, says:

All classes that use Exporter::Declare have an associated Meta
object. Meta objects track available exports, tags, and options.

It looks like one meta object stores meta-data for one exporter, so abstract from NAME section is not correct.

Add signatures to the parsers

Parser.pm should have methods for parsing a signature.

Export parser should take signature as a param in the specs

codeblock:
function (sig) { ... }

sub and method:
function (sig) { ... }
function name(sig) { ... }

the arrow form currently accepts a prototype this should be expanded

Can't locate object method "exporter_meta" via package "Foo"

META CLASS:

All exporters have a meta class, the only way to get the
meta object is to call the exporter_meta() method on the
class/object that is an exporter. Any class that uses
Exporter::Declare gets this method, and a meta-object.

Test:

$ cat t.pl
#!/use/bin/perl
package Foo;
use strict;
use warnings;
use Exporter::Declare;
my $meta = __PACKAGE__->exporter_meta();
exit 0;

$ perl t.pl 
Can't locate object method "exporter_meta" via package "Foo" at t.pl line 6.

It seems documentation is wrong and real method name is export_meta, not exporter_meta.

Can't locate object method "get_tag" via package "Exporter::Declare::Meta"

METHODS:

@list = $meta->get_tag( $name )

    Get the list of items associated with the specified
    tag. $name should be the tag name WITHOUT -/: prefix.

Test:

$ cat t.pl 
#!/use/bin/perl
package Foo;
use strict;
use warnings;
use Exporter::Declare;
export_tag foo =>qw{ a1 a2 };
my $meta = __PACKAGE__->export_meta();
my @items = $meta->get_tag( 'foo' );
exit 0;

$ perl t.pl 
Can't locate object method "get_tag" via package "Exporter::Declare::Meta" at t.pl line 8.

??? exporter_meta documented but does not exist, get_tag documented but does not exist. It seems the documentation is massively outdated.

Exporter::Declare::Meta interface is not complete: no way to iterate through all the exports, options, tags, arguments

Exporter::Declare::Meta interface is not complete. Documentation says

All classes that use Exporter::Declare have an associated Meta
object. Meta objects track available exports, tags, and options.

If you know a name, you can detect if it is a name of option (is_option), or tag (is_tag), or argument (is_)argument). Then, you may get list of exports, associated with the tag (get_tag), or get export definition (get_export). You can even add options (add_options), exports (add_export).

But there is no method to iterate through (or get names of) all the existing exports, tags, options, arguments.

export_meta

Name "AirG::Billing::Logger::export_meta" used only once: possible typo at /home/ad/harmans/perl5/perlbrew/perls/perl-5.16.0/lib/site_perl/5.16.0/Exporter/Declare.pm line 231.

Failed test 'no (unexpected) warnings (via END block)'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.