[SCM] libmessage-passing-perl Debian packaging branch, master, updated. debian/0.111-3-14-g44f6e88
Tomas Doran
bobtfish at bobtfish.net
Mon May 6 11:57:35 UTC 2013
The following commit has been merged in the master branch:
commit ddc230720d52ebfc6342bb36a8dcc35caf455d59
Author: Tomas Doran <bobtfish at bobtfish.net>
Date: Sat Aug 18 16:26:44 2012 +0100
Almost working again
diff --git a/lib/Message/Passing.pm b/lib/Message/Passing.pm
index 11e2582..5bd1580 100644
--- a/lib/Message/Passing.pm
+++ b/lib/Message/Passing.pm
@@ -1,11 +1,11 @@
package Message::Passing;
use Moo;
-use Getopt::Long qw(:config pass_through);
use Config::Any;
use Message::Passing::Role::CLIComponent;
use Message::Passing::DSL;
use Carp qw/ confess /;
-use namespace::clean -except => [qw/ meta has /];
+use MooX::Options flavour => [qw( pass_through )], protect_argv => 0;
+use namespace::clean -except => [qw/ meta new_with_options parse_options _options_data _options_config/];
use 5.8.4;
our $VERSION = '0.100';
@@ -26,8 +26,6 @@ sub new_with_options {
$class->new(%args);
}
-use MooX::Options;
-
with
CLIComponent( name => 'input' ),
CLIComponent( name => 'output' ),
diff --git a/lib/Message/Passing/Role/CLIComponent.pm b/lib/Message/Passing/Role/CLIComponent.pm
index cf7cc2f..1b8ad28 100644
--- a/lib/Message/Passing/Role/CLIComponent.pm
+++ b/lib/Message/Passing/Role/CLIComponent.pm
@@ -2,12 +2,12 @@ package Message::Passing::Role::CLIComponent;
use strict;
use warnings;
use Package::Variant
- importing => ['Moo::Role'],
+ importing => ['Moo::Role', 'MooX::Options'],
subs => [ qw(has around before after with) ];
+use MooX::Options;
use MooX::Types::MooseLike::Base qw/ Str /;
use JSON ();
use Try::Tiny qw/ try /;
-use MooX::Options ();
#use namespace::clean -except => 'CLIComponent';
sub make_variant {
@@ -18,21 +18,10 @@ sub make_variant {
my $has_default = exists $arguments{default};
my $default = $has_default ? $arguments{default} : undef;
- my $_options_meta = {};
- has "$name" => (
- isa => Str,
- is => 'ro',
-# required => "$has_default" ? 0 : 1,
- "$has_default" ? ( default => sub { "$default" } ) : (),
- );
- $_options_meta->{$name} = { MooX::Options::_validate_and_filter_options(
- format => 's',
- "$has_default" ? ( default => sub { "$default" } ) : (),
- ) };
-
- has "${name}_options" => (
+ option "$name" => (
is => 'ro',
- default => sub { {} },
+# required => "$has_default" ? 0 : 1,
+ $has_default ? ( default => sub { "$default" } ) : (),
isa => sub { ref($_[0]) eq 'HASH' },
coerce => sub {
my $str = shift;
@@ -43,14 +32,8 @@ sub make_variant {
}
$str;
},
- );
- $_options_meta->{$name} = { MooX::Options::_validate_and_filter_options(
format => 's',
- ) };
- around( _options_meta => sub {
- my ( $orig, $self ) = ( shift, shift );
- return ( $self->$orig(@_), %$_options_meta );
- });
+ );
}
1;
--
libmessage-passing-perl Debian packaging
More information about the Pkg-perl-cvs-commits
mailing list