@@ -17,7 +17,7 @@ my %module_build_args = (
"celogeek <me\@celogeek.com>"
],
"dist_name" => "MooX-Options",
- "dist_version" => "4.008",
+ "dist_version" => "4.010",
"license" => "perl",
"module_name" => "MooX::Options",
"recommends" => {},
@@ -37,7 +37,7 @@ my %module_build_args = (
"Regexp::Common" => 0,
"Scalar::Util" => 0,
"Term::Size::Any" => 0,
- "Text::WrapI18N" => 0,
+ "Text::LineFold" => 0,
"feature" => 0,
"overload" => 0,
"parent" => 0,
@@ -1,3 +1,10 @@
+4.010 2014-09-05 16:49:56 GMT
+ * Feature #453 : Use Text::LineFold instead of Text::WrapI18N (Celogeek San)
+ * Feature #452 : Support UTF8 source for pod and man (Celogeek San)
+
+4.009 2014-07-08 10:15:09 GMT
+ * Bug #450 : options with format "s" do not accept "0" as value (Celogeek San)
+
4.008 2014-02-01 09:49:36 GMT
* Bug #405 : fix typo in pod (Celogeek San)
@@ -24,6 +24,7 @@ t/around_options_usage.t
t/author-critic.t
t/base.st
t/check_target_methods.t
+t/doc-utf8.t
t/doc.t
t/failure.t
t/flavour.t
@@ -36,7 +37,6 @@ t/mo.t
t/moo.t
t/moose.t
t/moox-cmd.t
-t/mouse.t
t/multi_role.t
t/namespace_clean.t
t/no_option.t
@@ -46,6 +46,7 @@ t/release-kwalitee.t
t/release-pod-coverage.t
t/release-unused-vars.t
t/role.t
+t/string_with_zero_value.t
t/with_config.t
xt/perlcritic.rc
xt/perltidy.rc
@@ -4,7 +4,7 @@
"celogeek <me@celogeek.com>"
],
"dynamic_config" : 0,
- "generated_by" : "Dist::Zilla version 5.006, CPAN::Meta::Converter version 2.132830",
+ "generated_by" : "Dist::Zilla version 5.006, CPAN::Meta::Converter version 2.142060",
"license" : [
"perl_5"
],
@@ -46,7 +46,7 @@
"Regexp::Common" : "0",
"Scalar::Util" : "0",
"Term::Size::Any" : "0",
- "Text::WrapI18N" : "0",
+ "Text::LineFold" : "0",
"feature" : "0",
"overload" : "0",
"parent" : "0",
@@ -87,10 +87,10 @@
"web" : "https://github.com/celogeek/MooX-Options"
}
},
- "version" : "4.008",
+ "version" : "4.010",
"x_Dist_Zilla" : {
"perl" : {
- "version" : "5.018002"
+ "version" : "5.020000"
},
"plugins" : [
{
@@ -192,7 +192,7 @@
}
},
"name" : "@GRS/Test::Compile",
- "version" : "2.039"
+ "version" : "2.043"
},
{
"class" : "Dist::Zilla::Plugin::Test::UnusedVars",
@@ -22,7 +22,7 @@ build_requires:
configure_requires:
Module::Build: 0.3601
dynamic_config: 0
-generated_by: 'Dist::Zilla version 5.006, CPAN::Meta::Converter version 2.132830'
+generated_by: 'Dist::Zilla version 5.006, CPAN::Meta::Converter version 2.142060'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -43,7 +43,7 @@ requires:
Regexp::Common: 0
Scalar::Util: 0
Term::Size::Any: 0
- Text::WrapI18N: 0
+ Text::LineFold: 0
feature: 0
overload: 0
parent: 0
@@ -54,10 +54,10 @@ resources:
bugtracker: https://github.com/celogeek/MooX-Options/issues
homepage: https://tasks.celogeek.com/projects/perl-modules-moox-options
repository: https://github.com/celogeek/MooX-Options.git
-version: 4.008
+version: 4.010
x_Dist_Zilla:
perl:
- version: 5.018002
+ version: 5.020000
plugins:
-
class: Dist::Zilla::Plugin::GatherDir
@@ -137,7 +137,7 @@ x_Dist_Zilla:
script_finder:
- ':ExecFiles'
name: '@GRS/Test::Compile'
- version: 2.039
+ version: 2.043
-
class: Dist::Zilla::Plugin::Test::UnusedVars
name: '@GRS/Test::UnusedVars'
@@ -1,7 +1,7 @@
This archive contains the distribution MooX-Options,
-version 4.008:
+version 4.010:
Explicit Options eXtension for Object Class
@@ -4,7 +4,7 @@ MooX::Options - Explicit Options eXtension for Object Class
# VERSION
-version 4.008
+version 4.010
# DESCRIPTION
@@ -2,7 +2,7 @@ name = MooX-Options
license = Perl_5
copyright_holder = celogeek <me@celogeek.com>
copyright_year = 2013
-version = 4.008
+version = 4.010
[@GRS]
-remove = AutoPrereqs
@@ -12,9 +12,9 @@ package MooX::Options::Descriptive::Usage;
use strict;
use warnings;
-our $VERSION = '4.008'; # VERSION
-use feature 'say';
-use Text::WrapI18N;
+our $VERSION = '4.010'; # VERSION
+use feature 'say', 'state';
+use Text::LineFold;
use Term::Size::Any qw/chars/;
use Getopt::Long::Descriptive;
use Scalar::Util qw/blessed/;
@@ -70,13 +70,12 @@ sub text {
}
# set the column size of your terminal into the wrapper
-sub _set_column_size {
+sub _get_line_fold {
my ($columns) = chars();
$columns //= 78;
$columns = $ENV{TEST_FORCE_COLUMN_SIZE}
if defined $ENV{TEST_FORCE_COLUMN_SIZE};
- $Text::WrapI18N::columns = $columns - 4;
- return;
+ return Text::LineFold->new( ColMax => $columns - 4 );
}
sub option_text {
@@ -85,7 +84,7 @@ sub option_text {
= defined $self->{target} ? $self->{target}->_options_data : ();
my $getopt_options = $self->{options};
my @message;
- _set_column_size;
+ my $lf = _get_line_fold();
for my $opt (@$getopt_options) {
my ( $short, $format ) = $opt->{spec} =~ /(?:\|(\w))?(?:=(.*?))?$/x;
my $format_doc_str;
@@ -97,7 +96,7 @@ sub option_text {
. ( length( $opt->{name} ) > 1 ? "-" : "" )
. $opt->{name} . ":"
. ( defined $format_doc_str ? " " . $format_doc_str : "" );
- push @message, wrap( " ", " ", $opt->{desc} );
+ push @message, $lf->fold( " ", " ", $opt->{desc} );
push @message, "";
}
@@ -120,7 +119,7 @@ sub option_pod {
? $self->{target}->_options_sub_commands() // []
: [];
- my @man = ( "=head1 NAME", $prog_name, );
+ my @man = ( "=encoding UTF-8", "=head1 NAME", $prog_name, );
if ( defined( my $description = $options_config{description} ) ) {
push @man, "=head1 DESCRIPTION", $description;
@@ -239,7 +238,7 @@ MooX::Options::Descriptive::Usage - Usage class
=head1 VERSION
-version 4.008
+version 4.010
=head1 DESCRIPTION
@@ -12,7 +12,7 @@ package MooX::Options::Descriptive;
use strict;
use warnings;
-our $VERSION = '4.008'; # VERSION
+our $VERSION = '4.010'; # VERSION
use Getopt::Long 2.38;
use Getopt::Long::Descriptive 0.091;
@@ -33,7 +33,7 @@ MooX::Options::Descriptive - This method extend Getopt::Long::Descriptive to cha
=head1 VERSION
-version 4.008
+version 4.010
=head1 DESCRIPTION
@@ -11,7 +11,7 @@ MooX::Options::Manual::Man - More documentation for the man option
=head1 VERSION
-version 4.008
+version 4.010
=head1 DESCRIPTION
@@ -11,7 +11,7 @@ MooX::Options::Manual::MooXCmd - Manage your tools with MooX::Cmd
=head1 VERSION
-version 4.008
+version 4.010
=head1 DESCRIPTION
@@ -11,7 +11,7 @@ MooX::Options::Manual::NamespaceClean - Use namespace::clean with MooX::Options
=head1 VERSION
-version 4.008
+version 4.010
=head1 DESCRIPTION
@@ -12,7 +12,7 @@ package MooX::Options::Role;
use strict;
use warnings;
-our $VERSION = '4.008'; # VERSION
+our $VERSION = '4.010'; # VERSION
use MRO::Compat;
use MooX::Options::Descriptive;
@@ -77,7 +77,7 @@ sub _options_fix_argv {
my @new_argv;
#parse all argv
- while ( my $arg = shift @ARGV ) {
+ while ( defined( my $arg = shift @ARGV ) ) {
if ( $arg eq '--' ) {
push @new_argv, $arg, @ARGV;
last;
@@ -342,7 +342,7 @@ sub options_man {
}
my $man_file = file( Path::Class::tempdir( CLEANUP => 1 ), 'help.pod' );
- $man_file->spew( $usage->option_pod );
+ $man_file->spew( iomode => '>:encoding(UTF-8)', $usage->option_pod );
pod2usage(
-verbose => 2,
@@ -378,7 +378,7 @@ MooX::Options::Role - role that is apply to your object
=head1 VERSION
-version 4.008
+version 4.010
=head1 METHODS
@@ -12,7 +12,7 @@ package MooX::Options;
use strict;
use warnings;
-our $VERSION = '4.008'; # VERSION
+our $VERSION = '4.010'; # VERSION
use Carp;
my @OPTIONS_ATTRIBUTES
@@ -197,7 +197,7 @@ MooX::Options - Explicit Options eXtension for Object Class
=head1 VERSION
-version 4.008
+version 4.010
=head1 DESCRIPTION
@@ -2,7 +2,7 @@ use 5.006;
use strict;
use warnings;
-# this test was generated with Dist::Zilla::Plugin::Test::Compile 2.039
+# this test was generated with Dist::Zilla::Plugin::Test::Compile 2.043
use Test::More tests => 4 + ( $ENV{AUTHOR_TESTING} ? 1 : 0 );
@@ -0,0 +1,42 @@
+#!perl
+#
+# This file is part of MooX-Options
+#
+# This software is copyright (c) 2013 by celogeek <me@celogeek.com>.
+#
+# This is free software; you can redistribute it and/or modify it under
+# the same terms as the Perl 5 programming language system itself.
+#
+use strict;
+use warnings;
+use Test::More;
+use Test::Trap;
+use Carp;
+use FindBin qw/$RealBin/;
+use Try::Tiny;
+
+local $ENV{TEST_FORCE_COLUMN_SIZE} = 78;
+
+{
+
+ package t;
+ use Moo;
+ use MooX::Options;
+
+ option 't' => (
+ is => 'ro',
+ documentation => 'this is a test with utf8 : ça marche héhé !',
+ );
+
+ 1;
+}
+
+{
+ my $opt = t->new_with_options;
+ trap { $opt->options_usage };
+ ok $trap->stdout
+ =~ /\s+\-t:\n\s+this\sis\sa\stest\swith\sutf8\s:\sça\smarche\shéhé\s\!/x,
+ 'documentation work';
+}
+
+done_testing;
@@ -1,18 +0,0 @@
-#!/usr/bin/env perl
-#
-# This file is part of MooX-Options
-#
-# This software is copyright (c) 2013 by celogeek <me@celogeek.com>.
-#
-# This is free software; you can redistribute it and/or modify it under
-# the same terms as the Perl 5 programming language system itself.
-#
-
-use strict;
-use warnings;
-use Test::More;
-
-plan skip_all =>
- "Sorry, but I don't support Mouse anymore, the module doesn't work like any others and is fully incompatible with the new way I have wrote MooX::Options. If you really need it, help me to solve this.";
-
-done_testing;
@@ -0,0 +1,27 @@
+#!perl
+#
+# This file is part of MooX-Options
+#
+# This software is copyright (c) 2013 by celogeek <me@celogeek.com>.
+#
+# This is free software; you can redistribute it and/or modify it under
+# the same terms as the Perl 5 programming language system itself.
+#
+use strict;
+use warnings;
+use Test::More;
+
+package Foo;
+use Moo;
+use MooX::Options;
+option start_from => ( is => "ro", format => "s" );
+
+package main;
+local @ARGV = qw/--start_from 0/;
+my $f = Foo->new_with_options;
+my $n = $f->start_from;
+is $n, 0, 'option with value 0 works';
+$n++;
+is $n, 1, 'and can be increment';
+
+done_testing;