This is an automated email from the git hooks/post-receive script. dod pushed a commit to branch master in repository libconfig-model-perl.
commit e35732a2b0b2782b13881bffa23cba66d406271e Author: Dominique Dumont <d...@debian.org> Date: Sat May 23 14:23:58 2015 +0200 Imported Upstream version 2.071 --- Changes | 15 ++ META.json | 4 +- META.yml | 4 +- lib/Config/Model.pm | 4 +- lib/Config/Model/Annotation.pm | 4 +- lib/Config/Model/AnyId.pm | 4 +- lib/Config/Model/AnyThing.pm | 4 +- lib/Config/Model/Backend/Any.pm | 20 ++- lib/Config/Model/Backend/Fstab.pm | 4 +- lib/Config/Model/Backend/IniFile.pm | 4 +- lib/Config/Model/Backend/Json.pm | 4 +- lib/Config/Model/Backend/PlainFile.pm | 4 +- lib/Config/Model/Backend/ShellVar.pm | 4 +- lib/Config/Model/Backend/Yaml.pm | 4 +- lib/Config/Model/BackendMgr.pm | 4 +- lib/Config/Model/CheckList.pm | 4 +- lib/Config/Model/Cookbook/CreateModelFromDoc.pod | 2 +- lib/Config/Model/Describe.pm | 4 +- lib/Config/Model/DumpAsData.pm | 4 +- lib/Config/Model/Dumper.pm | 4 +- lib/Config/Model/Exception.pm | 28 ++-- lib/Config/Model/FuseUI.pm | 4 +- lib/Config/Model/HashId.pm | 4 +- lib/Config/Model/IdElementReference.pm | 4 +- lib/Config/Model/Instance.pm | 4 +- lib/Config/Model/Iterator.pm | 4 +- lib/Config/Model/ListId.pm | 4 +- lib/Config/Model/Lister.pm | 4 +- lib/Config/Model/Loader.pm | 6 +- lib/Config/Model/Manual/ModelCreationAdvanced.pod | 2 +- .../Model/Manual/ModelCreationIntroduction.pod | 2 +- lib/Config/Model/Node.pm | 4 +- lib/Config/Model/ObjTreeScanner.pm | 4 +- lib/Config/Model/Report.pm | 4 +- lib/Config/Model/Role/NodeLoader.pm | 4 +- lib/Config/Model/SearchElement.pm | 4 +- lib/Config/Model/SimpleUI.pm | 48 ++++-- lib/Config/Model/TermUI.pm | 6 +- lib/Config/Model/TreeSearcher.pm | 4 +- lib/Config/Model/Utils/GenClassPod.pm | 4 +- lib/Config/Model/Value.pm | 161 +++++++++++++-------- lib/Config/Model/Value/LayeredInclude.pm | 4 +- lib/Config/Model/ValueComputer.pm | 4 +- lib/Config/Model/WarpedNode.pm | 4 +- lib/Config/Model/Warper.pm | 4 +- t/load.t | 6 + 46 files changed, 261 insertions(+), 175 deletions(-) diff --git a/Changes b/Changes index 03ba41a..b575ec6 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,18 @@ +2.071 2015-05-23 + + Bug and doc fix release: + * shell like user interface: + * fixed completion of commands (like set, clear...) + * improved error message sent when command is wrong + * use item location as prompt + * Loader: fixed parding of command like foo:.insort("bar( stuff )") + which are also used in shell UI. + * Backend::Any: mention cme command used to edit config file in + comment header when writing back files. (e.g. "You can run + 'cme edit lcdproc' to modify this file" is written in header + of /etc/LCDd.conf) + * Value: fixed formatting and errors in pod doc + 2.070 2015-05-03 Added minor features and bug fixes: diff --git a/META.json b/META.json index d702cfa..22299d8 100644 --- a/META.json +++ b/META.json @@ -4,7 +4,7 @@ "Dominique Dumont" ], "dynamic_config" : 0, - "generated_by" : "Dist::Zilla version 5.020, CPAN::Meta::Converter version 2.142690", + "generated_by" : "Dist::Zilla version 5.020, CPAN::Meta::Converter version 2.150001", "license" : [ "lgpl_2_1" ], @@ -91,6 +91,6 @@ "web" : "http://github.com/dod38fr/config-model" } }, - "version" : "2.070" + "version" : "2.071" } diff --git a/META.yml b/META.yml index 2d74bd9..62dbbd7 100644 --- a/META.yml +++ b/META.yml @@ -17,7 +17,7 @@ build_requires: configure_requires: Module::Build: '0.34' dynamic_config: 0 -generated_by: 'Dist::Zilla version 5.020, CPAN::Meta::Converter version 2.142690' +generated_by: 'Dist::Zilla version 5.020, CPAN::Meta::Converter version 2.150001' license: lgpl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -62,4 +62,4 @@ resources: bugtracker: http://rt.cpan.org/NoAuth/Bugs.html?Dist=Config-Model homepage: https://github.com/dod38fr/config-model/wiki repository: git://github.com/dod38fr/config-model.git -version: '2.070' +version: '2.071' diff --git a/lib/Config/Model.pm b/lib/Config/Model.pm index b4134b6..f8b2731 100644 --- a/lib/Config/Model.pm +++ b/lib/Config/Model.pm @@ -8,7 +8,7 @@ # The GNU Lesser General Public License, Version 2.1, February 1999 # package Config::Model; -$Config::Model::VERSION = '2.070'; +$Config::Model::VERSION = '2.071'; use strict ; use warnings; use 5.10.1; @@ -1596,7 +1596,7 @@ Config::Model - Create tools to validate, migrate and edit configuration files =head1 VERSION -version 2.070 +version 2.071 =head1 SYNOPSIS diff --git a/lib/Config/Model/Annotation.pm b/lib/Config/Model/Annotation.pm index fec8b53..bed3517 100644 --- a/lib/Config/Model/Annotation.pm +++ b/lib/Config/Model/Annotation.pm @@ -8,7 +8,7 @@ # The GNU Lesser General Public License, Version 2.1, February 1999 # package Config::Model::Annotation; -$Config::Model::Annotation::VERSION = '2.070'; +$Config::Model::Annotation::VERSION = '2.071'; use Mouse; use English; @@ -183,7 +183,7 @@ Config::Model::Annotation - Read and write configuration annotations =head1 VERSION -version 2.070 +version 2.071 =head1 SYNOPSIS diff --git a/lib/Config/Model/AnyId.pm b/lib/Config/Model/AnyId.pm index 8e1260d..0dfe6f8 100644 --- a/lib/Config/Model/AnyId.pm +++ b/lib/Config/Model/AnyId.pm @@ -8,7 +8,7 @@ # The GNU Lesser General Public License, Version 2.1, February 1999 # package Config::Model::AnyId; -$Config::Model::AnyId::VERSION = '2.070'; +$Config::Model::AnyId::VERSION = '2.071'; use 5.010; use Mouse; @@ -929,7 +929,7 @@ Config::Model::AnyId - Base class for hash or list element =head1 VERSION -version 2.070 +version 2.071 =head1 SYNOPSIS diff --git a/lib/Config/Model/AnyThing.pm b/lib/Config/Model/AnyThing.pm index dcef05c..ba5610a 100644 --- a/lib/Config/Model/AnyThing.pm +++ b/lib/Config/Model/AnyThing.pm @@ -8,7 +8,7 @@ # The GNU Lesser General Public License, Version 2.1, February 1999 # package Config::Model::AnyThing; -$Config::Model::AnyThing::VERSION = '2.070'; +$Config::Model::AnyThing::VERSION = '2.071'; use Mouse; # FIXME: must cleanup warp mechanism to implement this @@ -634,7 +634,7 @@ Config::Model::AnyThing - Base class for configuration tree item =head1 VERSION -version 2.070 +version 2.071 =head1 SYNOPSIS diff --git a/lib/Config/Model/Backend/Any.pm b/lib/Config/Model/Backend/Any.pm index 4fb41f4..6c10a14 100644 --- a/lib/Config/Model/Backend/Any.pm +++ b/lib/Config/Model/Backend/Any.pm @@ -8,7 +8,7 @@ # The GNU Lesser General Public License, Version 2.1, February 1999 # package Config::Model::Backend::Any; -$Config::Model::Backend::Any::VERSION = '2.070'; +$Config::Model::Backend::Any::VERSION = '2.071'; use Carp; use strict; use warnings; @@ -121,10 +121,18 @@ sub associates_comments_with_data { sub write_global_comment { my ( $self, $ioh, $cc ) = @_; - my $res = - "$cc$cc This file was written by cme command.\n" - . "$cc$cc You can run 'cme edit <application>' to modify this file.\n" - . "$cc$cc Run 'cme list' to get the list of applications available on your system\n" + # no need to mention 'cme list' if current application is found + my $app = $self->node->instance->application ; + my $extra = '' ; + if (not $app) { + $extra = "$cc$cc Run 'cme list' to get the list of applications" + . " available on your system\n"; + $app = '<application>'; + } + + my $res = "$cc$cc This file was written by cme command.\n" + . "$cc$cc You can run 'cme edit $app' to modify this file.\n" + . $extra . "$cc$cc You may also modify the content of this file with your favorite editor.\n\n"; # write global comment @@ -171,7 +179,7 @@ Config::Model::Backend::Any - Virtual class for other backends =head1 VERSION -version 2.070 +version 2.071 =head1 SYNOPSIS diff --git a/lib/Config/Model/Backend/Fstab.pm b/lib/Config/Model/Backend/Fstab.pm index cf857b3..9303d3f 100644 --- a/lib/Config/Model/Backend/Fstab.pm +++ b/lib/Config/Model/Backend/Fstab.pm @@ -8,7 +8,7 @@ # The GNU Lesser General Public License, Version 2.1, February 1999 # package Config::Model::Backend::Fstab; -$Config::Model::Backend::Fstab::VERSION = '2.070'; +$Config::Model::Backend::Fstab::VERSION = '2.071'; use Mouse; use Carp; use Log::Log4perl qw(get_logger :levels); @@ -164,7 +164,7 @@ Config::Model::Backend::Fstab - Read and write config from fstab file =head1 VERSION -version 2.070 +version 2.071 =head1 SYNOPSIS diff --git a/lib/Config/Model/Backend/IniFile.pm b/lib/Config/Model/Backend/IniFile.pm index 2ca40a2..340744b 100644 --- a/lib/Config/Model/Backend/IniFile.pm +++ b/lib/Config/Model/Backend/IniFile.pm @@ -8,7 +8,7 @@ # The GNU Lesser General Public License, Version 2.1, February 1999 # package Config::Model::Backend::IniFile; -$Config::Model::Backend::IniFile::VERSION = '2.070'; +$Config::Model::Backend::IniFile::VERSION = '2.071'; use Carp; use Mouse; use 5.10.0; @@ -319,7 +319,7 @@ Config::Model::Backend::IniFile - Read and write config as a INI file =head1 VERSION -version 2.070 +version 2.071 =head1 SYNOPSIS diff --git a/lib/Config/Model/Backend/Json.pm b/lib/Config/Model/Backend/Json.pm index e10cc74..5cbb13d 100644 --- a/lib/Config/Model/Backend/Json.pm +++ b/lib/Config/Model/Backend/Json.pm @@ -8,7 +8,7 @@ # The GNU Lesser General Public License, Version 2.1, February 1999 # package Config::Model::Backend::Json; -$Config::Model::Backend::Json::VERSION = '2.070'; +$Config::Model::Backend::Json::VERSION = '2.071'; use Carp; use strict; use warnings; @@ -93,7 +93,7 @@ Config::Model::Backend::Json - Read and write config as a JSON data structure =head1 VERSION -version 2.070 +version 2.071 =head1 SYNOPSIS diff --git a/lib/Config/Model/Backend/PlainFile.pm b/lib/Config/Model/Backend/PlainFile.pm index 9ba81ba..0b4079d 100644 --- a/lib/Config/Model/Backend/PlainFile.pm +++ b/lib/Config/Model/Backend/PlainFile.pm @@ -8,7 +8,7 @@ # The GNU Lesser General Public License, Version 2.1, February 1999 # package Config::Model::Backend::PlainFile; -$Config::Model::Backend::PlainFile::VERSION = '2.070'; +$Config::Model::Backend::PlainFile::VERSION = '2.071'; use Carp; use Mouse; use Config::Model::Exception; @@ -189,7 +189,7 @@ Config::Model::Backend::PlainFile - Read and write config as plain file =head1 VERSION -version 2.070 +version 2.071 =head1 SYNOPSIS diff --git a/lib/Config/Model/Backend/ShellVar.pm b/lib/Config/Model/Backend/ShellVar.pm index eeb73f8..9774293 100644 --- a/lib/Config/Model/Backend/ShellVar.pm +++ b/lib/Config/Model/Backend/ShellVar.pm @@ -8,7 +8,7 @@ # The GNU Lesser General Public License, Version 2.1, February 1999 # package Config::Model::Backend::ShellVar; -$Config::Model::Backend::ShellVar::VERSION = '2.070'; +$Config::Model::Backend::ShellVar::VERSION = '2.071'; use Carp; use Mouse; use Config::Model::Exception; @@ -114,7 +114,7 @@ Config::Model::Backend::ShellVar - Read and write config as a C<SHELLVAR> data s =head1 VERSION -version 2.070 +version 2.071 =head1 SYNOPSIS diff --git a/lib/Config/Model/Backend/Yaml.pm b/lib/Config/Model/Backend/Yaml.pm index 6f47f56..213c650 100644 --- a/lib/Config/Model/Backend/Yaml.pm +++ b/lib/Config/Model/Backend/Yaml.pm @@ -9,7 +9,7 @@ # package Config::Model::Backend::Yaml; -$Config::Model::Backend::Yaml::VERSION = '2.070'; +$Config::Model::Backend::Yaml::VERSION = '2.071'; use Carp; use strict; use warnings; @@ -94,7 +94,7 @@ Config::Model::Backend::Yaml - Read and write config as a YAML data structure =head1 VERSION -version 2.070 +version 2.071 =head1 SYNOPSIS diff --git a/lib/Config/Model/BackendMgr.pm b/lib/Config/Model/BackendMgr.pm index 44ef5e0..3a315a5 100644 --- a/lib/Config/Model/BackendMgr.pm +++ b/lib/Config/Model/BackendMgr.pm @@ -8,7 +8,7 @@ # The GNU Lesser General Public License, Version 2.1, February 1999 # package Config::Model::BackendMgr; -$Config::Model::BackendMgr::VERSION = '2.070'; +$Config::Model::BackendMgr::VERSION = '2.071'; use Mouse; use Carp; @@ -768,7 +768,7 @@ Config::Model::BackendMgr - Load configuration node on demand =head1 VERSION -version 2.070 +version 2.071 =head1 SYNOPSIS diff --git a/lib/Config/Model/CheckList.pm b/lib/Config/Model/CheckList.pm index 189bc6e..849e2ec 100644 --- a/lib/Config/Model/CheckList.pm +++ b/lib/Config/Model/CheckList.pm @@ -8,7 +8,7 @@ # The GNU Lesser General Public License, Version 2.1, February 1999 # package Config::Model::CheckList; -$Config::Model::CheckList::VERSION = '2.070'; +$Config::Model::CheckList::VERSION = '2.071'; use Mouse; use 5.010; @@ -701,7 +701,7 @@ Config::Model::CheckList - Handle check list element =head1 VERSION -version 2.070 +version 2.071 =head1 SYNOPSIS diff --git a/lib/Config/Model/Cookbook/CreateModelFromDoc.pod b/lib/Config/Model/Cookbook/CreateModelFromDoc.pod index 9fd9c79..e1109ac 100644 --- a/lib/Config/Model/Cookbook/CreateModelFromDoc.pod +++ b/lib/Config/Model/Cookbook/CreateModelFromDoc.pod @@ -13,7 +13,7 @@ Config::Model::Cookbook::CreateModelFromDoc - Create a configuration model from =head1 VERSION -version 2.070 +version 2.071 =head1 Introduction diff --git a/lib/Config/Model/Describe.pm b/lib/Config/Model/Describe.pm index 4d93db5..54dd2d7 100644 --- a/lib/Config/Model/Describe.pm +++ b/lib/Config/Model/Describe.pm @@ -9,7 +9,7 @@ # package Config::Model::Describe; -$Config::Model::Describe::VERSION = '2.070'; +$Config::Model::Describe::VERSION = '2.071'; use Carp; use strict; use warnings; @@ -174,7 +174,7 @@ Config::Model::Describe - Provide a description of a node element =head1 VERSION -version 2.070 +version 2.071 =head1 SYNOPSIS diff --git a/lib/Config/Model/DumpAsData.pm b/lib/Config/Model/DumpAsData.pm index c367aa8..72104b8 100644 --- a/lib/Config/Model/DumpAsData.pm +++ b/lib/Config/Model/DumpAsData.pm @@ -8,7 +8,7 @@ # The GNU Lesser General Public License, Version 2.1, February 1999 # package Config::Model::DumpAsData; -$Config::Model::DumpAsData::VERSION = '2.070'; +$Config::Model::DumpAsData::VERSION = '2.071'; use Carp; use strict; use warnings; @@ -249,7 +249,7 @@ Config::Model::DumpAsData - Dump configuration content as a perl data structure =head1 VERSION -version 2.070 +version 2.071 =head1 SYNOPSIS diff --git a/lib/Config/Model/Dumper.pm b/lib/Config/Model/Dumper.pm index ba72d20..7f2b46a 100644 --- a/lib/Config/Model/Dumper.pm +++ b/lib/Config/Model/Dumper.pm @@ -8,7 +8,7 @@ # The GNU Lesser General Public License, Version 2.1, February 1999 # package Config::Model::Dumper; -$Config::Model::Dumper::VERSION = '2.070'; +$Config::Model::Dumper::VERSION = '2.071'; use Carp; use strict; use warnings; @@ -256,7 +256,7 @@ Config::Model::Dumper - Serialize data of config tree =head1 VERSION -version 2.070 +version 2.071 =head1 SYNOPSIS diff --git a/lib/Config/Model/Exception.pm b/lib/Config/Model/Exception.pm index deb64b4..af08d8b 100644 --- a/lib/Config/Model/Exception.pm +++ b/lib/Config/Model/Exception.pm @@ -8,7 +8,7 @@ # The GNU Lesser General Public License, Version 2.1, February 1999 # package Config::Model::Exception; -$Config::Model::Exception::VERSION = '2.070'; +$Config::Model::Exception::VERSION = '2.071'; use warnings; use strict; use Data::Dumper; @@ -137,7 +137,7 @@ use Exception::Class ( Config::Model::Exception::Internal->Trace(1); package Config::Model::Exception::Syntax; -$Config::Model::Exception::Syntax::VERSION = '2.070'; +$Config::Model::Exception::Syntax::VERSION = '2.071'; sub full_message { my $self = shift; @@ -151,7 +151,7 @@ sub full_message { } package Config::Model::Exception::Any; -$Config::Model::Exception::Any::VERSION = '2.070'; +$Config::Model::Exception::Any::VERSION = '2.071'; sub full_message { my $self = shift; @@ -180,7 +180,7 @@ sub xpath_message { } package Config::Model::Exception::LoadData; -$Config::Model::Exception::LoadData::VERSION = '2.070'; +$Config::Model::Exception::LoadData::VERSION = '2.071'; sub full_message { my $self = shift; @@ -198,7 +198,7 @@ sub full_message { } package Config::Model::Exception::Model; -$Config::Model::Exception::Model::VERSION = '2.070'; +$Config::Model::Exception::Model::VERSION = '2.071'; sub full_message { my $self = shift; @@ -226,7 +226,7 @@ sub full_message { } package Config::Model::Exception::Load; -$Config::Model::Exception::Load::VERSION = '2.070'; +$Config::Model::Exception::Load::VERSION = '2.071'; sub full_message { my $self = shift; @@ -249,7 +249,7 @@ sub full_message { } package Config::Model::Exception::UnavailableElement; -$Config::Model::Exception::UnavailableElement::VERSION = '2.070'; +$Config::Model::Exception::UnavailableElement::VERSION = '2.071'; sub full_message { my $self = shift; @@ -273,7 +273,7 @@ sub full_message { } package Config::Model::Exception::ObsoleteElement; -$Config::Model::Exception::ObsoleteElement::VERSION = '2.070'; +$Config::Model::Exception::ObsoleteElement::VERSION = '2.071'; sub full_message { my $self = shift; @@ -292,7 +292,7 @@ sub full_message { } package Config::Model::Exception::UnknownElement; -$Config::Model::Exception::UnknownElement::VERSION = '2.070'; +$Config::Model::Exception::UnknownElement::VERSION = '2.071'; use Carp; @@ -361,7 +361,7 @@ sub full_message { } package Config::Model::Exception::UnknownId; -$Config::Model::Exception::UnknownId::VERSION = '2.070'; +$Config::Model::Exception::UnknownId::VERSION = '2.071'; sub full_message { my $self = shift; @@ -389,7 +389,7 @@ sub full_message { } package Config::Model::Exception::WrongType; -$Config::Model::Exception::WrongType::VERSION = '2.070'; +$Config::Model::Exception::WrongType::VERSION = '2.071'; sub full_message { my $self = shift; @@ -414,7 +414,7 @@ sub full_message { } package Config::Model::Exception::ConfigFile::Missing; -$Config::Model::Exception::ConfigFile::Missing::VERSION = '2.070'; +$Config::Model::Exception::ConfigFile::Missing::VERSION = '2.071'; sub full_message { my $self = shift; @@ -425,7 +425,7 @@ sub full_message { } package Config::Model::Exception::Xml; -$Config::Model::Exception::Xml::VERSION = '2.070'; +$Config::Model::Exception::Xml::VERSION = '2.071'; sub full_message { my $self = shift; @@ -455,7 +455,7 @@ Config::Model::Exception - Exception mechanism for configuration model =head1 VERSION -version 2.070 +version 2.071 =head1 SYNOPSIS diff --git a/lib/Config/Model/FuseUI.pm b/lib/Config/Model/FuseUI.pm index d9604a6..f5c09d1 100644 --- a/lib/Config/Model/FuseUI.pm +++ b/lib/Config/Model/FuseUI.pm @@ -8,7 +8,7 @@ # The GNU Lesser General Public License, Version 2.1, February 1999 # package Config::Model::FuseUI; -$Config::Model::FuseUI::VERSION = '2.070'; +$Config::Model::FuseUI::VERSION = '2.071'; # there's no Singleton with Mouse use Mouse; @@ -326,7 +326,7 @@ Config::Model::FuseUI - Fuse virtual file interface for Config::Model =head1 VERSION -version 2.070 +version 2.071 =head1 SYNOPSIS diff --git a/lib/Config/Model/HashId.pm b/lib/Config/Model/HashId.pm index 1aba3ad..abfbdce 100644 --- a/lib/Config/Model/HashId.pm +++ b/lib/Config/Model/HashId.pm @@ -8,7 +8,7 @@ # The GNU Lesser General Public License, Version 2.1, February 1999 # package Config::Model::HashId; -$Config::Model::HashId::VERSION = '2.070'; +$Config::Model::HashId::VERSION = '2.071'; use Mouse; use Config::Model::Exception; @@ -506,7 +506,7 @@ Config::Model::HashId - Handle hash element for configuration model =head1 VERSION -version 2.070 +version 2.071 =head1 SYNOPSIS diff --git a/lib/Config/Model/IdElementReference.pm b/lib/Config/Model/IdElementReference.pm index 4450628..12ddc93 100644 --- a/lib/Config/Model/IdElementReference.pm +++ b/lib/Config/Model/IdElementReference.pm @@ -8,7 +8,7 @@ # The GNU Lesser General Public License, Version 2.1, February 1999 # package Config::Model::IdElementReference; -$Config::Model::IdElementReference::VERSION = '2.070'; +$Config::Model::IdElementReference::VERSION = '2.071'; use Mouse; use Carp; @@ -192,7 +192,7 @@ Config::Model::IdElementReference - Refer to id element(s) and extract keys =head1 VERSION -version 2.070 +version 2.071 =head1 SYNOPSIS diff --git a/lib/Config/Model/Instance.pm b/lib/Config/Model/Instance.pm index 0528a3c..21a45ba 100644 --- a/lib/Config/Model/Instance.pm +++ b/lib/Config/Model/Instance.pm @@ -8,7 +8,7 @@ # The GNU Lesser General Public License, Version 2.1, February 1999 # package Config::Model::Instance; -$Config::Model::Instance::VERSION = '2.070'; +$Config::Model::Instance::VERSION = '2.071'; #use Scalar::Util qw(weaken) ; use 5.10.1; @@ -522,7 +522,7 @@ Config::Model::Instance - Instance of configuration tree =head1 VERSION -version 2.070 +version 2.071 =head1 SYNOPSIS diff --git a/lib/Config/Model/Iterator.pm b/lib/Config/Model/Iterator.pm index b42eedf..f894ad2 100644 --- a/lib/Config/Model/Iterator.pm +++ b/lib/Config/Model/Iterator.pm @@ -8,7 +8,7 @@ # The GNU Lesser General Public License, Version 2.1, February 1999 # package Config::Model::Iterator; -$Config::Model::Iterator::VERSION = '2.070'; +$Config::Model::Iterator::VERSION = '2.071'; use Carp; use strict; use warnings; @@ -275,7 +275,7 @@ Config::Model::Iterator - Iterates forward or backward a configuration tree =head1 VERSION -version 2.070 +version 2.071 =head1 SYNOPSIS diff --git a/lib/Config/Model/ListId.pm b/lib/Config/Model/ListId.pm index b56918e..6b5a310 100644 --- a/lib/Config/Model/ListId.pm +++ b/lib/Config/Model/ListId.pm @@ -8,7 +8,7 @@ # The GNU Lesser General Public License, Version 2.1, February 1999 # package Config::Model::ListId; -$Config::Model::ListId::VERSION = '2.070'; +$Config::Model::ListId::VERSION = '2.071'; use 5.10.1; use Mouse; @@ -497,7 +497,7 @@ Config::Model::ListId - Handle list element for configuration model =head1 VERSION -version 2.070 +version 2.071 =head1 SYNOPSIS diff --git a/lib/Config/Model/Lister.pm b/lib/Config/Model/Lister.pm index bf6bd85..aabbdf2 100644 --- a/lib/Config/Model/Lister.pm +++ b/lib/Config/Model/Lister.pm @@ -8,7 +8,7 @@ # The GNU Lesser General Public License, Version 2.1, February 1999 # package Config::Model::Lister; -$Config::Model::Lister::VERSION = '2.070'; +$Config::Model::Lister::VERSION = '2.071'; use strict; use warnings; use Exporter; @@ -83,7 +83,7 @@ Config::Model::Lister - List available models and applications =head1 VERSION -version 2.070 +version 2.071 =head1 SYNOPSIS diff --git a/lib/Config/Model/Loader.pm b/lib/Config/Model/Loader.pm index 8585b65..11d292a 100644 --- a/lib/Config/Model/Loader.pm +++ b/lib/Config/Model/Loader.pm @@ -8,7 +8,7 @@ # The GNU Lesser General Public License, Version 2.1, February 1999 # package Config::Model::Loader; -$Config::Model::Loader::VERSION = '2.070'; +$Config::Model::Loader::VERSION = '2.071'; use Carp; use strict; use warnings; @@ -117,7 +117,7 @@ sub _split_cmd { (?: (:~|:-[=~]?|:=~|:\.\w+|:[=<>@]?|~) # action (?: - (?: \( ([^)]+) \) ) # capture parameters between braces + (?: \( ( $quoted_string | [^)]+ ) \) ) # capture parameters between braces | ( /[^/]+/ # regexp | (?: @@ -753,7 +753,7 @@ Config::Model::Loader - Load serialized data into config tree =head1 VERSION -version 2.070 +version 2.071 =head1 SYNOPSIS diff --git a/lib/Config/Model/Manual/ModelCreationAdvanced.pod b/lib/Config/Model/Manual/ModelCreationAdvanced.pod index cba0d0c..c9120e1 100644 --- a/lib/Config/Model/Manual/ModelCreationAdvanced.pod +++ b/lib/Config/Model/Manual/ModelCreationAdvanced.pod @@ -13,7 +13,7 @@ Config::Model::Manual::ModelCreationAdvanced - Creating a model with advanced fe =head1 VERSION -version 2.070 +version 2.071 =head1 Introduction diff --git a/lib/Config/Model/Manual/ModelCreationIntroduction.pod b/lib/Config/Model/Manual/ModelCreationIntroduction.pod index da746f5..94f5191 100644 --- a/lib/Config/Model/Manual/ModelCreationIntroduction.pod +++ b/lib/Config/Model/Manual/ModelCreationIntroduction.pod @@ -13,7 +13,7 @@ Config::Model::Manual::ModelCreationIntroduction - Introduction to model creatio =head1 VERSION -version 2.070 +version 2.071 =head1 Introduction diff --git a/lib/Config/Model/Node.pm b/lib/Config/Model/Node.pm index d83e60c..71b09e5 100644 --- a/lib/Config/Model/Node.pm +++ b/lib/Config/Model/Node.pm @@ -8,7 +8,7 @@ # The GNU Lesser General Public License, Version 2.1, February 1999 # package Config::Model::Node; -$Config::Model::Node::VERSION = '2.070'; +$Config::Model::Node::VERSION = '2.071'; use Mouse; with "Config::Model::Role::NodeLoader"; @@ -1127,7 +1127,7 @@ Config::Model::Node - Class for configuration tree node =head1 VERSION -version 2.070 +version 2.071 =head1 SYNOPSIS diff --git a/lib/Config/Model/ObjTreeScanner.pm b/lib/Config/Model/ObjTreeScanner.pm index dea2178..efd7784 100644 --- a/lib/Config/Model/ObjTreeScanner.pm +++ b/lib/Config/Model/ObjTreeScanner.pm @@ -8,7 +8,7 @@ # The GNU Lesser General Public License, Version 2.1, February 1999 # package Config::Model::ObjTreeScanner; -$Config::Model::ObjTreeScanner::VERSION = '2.070'; +$Config::Model::ObjTreeScanner::VERSION = '2.071'; use strict; use Config::Model::Exception; use Scalar::Util qw/blessed/; @@ -285,7 +285,7 @@ Config::Model::ObjTreeScanner - Scan config tree and perform call-backs for each =head1 VERSION -version 2.070 +version 2.071 =head1 SYNOPSIS diff --git a/lib/Config/Model/Report.pm b/lib/Config/Model/Report.pm index 01cb52f..e4a4ff2 100644 --- a/lib/Config/Model/Report.pm +++ b/lib/Config/Model/Report.pm @@ -8,7 +8,7 @@ # The GNU Lesser General Public License, Version 2.1, February 1999 # package Config::Model::Report; -$Config::Model::Report::VERSION = '2.070'; +$Config::Model::Report::VERSION = '2.071'; use Carp; use strict; use warnings; @@ -90,7 +90,7 @@ Config::Model::Report - Reports data from config tree =head1 VERSION -version 2.070 +version 2.071 =head1 SYNOPSIS diff --git a/lib/Config/Model/Role/NodeLoader.pm b/lib/Config/Model/Role/NodeLoader.pm index d25b4b7..4c8b367 100644 --- a/lib/Config/Model/Role/NodeLoader.pm +++ b/lib/Config/Model/Role/NodeLoader.pm @@ -8,7 +8,7 @@ # The GNU Lesser General Public License, Version 2.1, February 1999 # package Config::Model::Role::NodeLoader; -$Config::Model::Role::NodeLoader::VERSION = '2.070'; +$Config::Model::Role::NodeLoader::VERSION = '2.071'; # ABSTRACT: Load Node element in configuration tree use Mouse::Role; @@ -44,7 +44,7 @@ Config::Model::Role::NodeLoader - Load Node element in configuration tree =head1 VERSION -version 2.070 +version 2.071 =head1 SYNOPSIS diff --git a/lib/Config/Model/SearchElement.pm b/lib/Config/Model/SearchElement.pm index 9019287..6a236d4 100644 --- a/lib/Config/Model/SearchElement.pm +++ b/lib/Config/Model/SearchElement.pm @@ -8,7 +8,7 @@ # The GNU Lesser General Public License, Version 2.1, February 1999 # package Config::Model::SearchElement; -$Config::Model::SearchElement::VERSION = '2.070'; +$Config::Model::SearchElement::VERSION = '2.071'; use Log::Log4perl qw(get_logger :levels); use Carp; use strict; @@ -333,7 +333,7 @@ Config::Model::SearchElement - Search an element in a configuration model =head1 VERSION -version 2.070 +version 2.071 =head1 SYNOPSIS diff --git a/lib/Config/Model/SimpleUI.pm b/lib/Config/Model/SimpleUI.pm index c3d9f54..8c35a26 100644 --- a/lib/Config/Model/SimpleUI.pm +++ b/lib/Config/Model/SimpleUI.pm @@ -8,8 +8,9 @@ # The GNU Lesser General Public License, Version 2.1, February 1999 # package Config::Model::SimpleUI; -$Config::Model::SimpleUI::VERSION = '2.070'; +$Config::Model::SimpleUI::VERSION = '2.071'; use Carp; +use 5.010; use strict; use warnings; @@ -116,14 +117,18 @@ my %run_dispatch = ( set => sub { my $self = shift; my $cmd = shift; - $cmd =~ s/\s*=\s*/=/; - $cmd =~ s/\s*:\s*/:/; - $self->{current_node}->load($cmd); + if ($cmd) { + $cmd =~ s/\s*([=:])\s*/$1/; + $self->{current_node}->load($cmd); + } + else { + say "No command given."; + } return ""; }, display => sub { my $self = shift; - print "Nothing to display" unless @_; + say "Nothing to display" unless @_; return $self->{current_node}->grab_value(@_); }, ls => sub { @@ -143,23 +148,34 @@ my %run_dispatch = ( }, delete => sub { my $self = shift; - my ( $elt_name, $key ) = split /\s*:\s*/, $_[0]; - my $elt = $self->{current_node}->fetch_element($elt_name); - if ( length($key) ) { - $elt->delete($key); + if ($_[0]) { + my ( $elt_name, $key ) = split /\s*:\s*/, $_[0]; + my $elt = $self->{current_node}->fetch_element($elt_name); + if ( length($key) ) { + $elt->delete($key); + } + else { + $elt->store(undef); + } } else { - $elt->store(undef); + say "delete what ?"; } return ''; }, clear => sub { my ( $self, $elt_name ) = @_; - $self->{current_node}->fetch_element($elt_name)->clear(); + if ($elt_name) { + $self->{current_node}->fetch_element($elt_name)->clear(); + } + else { + say "Expected element name for clear command. I.e. one of ", + join(' ',$self->{current_node}->get_element_name); + } return ''; }, fix => sub { - my ( $self, $dir ) = @_; + my ( $self ) = @_; return $self->{root}->instance->apply_fixes; }, save => sub { @@ -168,7 +184,7 @@ my %run_dispatch = ( return "done"; }, changes => sub { - my ( $self, $dir ) = @_; + my ( $self ) = @_; return $self->{root}->instance->list_changes; }, ll => $ll_sub, @@ -180,7 +196,7 @@ my %run_dispatch = ( $run_dispatch{reset} = $run_dispatch{clear}; sub simple_ui_commands { - sort keys %run_dispatch; + return sort keys %run_dispatch; } sub new { @@ -229,7 +245,7 @@ sub run_loop { sub prompt { my $self = shift; my $ret = $self->{prompt} . ':'; - my $loc = $self->{current_node}->composite_name_short; + my $loc = $self->{current_node}->location_short; $ret .= " $loc " if $loc; return $ret . '$ '; } @@ -289,7 +305,7 @@ Config::Model::SimpleUI - Simple interface for Config::Model =head1 VERSION -version 2.070 +version 2.071 =head1 SYNOPSIS diff --git a/lib/Config/Model/TermUI.pm b/lib/Config/Model/TermUI.pm index ed92ec8..1789c39 100644 --- a/lib/Config/Model/TermUI.pm +++ b/lib/Config/Model/TermUI.pm @@ -8,7 +8,7 @@ # The GNU Lesser General Public License, Version 2.1, February 1999 # package Config::Model::TermUI; -$Config::Model::TermUI::VERSION = '2.070'; +$Config::Model::TermUI::VERSION = '2.071'; use Carp; use strict; use warnings; @@ -118,7 +118,7 @@ sub completion { return $completion_dispatch{$main}->( $self, $text, $line, $start ); } elsif ( not $cmd ) { - return $self->simple_ui_commands(); + return grep ( /^$text/, $self->simple_ui_commands() ); } return (); @@ -211,7 +211,7 @@ Config::Model::TermUI - Provides Config::Model UI with Term::ReadLine =head1 VERSION -version 2.070 +version 2.071 =head1 SYNOPSIS diff --git a/lib/Config/Model/TreeSearcher.pm b/lib/Config/Model/TreeSearcher.pm index bf82e77..bb1d717 100644 --- a/lib/Config/Model/TreeSearcher.pm +++ b/lib/Config/Model/TreeSearcher.pm @@ -8,7 +8,7 @@ # The GNU Lesser General Public License, Version 2.1, February 1999 # package Config::Model::TreeSearcher; -$Config::Model::TreeSearcher::VERSION = '2.070'; +$Config::Model::TreeSearcher::VERSION = '2.071'; use Mouse; use Mouse::Util::TypeConstraints; @@ -147,7 +147,7 @@ Config::Model::TreeSearcher - Search tree for match in value, description... =head1 VERSION -version 2.070 +version 2.071 =head1 SYNOPSIS diff --git a/lib/Config/Model/Utils/GenClassPod.pm b/lib/Config/Model/Utils/GenClassPod.pm index c4e8344..9d4b7af 100644 --- a/lib/Config/Model/Utils/GenClassPod.pm +++ b/lib/Config/Model/Utils/GenClassPod.pm @@ -8,7 +8,7 @@ # The GNU Lesser General Public License, Version 2.1, February 1999 # package Config::Model::Utils::GenClassPod; -$Config::Model::Utils::GenClassPod::VERSION = '2.070'; +$Config::Model::Utils::GenClassPod::VERSION = '2.071'; # ABSTRACT: generate pod documentation from configuration models use strict; @@ -56,7 +56,7 @@ Config::Model::Utils::GenClassPod - generate pod documentation from configuratio =head1 VERSION -version 2.070 +version 2.071 =head1 SYNOPSIS diff --git a/lib/Config/Model/Value.pm b/lib/Config/Model/Value.pm index 92184f3..9f89c91 100644 --- a/lib/Config/Model/Value.pm +++ b/lib/Config/Model/Value.pm @@ -8,7 +8,7 @@ # The GNU Lesser General Public License, Version 2.1, February 1999 # package Config::Model::Value; -$Config::Model::Value::VERSION = '2.070'; +$Config::Model::Value::VERSION = '2.071'; use 5.10.1; use Mouse; @@ -1793,7 +1793,7 @@ Config::Model::Value - Strongly typed configuration value =head1 VERSION -version 2.070 +version 2.071 =head1 SYNOPSIS @@ -1997,7 +1997,7 @@ configuration user (default: 0) Array ref of the possible value of an enum. Example : -choice => [ qw/foo bar/] + choice => [ qw/foo bar/] =item match @@ -2020,8 +2020,14 @@ C<$self> will contain the value object. Use with care. In the example below, any value matching 'foo' will be converted in uppercase: warn_if_match => { - 'foo' => { fix =>'uc;', msg => 'value $_ contains foo'} - 'BAR' => { fix =>'lc;', msg => 'value $_ contains BAR'} + 'foo' => { + fix => 'uc;', + msg => 'value $_ contains foo' + }, + 'BAR' => { + fix =>'lc;', + msg => 'value $_ contains BAR' + } }, The tests will be done in alphabetical order. In the example above, C<BAR> test will @@ -2050,12 +2056,12 @@ C<$_> will contains the value to check. C<$self> will contain the C<Config::Mode The example below will warn if value contaims a number: warn_if => { - warn_test => { - code => 'defined $_ && /\d/;', - msg => 'value $_ should not have numbers', - fix => 's/\d//g;' - } - }, + warn_test => { + code => 'defined $_ && /\d/;', + msg => 'value $_ should not have numbers', + fix => 's/\d//g;' + } + }, =item warn_unless @@ -2074,13 +2080,13 @@ The example below will warn unless the value points to an existing directory: Like C<warn_if>. Except that returned value will trigger an error if false: - assert => { - test_nb => { - code => 'defined $_ && /\d/;', - msg => 'should not have numbers', - fix => 's/\d//g;' - } - }, + assert => { + test_nb => { + code => 'defined $_ && /\d/;', + msg => 'should not have numbers', + fix => 's/\d//g;' + } + }, =item grammar @@ -2092,15 +2098,15 @@ the entire value must match the passed grammar. I.e. the grammar: -token (oper token)(s?) -oper: 'and' | 'or' -token: 'Apache' | 'CC-BY' | 'Perl' + token (oper token)(s?) + oper: 'and' | 'or' + token: 'Apache' | 'CC-BY' | 'Perl' will be changed to -check: token (oper token)(s?) /^\Z/ {$return = 1;} -oper: 'and' | 'or' -token: 'Apache' | 'CC-BY' | 'Perl' + check: token (oper token)(s?) /^\Z/ {$return = 1;} + oper: 'and' | 'or' + token: 'Apache' | 'CC-BY' | 'Perl' The rule is called with Value object and a string reference. So, in the actions you may need to define, you can call the value object as @@ -2219,17 +2225,28 @@ For instance if you declare 2 C<Value> element this way: value_type => 'enum', choice => [qw/US Europe Japan/] } , - tv_standard => { + tv_standard => { # this example is getting old... type => 'leaf', value_type => 'enum', - choice => [qw/PAL NTSC SECAM/] + choice => [ qw/PAL NTSC SECAM/ ] warp => { - follow => { c => '- country' }, # this points to the warp master + follow => { + # this points to the warp master + c => '- country' + }, rules => { - '$c eq "US"' => { default => 'NTSC' }, - '$c eq "France"' => { default => 'SECAM' }, - '$c eq "Japan"' => { default => 'NTSC' }, - '$c eq "Europe"' => { default => 'PAL' }, + '$c eq "US"' => { + default => 'NTSC' + }, + '$c eq "France"' => { + default => 'SECAM' + }, + '$c eq "Japan"' => { + default => 'NTSC' + }, + '$c eq "Europe"' => { + default => 'PAL' + }, } } } , @@ -2244,13 +2261,21 @@ possible values of an enum element: state => { type => 'leaf', - value_type => 'enum', # example is admittedly silly - warp =>{ - follow => { c => '- country' }, + value_type => 'enum', # example is admittedly silly + warp => { + follow => { + c => '- country' + }, rules => { - '$c eq "US"' => { choice => ['Kansas', 'Texas' ]}, - '$c eq "Europe"' => { choice => ['France', 'Spain' ]}, - '$c eq "Japan"' => { choice => ['Honshu', 'Hokkaido' ]} + '$c eq "US"' => { + choice => ['Kansas', 'Texas' ] + }, + '$c eq "Europe"' => { + choice => ['France', 'Spain' ] + }, + '$c eq "Japan"' => { + choice => ['Honshu', 'Hokkaido' ] + } } } } @@ -2578,12 +2603,12 @@ Set a value from a directory like path. =head2 Number with min and max values -bounded_number => { + bounded_number => { type => 'leaf', value_type => 'number', min => 1, max => 4, - }, + }, =head2 Mandatory value @@ -2591,23 +2616,26 @@ bounded_number => { type => 'leaf', value_type => 'string', mandatory => 1, - }, + }, mandatory_boolean => { type => 'leaf', value_type => 'boolean', - }, + mandatory => 1, + }, =head2 Enum with help associated with each value Note that the help specification is optional. -enum_with_help => { + enum_with_help => { type => 'leaf', value_type => 'enum', choice => [qw/a b c/], - help => { a => 'a help' } - }, + help => { + a => 'a help' + } + }, =head2 Migrate old obsolete enum value @@ -2622,7 +2650,7 @@ Legacy values C<a1>, C<c1> and C<foo/.*> are replaced with C<a>, C<c> and C<foo/ c1 => 'c', 'foo/.*' => 'foo', }, - }, + }, =head2 Enforce value to match a regexp @@ -2633,7 +2661,7 @@ regular expression. type => 'leaf', value_type => 'string', match => '^foo\d{2}$', - }, + }, =head2 Enforce value to match a L<Parse::RecDescent> grammar @@ -2652,15 +2680,19 @@ regular expression. Issue a warning if the string contains upper case letters. Propose a fix that translate all capital letters to lower case. -warn_if_capital => { + warn_if_capital => { type => 'leaf', value_type => 'string', - warn_if_match => { '/A-Z/' => { fix => '$_ = lc;' } }, + warn_if_match => { + '/A-Z/' => { + fix => '$_ = lc;' + } }, + }, A specific warning can be specified: -warn_if_capital => { + warn_if_capital => { type => 'leaf', value_type => 'string', warn_if_match => { @@ -2669,15 +2701,20 @@ warn_if_capital => { mesg => 'NO UPPER CASE PLEASE' } }, - }, + }, =head2 Issue a warning if a value does NOT match a regexp -warn_unless => { + warn_unless => { type => 'leaf', value_type => 'string', - warn_unless_match => { foo => { msg => '', fix => '$_ = "foo".$_;' } }, + warn_unless_match => { + foo => { + msg => '', + fix => '$_ = "foo".$_;' + } }, + }, =head2 Always issue a warning @@ -2685,7 +2722,7 @@ warn_unless => { type => 'leaf', value_type => 'string', warn => 'Always warn whenever used', - }, + }, =head2 Computed values @@ -2723,8 +2760,8 @@ parameters (host and path): type => 'leaf', value_type => 'uniline', status => 'deprecated', - }, - 'host' => { + }, + 'host' => { type => 'leaf', value_type => 'uniline', @@ -2732,19 +2769,23 @@ parameters (host and path): # as the host value migrate_from => { formula => '$old =~ m!http://([\w\.]+)!; $1 ;', - variables => { old => '- old_url' }, + variables => { + old => '- old_url' + }, use_eval => 1, }, - }, - 'path' => { + }, + 'path' => { type => 'leaf', value_type => 'uniline', migrate_from => { formula => '$old =~ m!http://[\w\.]+(/.*)!; $1 ;', - variables => { old => '- old_url' }, + variables => { + old => '- old_url' + }, use_eval => 1, }, - }, + }, =head1 EXCEPTION HANDLING diff --git a/lib/Config/Model/Value/LayeredInclude.pm b/lib/Config/Model/Value/LayeredInclude.pm index 7db7f93..56f8b4e 100644 --- a/lib/Config/Model/Value/LayeredInclude.pm +++ b/lib/Config/Model/Value/LayeredInclude.pm @@ -8,7 +8,7 @@ # The GNU Lesser General Public License, Version 2.1, February 1999 # package Config::Model::Value::LayeredInclude; -$Config::Model::Value::LayeredInclude::VERSION = '2.070'; +$Config::Model::Value::LayeredInclude::VERSION = '2.071'; use 5.010; use strict; use warnings; @@ -108,7 +108,7 @@ Config::Model::Value::LayeredInclude - Include a sub layer configuration =head1 VERSION -version 2.070 +version 2.071 =head1 SYNOPSIS diff --git a/lib/Config/Model/ValueComputer.pm b/lib/Config/Model/ValueComputer.pm index 4e271a2..419de5e 100644 --- a/lib/Config/Model/ValueComputer.pm +++ b/lib/Config/Model/ValueComputer.pm @@ -8,7 +8,7 @@ # The GNU Lesser General Public License, Version 2.1, February 1999 # package Config::Model::ValueComputer; -$Config::Model::ValueComputer::VERSION = '2.070'; +$Config::Model::ValueComputer::VERSION = '2.071'; use Mouse; use MouseX::StrictConstructor; @@ -578,7 +578,7 @@ Config::Model::ValueComputer - Provides configuration value computation =head1 VERSION -version 2.070 +version 2.071 =head1 SYNOPSIS diff --git a/lib/Config/Model/WarpedNode.pm b/lib/Config/Model/WarpedNode.pm index f03f805..7939002 100644 --- a/lib/Config/Model/WarpedNode.pm +++ b/lib/Config/Model/WarpedNode.pm @@ -8,7 +8,7 @@ # The GNU Lesser General Public License, Version 2.1, February 1999 # package Config::Model::WarpedNode; -$Config::Model::WarpedNode::VERSION = '2.070'; +$Config::Model::WarpedNode::VERSION = '2.071'; use Mouse; with "Config::Model::Role::NodeLoader"; @@ -310,7 +310,7 @@ Config::Model::WarpedNode - Node that change config class properties =head1 VERSION -version 2.070 +version 2.071 =head1 SYNOPSIS diff --git a/lib/Config/Model/Warper.pm b/lib/Config/Model/Warper.pm index 579d3c0..68c7eef 100644 --- a/lib/Config/Model/Warper.pm +++ b/lib/Config/Model/Warper.pm @@ -8,7 +8,7 @@ # The GNU Lesser General Public License, Version 2.1, February 1999 # package Config::Model::Warper; -$Config::Model::Warper::VERSION = '2.070'; +$Config::Model::Warper::VERSION = '2.071'; use Mouse; use Log::Log4perl qw(get_logger :levels); @@ -607,7 +607,7 @@ Config::Model::Warper - Warp tree properties =head1 VERSION -version 2.070 +version 2.071 =head1 SYNOPSIS diff --git a/t/load.t b/t/load.t index bc4575d..a93ddf1 100644 --- a/t/load.t +++ b/t/load.t @@ -96,6 +96,7 @@ my @regexp_test = ( [ 'a:b<c', [ 'a', ':', 'x', 'b', '<', 'c', 'x' ] ], # insert at index [ 'a:=b<c', [ 'a', ':=', 'x', 'b', '<', 'c', 'x' ] ], # insert at value [ 'a:~/b/<c', [ 'a', ':~', 'x', '/b/', '<', 'c', 'x' ] ], # insert at matching value + [ 'a:.b("foo(a > b)")', [ 'a', ':.b', '"foo(a > b)"', 'x', 'x', 'x', 'x' ] ], # tricky value with () ); foreach my $subtest (@regexp_test) { @@ -358,6 +359,11 @@ $root->load( 'lista=' . join( ',', @set1 ) . ' lista:.sort lista:.insort(' . join( ',', @set2 ) . ')' ); eq_or_diff( [ $lista->fetch_all_values ], [ sort( @set1, @set2 ) ], "check insort result" ); +# test insort with a tricky value +my $tricky = q!libmodule-build-perl (>= 0.421100-2)!; +$root->load( qq!lista:.insort("$tricky")! ); +eq_or_diff( [ $lista->fetch_all_values ], [ sort( @set1, @set2, $tricky ) ], "check insort result" ); + # test sort on ordered hash my $oh = $root->fetch_element('ordered_hash'); $root->load('ordered_hash:b=bv ordered_hash:a=av'); -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libconfig-model-perl.git _______________________________________________ Pkg-perl-cvs-commits mailing list Pkg-perl-cvs-commits@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-perl-cvs-commits