Moxie

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

    [FEATURE CHANGES]
    - moved the Moxie::Slot::Intitializer class to
      the MOP instead of here
    - lexical private lvalue slot accessors are now
      always generated, no need to specify them
      youself

    [DEPENDENCIES]
    - removed the B::CompilerPhase::Hook dependency
      and just use straight up Devel::Hook instead
    - removed the PadWalker dependency because we
      can now generate the slot accessor at BEGIN
      time and install them with Sub::Inject
    - added Sub::Inject dependency
    - bump the MOP dependency to support use of the
      MOP::Slot::Initializer class

0.03 2017-08-17
    [GITHUB]
    - generous typo fixes from my internet friends
        - Pierre Vigier

Changes  view on Meta::CPAN

        - added tests for this

    [DEPENDENCIES]
    - version bump for BEGIN::Lift and Method::Traits
      to make sure classes can be loaded at runtime

    - version bump for MOP to better support the
      custom slot initializer usage

0.02 05-07-2017
    - fixing missing dependency (PadWalker)
    - fixing some simple kwalitee issues

0.01 21-06-2017
    - Initial release to an unsuspecting world

META.json  view on Meta::CPAN

         "requires" : {
            "ExtUtils::MakeMaker" : "0"
         }
      },
      "runtime" : {
         "requires" : {
            "BEGIN::Lift" : "0.06",
            "MOP" : "0.12",
            "Method::Traits" : "0.08",
            "Module::Runtime" : "0",
            "PadWalker" : "0",
            "Sub::Util" : "0",
            "UNIVERSAL::Object" : "0.13",
            "experimental" : "0",
            "perl" : "v5.22.0"
         }
      },
      "test" : {
         "requires" : {
            "Test::Fatal" : "0",
            "Test::More" : "0"

META.yml  view on Meta::CPAN

    file: lib/Moxie/Traits/Provider/Constructor.pm
    version: '0.07'
  Moxie::Traits::Provider::Experimental:
    file: lib/Moxie/Traits/Provider/Experimental.pm
    version: '0.07'
requires:
  BEGIN::Lift: '0.06'
  MOP: '0.12'
  Method::Traits: '0.08'
  Module::Runtime: '0'
  PadWalker: '0'
  Sub::Util: '0'
  UNIVERSAL::Object: '0.13'
  experimental: '0'
  perl: v5.22.0
resources:
  bugtracker: https://github.com/stevan/p5-Moxie/issues
  repository: https://github.com/stevan/p5-Moxie.git
version: '0.07'
x_serialization_backend: 'YAML::Tiny version 1.70'

Makefile.PL  view on Meta::CPAN

  },
  "DISTNAME" => "Moxie",
  "LICENSE" => "perl",
  "MIN_PERL_VERSION" => "5.022000",
  "NAME" => "Moxie",
  "PREREQ_PM" => {
    "BEGIN::Lift" => "0.06",
    "MOP" => "0.12",
    "Method::Traits" => "0.08",
    "Module::Runtime" => 0,
    "PadWalker" => 0,
    "Sub::Util" => 0,
    "UNIVERSAL::Object" => "0.13",
    "experimental" => 0
  },
  "TEST_REQUIRES" => {
    "Test::Fatal" => 0,
    "Test::More" => 0
  },
  "VERSION" => "0.07",
  "test" => {
    "TESTS" => "t/000-samples/*.t t/001-basic/*.t t/030-roles/*.t t/040-method/*.t t/050-non-mop-integration/*.t t/080-enum/*.t t/100-annotations/*.t"
  }
);


my %FallbackPrereqs = (
  "BEGIN::Lift" => "0.06",
  "MOP" => "0.12",
  "Method::Traits" => "0.08",
  "Module::Runtime" => 0,
  "PadWalker" => 0,
  "Sub::Util" => 0,
  "Test::Fatal" => 0,
  "Test::More" => 0,
  "UNIVERSAL::Object" => "0.13",
  "experimental" => 0
);


unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) {
  delete $WriteMakefileArgs{TEST_REQUIRES};

dist.ini  view on Meta::CPAN

repository.url    = https://github.com/stevan/p5-Moxie.git
repository.web    = https://github.com/stevan/p5-Moxie
repository.type   = git
bugtracker.web    = https://github.com/stevan/p5-Moxie/issues

[Prereqs]
perl              = v5.22
experimental      = 0
Module::Runtime   = 0
Sub::Util         = 0
PadWalker         = 0
UNIVERSAL::Object = 0.13
MOP               = 0.12
BEGIN::Lift       = 0.06
Method::Traits    = 0.08

[Prereqs / TestRequires]
Test::More  = 0
Test::Fatal = 0

lib/Moxie/Traits/Provider/Experimental.pm  view on Meta::CPAN

use warnings;
use experimental qw[
    signatures
    postderef
];

use Method::Traits ':for_providers';

use Carp      ();
use Sub::Util (); # for setting the prototype of the lexical accessors
use PadWalker (); # for generating lexical accessors
use MOP::Util ();

our $VERSION   = '0.07';
our $AUTHORITY = 'cpan:STEVAN';

sub lazy ( $meta, $method, @args ) : OverwritesMethod {

    my $method_name = $method->name;

    my $slot_name;

lib/Moxie/Traits/Provider/Experimental.pm  view on Meta::CPAN

        # have been compiled, at this moment, they are not.
        MOP::Util::defer_until_UNITCHECK(sub {

            # now see if this class is immutable or not, it will
            # determine the type of accessor we generate ...
            my $class_is_immutable = ($meta->name)->isa('Moxie::Object::Immutable');

            # now check the class local methods ....
            foreach my $m ( $meta->methods ) {
                # get a HASH of the things the method closes over
                my $closed_over = PadWalker::closed_over( $m->body );

                #warn Data::Dumper::Dumper({
                #    class       => $meta->name,
                #    method      => $m->name,
                #    closed_over => $closed_over,
                #    looking_for => $method_name,
                #});

                # XXX:
                # Consider using something like Text::Levenshtein

lib/Moxie/Traits/Provider/Experimental.pm  view on Meta::CPAN

                            my ($self) = @DB::args;
                            $self->{ $slot_name };
                        };
                    }

                    # then this is as simple as assigning the HASH key
                    $closed_over->{ '&' . $method_name } = $accessor;

                    # okay, now restore the closed over vars
                    # with our new addition...
                    PadWalker::set_closed_over( $m->body, $closed_over );
                }
            }
        });
    }

}

1;

__END__



( run in 0.680 second using v1.01-cache-2.11-cpan-05444aca049 )