DBIx-Class-Helper-Row-Enumeration

 view release on metacpan or  search on metacpan

META.json  view on Meta::CPAN

            "Test::Perl::Critic" : "0",
            "Test::Pod" : "1.41",
            "Test::Pod::Coverage" : "1.08",
            "Test::Pod::LinkCheck" : "0",
            "Test::Portability::Files" : "0",
            "Test::TrailingSpace" : "0.0203"
         }
      },
      "runtime" : {
         "recommends" : {
            "Ref::Util::XS" : "0"
         },
         "requires" : {
            "DBIx::Class::Core" : "0",
            "Ref::Util" : "0",
            "Sub::Quote" : "0",
            "perl" : "v5.10.1"
         }
      },
      "test" : {
         "recommends" : {
            "CPAN::Meta" : "2.120900"
         },
         "requires" : {
            "DBD::SQLite" : "0",

META.yml  view on Meta::CPAN

license: artistic_2
meta-spec:
  url: http://module-build.sourceforge.net/META-spec-v1.4.html
  version: '1.4'
name: DBIx-Class-Helper-Row-Enumeration
provides:
  DBIx::Class::Helper::Row::Enumeration:
    file: lib/DBIx/Class/Helper/Row/Enumeration.pm
    version: v0.1.8
recommends:
  Ref::Util::XS: '0'
requires:
  DBIx::Class::Core: '0'
  Ref::Util: '0'
  Sub::Quote: '0'
  perl: v5.10.1
resources:
  bugtracker: https://github.com/robrwo/DBIx-Class-Helper-Row-Enumeration/issues
  repository: git://github.com/robrwo/DBIx-Class-Helper-Row-Enumeration.git
version: v0.1.8
x_authority: cpan:RRWO
x_contributors:
  - 'Aaron Crane <arc@cpan.org>'
x_generated_by_perl: v5.28.1

Makefile.PL  view on Meta::CPAN

  "AUTHOR" => "Robert Rothenberg <rrwo\@cpan.org>",
  "CONFIGURE_REQUIRES" => {
    "ExtUtils::MakeMaker" => 0
  },
  "DISTNAME" => "DBIx-Class-Helper-Row-Enumeration",
  "LICENSE" => "artistic_2",
  "MIN_PERL_VERSION" => "5.010001",
  "NAME" => "DBIx::Class::Helper::Row::Enumeration",
  "PREREQ_PM" => {
    "DBIx::Class::Core" => 0,
    "Ref::Util" => 0,
    "Sub::Quote" => 0
  },
  "TEST_REQUIRES" => {
    "DBD::SQLite" => 0,
    "DBIx::Class::Core" => 0,
    "DBIx::Class::Schema" => 0,
    "File::Spec" => 0,
    "Module::Metadata" => 0,
    "SQL::Translator" => "0.11018",
    "Sub::Name" => 0,

Makefile.PL  view on Meta::CPAN

  }
);


my %FallbackPrereqs = (
  "DBD::SQLite" => 0,
  "DBIx::Class::Core" => 0,
  "DBIx::Class::Schema" => 0,
  "File::Spec" => 0,
  "Module::Metadata" => 0,
  "Ref::Util" => 0,
  "SQL::Translator" => "0.11018",
  "Sub::Name" => 0,
  "Sub::Quote" => 0,
  "Test::More" => 0,
  "Test::Most" => 0
);


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

cpanfile  view on Meta::CPAN

requires "DBIx::Class::Core" => "0";
requires "Ref::Util" => "0";
requires "Sub::Quote" => "0";
requires "perl" => "v5.10.1";
recommends "Ref::Util::XS" => "0";

on 'test' => sub {
  requires "DBD::SQLite" => "0";
  requires "DBIx::Class::Core" => "0";
  requires "DBIx::Class::Schema" => "0";
  requires "File::Spec" => "0";
  requires "Module::Metadata" => "0";
  requires "SQL::Translator" => "0.11018";
  requires "Sub::Name" => "0";
  requires "Test::More" => "0";

lib/DBIx/Class/Helper/Row/Enumeration.pm  view on Meta::CPAN

package DBIx::Class::Helper::Row::Enumeration;

# ABSTRACT: Add methods for emum values

use v5.10.1;

use strict;
use warnings;

use Ref::Util  ();
use Sub::Quote ();

# RECOMMEND PREREQ: Ref::Util::XS

our $VERSION = 'v0.1.8';

# The names of all methods installed by this module.
my %MINE;



sub add_columns {
    my ( $self, @cols ) = @_;

    $self->next::method(@cols);

    my $class = Ref::Util::is_ref($self) || $self;

    foreach my $col (@cols) {

        next if ref $col;

        $col =~ s/^\+//;
        my $info = $self->column_info($col);

        next unless $info->{data_type} eq 'enum';

        next unless exists $info->{extra}{list};

        my $handlers = $info->{extra}{handles} //= sub { "is_" . $_[0] };

        next unless $handlers;

        if ( Ref::Util::is_plain_coderef($handlers) ) {
            $info->{extra}{handles} = {
                map {

                    if ( my $method = $handlers->( $_, $col, $class ) ) {
                        ( $method => $_ )
                    }
                    else {
                        ()
                    }

                } @{ $info->{extra}{list} }
            };
            $handlers = $info->{extra}{handles};
        }

        DBIx::Class::Exception->throw("handles is not a hashref")
          unless Ref::Util::is_plain_hashref($handlers);

        foreach my $handler ( keys %$handlers ) {
            next unless $handler;
            my $value = $handlers->{$handler} or next;

            my $method = "${class}::${handler}";

            # Keep track of what we've installed, and don't complain about
            # being asked to reinstall it. This is needed when using
            # DBIx::Class::Schema::Loader. In theory we should check whether

t/00-report-prereqs.dd  view on Meta::CPAN

                                      'Test::Perl::Critic' => '0',
                                      'Test::Pod' => '1.41',
                                      'Test::Pod::Coverage' => '1.08',
                                      'Test::Pod::LinkCheck' => '0',
                                      'Test::Portability::Files' => '0',
                                      'Test::TrailingSpace' => '0.0203'
                                    }
                    },
       'runtime' => {
                      'recommends' => {
                                        'Ref::Util::XS' => '0'
                                      },
                      'requires' => {
                                      'DBIx::Class::Core' => '0',
                                      'Ref::Util' => '0',
                                      'Sub::Quote' => '0',
                                      'perl' => 'v5.10.1'
                                    }
                    },
       'test' => {
                   'recommends' => {
                                     'CPAN::Meta' => '2.120900'
                                   },
                   'requires' => {
                                   'DBD::SQLite' => '0',



( run in 0.294 second using v1.01-cache-2.11-cpan-4d50c553e7e )