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 5e467d662bb523259711c6d0b4c9262c58fda21a Author: Dominique Dumont <d...@debian.org> Date: Sun May 3 16:03:17 2015 +0200 Imported Upstream version 2.070 --- Changes | 15 ++++ META.json | 2 +- META.yml | 2 +- lib/Config/Model.pm | 80 ++++++++++++++++------ lib/Config/Model/Annotation.pm | 4 +- lib/Config/Model/AnyId.pm | 10 +-- lib/Config/Model/AnyThing.pm | 4 +- lib/Config/Model/Backend/Any.pm | 4 +- 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 | 4 +- 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 | 28 +++++--- lib/Config/Model/TermUI.pm | 7 +- lib/Config/Model/TreeSearcher.pm | 4 +- lib/Config/Model/Utils/GenClassPod.pm | 4 +- lib/Config/Model/Value.pm | 25 +++++-- 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/array_id.t | 9 ++- t/hash_id_of_values.t | 3 + t/include.t | 2 +- t/term_ui.t | 2 +- t/value.t | 13 ++++ 50 files changed, 231 insertions(+), 133 deletions(-) diff --git a/Changes b/Changes index 5d448e4..03ba41a 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,20 @@ +2.070 2015-05-03 + + Added minor features and bug fixes: + * Model: + + added include_backend model parameter for xorg + * include no longer include read/write spec... (Debian #783952) + * Hash and Array: clear now triggers notify_change + * Value: boolean conversion (e.g yes/no to 1/0) during initial load + must not trigger a change notification... + * shell UI: + + added fix command + * added clear command for list hash and value... + 2.069 2015-04-25 + * Model: Allow inclusion of read/write specification + 2.068 2015-03-29 Small improvements: diff --git a/META.json b/META.json index f38c9b9..d702cfa 100644 --- a/META.json +++ b/META.json @@ -91,6 +91,6 @@ "web" : "http://github.com/dod38fr/config-model" } }, - "version" : "2.069" + "version" : "2.070" } diff --git a/META.yml b/META.yml index 11d4b51..2d74bd9 100644 --- a/META.yml +++ b/META.yml @@ -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.069' +version: '2.070' diff --git a/lib/Config/Model.pm b/lib/Config/Model.pm index 151a8e9..b4134b6 100644 --- a/lib/Config/Model.pm +++ b/lib/Config/Model.pm @@ -8,13 +8,15 @@ # The GNU Lesser General Public License, Version 2.1, February 1999 # package Config::Model; -$Config::Model::VERSION = '2.069'; +$Config::Model::VERSION = '2.070'; +use strict ; +use warnings; +use 5.10.1; + use Mouse; use Mouse::Util::TypeConstraints; use MouseX::StrictConstructor; -use 5.10.1; - use Carp; use Storable ('dclone'); use Data::Dumper (); @@ -224,7 +226,7 @@ my @legal_params_to_move = ( # this parameter is filled by class generated by a program. It may # be used to avoid interactive edition of a generated model 'generated_by', - qw/class_description author copyright license include include_after class/ + qw/class_description author copyright license include include_after include_backend class/ ); my @other_legal_params = qw/ author element status description summary level accept/; @@ -261,7 +263,7 @@ sub merge_included_class { my $normalized_model = $self->normalized_model($config_class_name); my $model = dclone $normalized_model ; - # add included items + # add included elements if ( $self->skip_include and defined $normalized_model->{include} ) { my $inc = $normalized_model->{include}; $model->{include} = ref $inc ? $inc : [$inc]; @@ -272,9 +274,47 @@ sub merge_included_class { # include class in raw_copy, normalized_model is left as is $self->include_class( $config_class_name, $model ); } + + # add included backend + if ( $self->skip_include and defined $normalized_model->{include_backend} ) { + my $inc = $normalized_model->{include_backend}; + $model->{include_backend} = ref $inc ? $inc : [$inc]; + } + else { + # include read/write config specifications in raw_copy, + # normalized_model is left as is + $self->include_backend( $config_class_name, $model ); + } + return $model; } +sub include_backend { + my $self = shift; + my $class_name = shift || croak "include_backend: undef includer"; + my $target_model = shift || die "include_backend:: undefined target_model"; + + my $included_classes = delete $target_model->{include_backend}; + return () unless defined $included_classes; + + foreach my $included_class (@$included_classes) { + # takes care of recursive include, because get_model will perform + # includes (and normalization). Is already a dclone + my $included_model = $self->get_model($included_class); + + foreach my $rw (qw/read_config write_config config_dir/) { + if ($target_model->{$rw} and $included_model->{$rw}) { + my $msg = "Included $rw from $included_class cannot clobber " + . "existing data in $class_name"; + Config::Model::Exception::ModelDeclaration->throw( error => $msg ); + } + elsif ($included_model->{$rw}) { + $target_model->{$rw} = $included_model->{$rw}; + } + } + } +} + sub normalize_class_parameters { my $self = shift; my $config_class_name = shift || die; @@ -1011,18 +1051,6 @@ sub include_one_class { # includes (and normalization). Is already a dclone my $included_model = $self->get_model($include_class); - # include read/write config specifications - foreach my $rw (qw/read_config write_config config_dir/) { - if ($target_model->{$rw} and $included_model->{$rw}) { - my $msg = "Included $rw from $include_class cannot clobber " - . "existing data in $class_name"; - Config::Model::Exception::ModelDeclaration->throw( error => $msg ); - } - elsif ($included_model->{$rw}) { - $target_model->{$rw} = $included_model->{$rw}; - } - } - # now include element in element_list (special treatment because order is # important) my $target_list = $target_model->{element_list}; @@ -1568,7 +1596,7 @@ Config::Model - Create tools to validate, migrate and edit configuration files =head1 VERSION -version 2.069 +version 2.070 =head1 SYNOPSIS @@ -2159,7 +2187,7 @@ L<Config::Model::Itself> model editor. =item include -Include element description and read/write specification from another class. +Include element description from another class. include => 'AnotherClass' , @@ -2183,10 +2211,22 @@ Now the element of your class will be: ( bar , foo , xyz , baz ) -Note that include may not clobber an existing element or read/write specification. +Note that include may not clobber an existing element. + +=item include_backend + +Include read/write specification from another class. + + include_backend => 'AnotherClass' , + +or + + include_backend => [qw/ClassOne ClassTwo/] =back +Note that include may not clobber an existing read/write specification. + =head2 create_config_class This method creates configuration classes. The parameters are diff --git a/lib/Config/Model/Annotation.pm b/lib/Config/Model/Annotation.pm index 96cb6c8..fec8b53 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.069'; +$Config::Model::Annotation::VERSION = '2.070'; use Mouse; use English; @@ -183,7 +183,7 @@ Config::Model::Annotation - Read and write configuration annotations =head1 VERSION -version 2.069 +version 2.070 =head1 SYNOPSIS diff --git a/lib/Config/Model/AnyId.pm b/lib/Config/Model/AnyId.pm index 9d30b0d..8e1260d 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.069'; +$Config::Model::AnyId::VERSION = '2.070'; use 5.010; use Mouse; @@ -853,7 +853,7 @@ sub delete { delete $self->{warning_hash}{$idx}; my $ret = $self->_delete($idx); - $self->notify_change( note => "deleted entry $idx" ); + $self->notify_change( note_only => "deleted entry $idx" ); return $ret; } @@ -863,7 +863,7 @@ sub clear { $self->{warning_hash} = {}; $self->_clear; $self->clear_data_mode; - $self->notify_change( note => "cleared all entries" ); + $self->notify_change( note_only => "cleared all entries" ); } sub clear_values { @@ -878,7 +878,7 @@ sub clear_values { # this will trigger a notify_change map { $self->fetch_with_id($_)->store(undef) } $self->fetch_all_indexes; - $self->notify_change( note => "cleared all values" ); + $self->notify_change( note_only => "cleared all values" ); } sub warning_msg { @@ -929,7 +929,7 @@ Config::Model::AnyId - Base class for hash or list element =head1 VERSION -version 2.069 +version 2.070 =head1 SYNOPSIS diff --git a/lib/Config/Model/AnyThing.pm b/lib/Config/Model/AnyThing.pm index 9f1700a..dcef05c 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.069'; +$Config::Model::AnyThing::VERSION = '2.070'; 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.069 +version 2.070 =head1 SYNOPSIS diff --git a/lib/Config/Model/Backend/Any.pm b/lib/Config/Model/Backend/Any.pm index bf33731..4fb41f4 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.069'; +$Config::Model::Backend::Any::VERSION = '2.070'; use Carp; use strict; use warnings; @@ -171,7 +171,7 @@ Config::Model::Backend::Any - Virtual class for other backends =head1 VERSION -version 2.069 +version 2.070 =head1 SYNOPSIS diff --git a/lib/Config/Model/Backend/Fstab.pm b/lib/Config/Model/Backend/Fstab.pm index 77d89f1..cf857b3 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.069'; +$Config::Model::Backend::Fstab::VERSION = '2.070'; 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.069 +version 2.070 =head1 SYNOPSIS diff --git a/lib/Config/Model/Backend/IniFile.pm b/lib/Config/Model/Backend/IniFile.pm index 5c30984..2ca40a2 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.069'; +$Config::Model::Backend::IniFile::VERSION = '2.070'; 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.069 +version 2.070 =head1 SYNOPSIS diff --git a/lib/Config/Model/Backend/Json.pm b/lib/Config/Model/Backend/Json.pm index 8cb42ed..e10cc74 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.069'; +$Config::Model::Backend::Json::VERSION = '2.070'; 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.069 +version 2.070 =head1 SYNOPSIS diff --git a/lib/Config/Model/Backend/PlainFile.pm b/lib/Config/Model/Backend/PlainFile.pm index 7d3fab5..9ba81ba 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.069'; +$Config::Model::Backend::PlainFile::VERSION = '2.070'; 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.069 +version 2.070 =head1 SYNOPSIS diff --git a/lib/Config/Model/Backend/ShellVar.pm b/lib/Config/Model/Backend/ShellVar.pm index 2713c93..eeb73f8 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.069'; +$Config::Model::Backend::ShellVar::VERSION = '2.070'; 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.069 +version 2.070 =head1 SYNOPSIS diff --git a/lib/Config/Model/Backend/Yaml.pm b/lib/Config/Model/Backend/Yaml.pm index d349dcb..6f47f56 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.069'; +$Config::Model::Backend::Yaml::VERSION = '2.070'; 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.069 +version 2.070 =head1 SYNOPSIS diff --git a/lib/Config/Model/BackendMgr.pm b/lib/Config/Model/BackendMgr.pm index 23f9d5b..44ef5e0 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.069'; +$Config::Model::BackendMgr::VERSION = '2.070'; use Mouse; use Carp; @@ -768,7 +768,7 @@ Config::Model::BackendMgr - Load configuration node on demand =head1 VERSION -version 2.069 +version 2.070 =head1 SYNOPSIS diff --git a/lib/Config/Model/CheckList.pm b/lib/Config/Model/CheckList.pm index 9872c59..189bc6e 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.069'; +$Config::Model::CheckList::VERSION = '2.070'; use Mouse; use 5.010; @@ -701,7 +701,7 @@ Config::Model::CheckList - Handle check list element =head1 VERSION -version 2.069 +version 2.070 =head1 SYNOPSIS diff --git a/lib/Config/Model/Cookbook/CreateModelFromDoc.pod b/lib/Config/Model/Cookbook/CreateModelFromDoc.pod index ccc9c67..9fd9c79 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.069 +version 2.070 =head1 Introduction diff --git a/lib/Config/Model/Describe.pm b/lib/Config/Model/Describe.pm index 8db1b21..4d93db5 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.069'; +$Config::Model::Describe::VERSION = '2.070'; use Carp; use strict; use warnings; @@ -174,7 +174,7 @@ Config::Model::Describe - Provide a description of a node element =head1 VERSION -version 2.069 +version 2.070 =head1 SYNOPSIS diff --git a/lib/Config/Model/DumpAsData.pm b/lib/Config/Model/DumpAsData.pm index fbcca87..c367aa8 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.069'; +$Config::Model::DumpAsData::VERSION = '2.070'; 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.069 +version 2.070 =head1 SYNOPSIS diff --git a/lib/Config/Model/Dumper.pm b/lib/Config/Model/Dumper.pm index 40269c1..ba72d20 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.069'; +$Config::Model::Dumper::VERSION = '2.070'; use Carp; use strict; use warnings; @@ -256,7 +256,7 @@ Config::Model::Dumper - Serialize data of config tree =head1 VERSION -version 2.069 +version 2.070 =head1 SYNOPSIS diff --git a/lib/Config/Model/Exception.pm b/lib/Config/Model/Exception.pm index 5fc4580..deb64b4 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.069'; +$Config::Model::Exception::VERSION = '2.070'; 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.069'; +$Config::Model::Exception::Syntax::VERSION = '2.070'; sub full_message { my $self = shift; @@ -151,7 +151,7 @@ sub full_message { } package Config::Model::Exception::Any; -$Config::Model::Exception::Any::VERSION = '2.069'; +$Config::Model::Exception::Any::VERSION = '2.070'; sub full_message { my $self = shift; @@ -180,7 +180,7 @@ sub xpath_message { } package Config::Model::Exception::LoadData; -$Config::Model::Exception::LoadData::VERSION = '2.069'; +$Config::Model::Exception::LoadData::VERSION = '2.070'; sub full_message { my $self = shift; @@ -198,7 +198,7 @@ sub full_message { } package Config::Model::Exception::Model; -$Config::Model::Exception::Model::VERSION = '2.069'; +$Config::Model::Exception::Model::VERSION = '2.070'; sub full_message { my $self = shift; @@ -226,7 +226,7 @@ sub full_message { } package Config::Model::Exception::Load; -$Config::Model::Exception::Load::VERSION = '2.069'; +$Config::Model::Exception::Load::VERSION = '2.070'; sub full_message { my $self = shift; @@ -249,7 +249,7 @@ sub full_message { } package Config::Model::Exception::UnavailableElement; -$Config::Model::Exception::UnavailableElement::VERSION = '2.069'; +$Config::Model::Exception::UnavailableElement::VERSION = '2.070'; sub full_message { my $self = shift; @@ -273,7 +273,7 @@ sub full_message { } package Config::Model::Exception::ObsoleteElement; -$Config::Model::Exception::ObsoleteElement::VERSION = '2.069'; +$Config::Model::Exception::ObsoleteElement::VERSION = '2.070'; sub full_message { my $self = shift; @@ -292,7 +292,7 @@ sub full_message { } package Config::Model::Exception::UnknownElement; -$Config::Model::Exception::UnknownElement::VERSION = '2.069'; +$Config::Model::Exception::UnknownElement::VERSION = '2.070'; use Carp; @@ -361,7 +361,7 @@ sub full_message { } package Config::Model::Exception::UnknownId; -$Config::Model::Exception::UnknownId::VERSION = '2.069'; +$Config::Model::Exception::UnknownId::VERSION = '2.070'; sub full_message { my $self = shift; @@ -389,7 +389,7 @@ sub full_message { } package Config::Model::Exception::WrongType; -$Config::Model::Exception::WrongType::VERSION = '2.069'; +$Config::Model::Exception::WrongType::VERSION = '2.070'; 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.069'; +$Config::Model::Exception::ConfigFile::Missing::VERSION = '2.070'; sub full_message { my $self = shift; @@ -425,7 +425,7 @@ sub full_message { } package Config::Model::Exception::Xml; -$Config::Model::Exception::Xml::VERSION = '2.069'; +$Config::Model::Exception::Xml::VERSION = '2.070'; sub full_message { my $self = shift; @@ -455,7 +455,7 @@ Config::Model::Exception - Exception mechanism for configuration model =head1 VERSION -version 2.069 +version 2.070 =head1 SYNOPSIS diff --git a/lib/Config/Model/FuseUI.pm b/lib/Config/Model/FuseUI.pm index f2c6e92..d9604a6 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.069'; +$Config::Model::FuseUI::VERSION = '2.070'; # 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.069 +version 2.070 =head1 SYNOPSIS diff --git a/lib/Config/Model/HashId.pm b/lib/Config/Model/HashId.pm index c7d3e6a..1aba3ad 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.069'; +$Config::Model::HashId::VERSION = '2.070'; use Mouse; use Config::Model::Exception; @@ -506,7 +506,7 @@ Config::Model::HashId - Handle hash element for configuration model =head1 VERSION -version 2.069 +version 2.070 =head1 SYNOPSIS diff --git a/lib/Config/Model/IdElementReference.pm b/lib/Config/Model/IdElementReference.pm index 6627f32..4450628 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.069'; +$Config::Model::IdElementReference::VERSION = '2.070'; use Mouse; use Carp; @@ -192,7 +192,7 @@ Config::Model::IdElementReference - Refer to id element(s) and extract keys =head1 VERSION -version 2.069 +version 2.070 =head1 SYNOPSIS diff --git a/lib/Config/Model/Instance.pm b/lib/Config/Model/Instance.pm index e69cf6c..0528a3c 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.069'; +$Config::Model::Instance::VERSION = '2.070'; #use Scalar::Util qw(weaken) ; use 5.10.1; @@ -522,7 +522,7 @@ Config::Model::Instance - Instance of configuration tree =head1 VERSION -version 2.069 +version 2.070 =head1 SYNOPSIS diff --git a/lib/Config/Model/Iterator.pm b/lib/Config/Model/Iterator.pm index 11df724..b42eedf 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.069'; +$Config::Model::Iterator::VERSION = '2.070'; use Carp; use strict; use warnings; @@ -275,7 +275,7 @@ Config::Model::Iterator - Iterates forward or backward a configuration tree =head1 VERSION -version 2.069 +version 2.070 =head1 SYNOPSIS diff --git a/lib/Config/Model/ListId.pm b/lib/Config/Model/ListId.pm index e51ced2..b56918e 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.069'; +$Config::Model::ListId::VERSION = '2.070'; use 5.10.1; use Mouse; @@ -497,7 +497,7 @@ Config::Model::ListId - Handle list element for configuration model =head1 VERSION -version 2.069 +version 2.070 =head1 SYNOPSIS diff --git a/lib/Config/Model/Lister.pm b/lib/Config/Model/Lister.pm index 21f93d0..bf6bd85 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.069'; +$Config::Model::Lister::VERSION = '2.070'; use strict; use warnings; use Exporter; @@ -83,7 +83,7 @@ Config::Model::Lister - List available models and applications =head1 VERSION -version 2.069 +version 2.070 =head1 SYNOPSIS diff --git a/lib/Config/Model/Loader.pm b/lib/Config/Model/Loader.pm index cf77db7..8585b65 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.069'; +$Config::Model::Loader::VERSION = '2.070'; use Carp; use strict; use warnings; @@ -753,7 +753,7 @@ Config::Model::Loader - Load serialized data into config tree =head1 VERSION -version 2.069 +version 2.070 =head1 SYNOPSIS diff --git a/lib/Config/Model/Manual/ModelCreationAdvanced.pod b/lib/Config/Model/Manual/ModelCreationAdvanced.pod index 35a67da..cba0d0c 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.069 +version 2.070 =head1 Introduction diff --git a/lib/Config/Model/Manual/ModelCreationIntroduction.pod b/lib/Config/Model/Manual/ModelCreationIntroduction.pod index 95e3840..da746f5 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.069 +version 2.070 =head1 Introduction diff --git a/lib/Config/Model/Node.pm b/lib/Config/Model/Node.pm index cfa914d..d83e60c 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.069'; +$Config::Model::Node::VERSION = '2.070'; use Mouse; with "Config::Model::Role::NodeLoader"; @@ -1127,7 +1127,7 @@ Config::Model::Node - Class for configuration tree node =head1 VERSION -version 2.069 +version 2.070 =head1 SYNOPSIS diff --git a/lib/Config/Model/ObjTreeScanner.pm b/lib/Config/Model/ObjTreeScanner.pm index 235aa8b..dea2178 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.069'; +$Config::Model::ObjTreeScanner::VERSION = '2.070'; 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.069 +version 2.070 =head1 SYNOPSIS diff --git a/lib/Config/Model/Report.pm b/lib/Config/Model/Report.pm index 9a6e4fc..01cb52f 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.069'; +$Config::Model::Report::VERSION = '2.070'; use Carp; use strict; use warnings; @@ -90,7 +90,7 @@ Config::Model::Report - Reports data from config tree =head1 VERSION -version 2.069 +version 2.070 =head1 SYNOPSIS diff --git a/lib/Config/Model/Role/NodeLoader.pm b/lib/Config/Model/Role/NodeLoader.pm index c46a1e4..d25b4b7 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.069'; +$Config::Model::Role::NodeLoader::VERSION = '2.070'; # 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.069 +version 2.070 =head1 SYNOPSIS diff --git a/lib/Config/Model/SearchElement.pm b/lib/Config/Model/SearchElement.pm index f8c7cd1..9019287 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.069'; +$Config::Model::SearchElement::VERSION = '2.070'; 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.069 +version 2.070 =head1 SYNOPSIS diff --git a/lib/Config/Model/SimpleUI.pm b/lib/Config/Model/SimpleUI.pm index 9341767..c3d9f54 100644 --- a/lib/Config/Model/SimpleUI.pm +++ b/lib/Config/Model/SimpleUI.pm @@ -8,7 +8,7 @@ # The GNU Lesser General Public License, Version 2.1, February 1999 # package Config::Model::SimpleUI; -$Config::Model::SimpleUI::VERSION = '2.069'; +$Config::Model::SimpleUI::VERSION = '2.070'; use Carp; use strict; use warnings; @@ -18,8 +18,8 @@ cd <elt> cd <elt:key>, cd - , cd ! -> jump into node set elt=value, elt:key=value -> set a value -reset elt - -> reset a value (set to undef) +clear elt + -> clear value or list or hash delete elt:key -> delete a value from a list or hash element delete elt @@ -33,6 +33,7 @@ desc[ription] -> show class desc of current node desc <element> -> show desc of element from current node desc <value> -> show effect of value (for enum) changes -> list unsaved changes +fix -> fix most warnings (called on all elements) save -> save current changes exit -> exit shell '; @@ -152,11 +153,15 @@ my %run_dispatch = ( } return ''; }, - reset => sub { + clear => sub { my ( $self, $elt_name ) = @_; - $self->{current_node}->fetch_element($elt_name)->store(undef); + $self->{current_node}->fetch_element($elt_name)->clear(); return ''; }, + fix => sub { + my ( $self, $dir ) = @_; + return $self->{root}->instance->apply_fixes; + }, save => sub { my ($self) = @_; $self->{root}->instance->write_back(); @@ -172,6 +177,8 @@ my %run_dispatch = ( desc => $desc_sub, ); +$run_dispatch{reset} = $run_dispatch{clear}; + sub simple_ui_commands { sort keys %run_dispatch; } @@ -282,7 +289,7 @@ Config::Model::SimpleUI - Simple interface for Config::Model =head1 VERSION -version 2.069 +version 2.070 =head1 SYNOPSIS @@ -399,9 +406,9 @@ Set a leaf value. Set a leaf value locate in a hash or list element. -=item reset elt +=item clear elt -Delete leaf value (set to C<undef>). +Clear leaf value (set to C<undef>) or removed all elements of hash or list. =item delete elt @@ -443,6 +450,11 @@ Show effect of value (for enum) Show unsaved changes +=item fix + +Fix most warnings by calling +L<apply_fixes|Config::Model::Instance/apply_fixes> on instance. + =item exit Exit shell diff --git a/lib/Config/Model/TermUI.pm b/lib/Config/Model/TermUI.pm index 03423ea..ed92ec8 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.069'; +$Config::Model::TermUI::VERSION = '2.070'; use Carp; use strict; use warnings; @@ -99,9 +99,10 @@ my %completion_dispatch = ( desc => $completion_sub, ll => $completion_sub, ls => $completion_sub, + clear => $completion_sub, set => $leaf_completion_sub, delete => $leaf_completion_sub, - reset => $leaf_completion_sub, + reset => $completion_sub, ); sub completion { @@ -210,7 +211,7 @@ Config::Model::TermUI - Provides Config::Model UI with Term::ReadLine =head1 VERSION -version 2.069 +version 2.070 =head1 SYNOPSIS diff --git a/lib/Config/Model/TreeSearcher.pm b/lib/Config/Model/TreeSearcher.pm index 51c75e7..bf82e77 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.069'; +$Config::Model::TreeSearcher::VERSION = '2.070'; use Mouse; use Mouse::Util::TypeConstraints; @@ -147,7 +147,7 @@ Config::Model::TreeSearcher - Search tree for match in value, description... =head1 VERSION -version 2.069 +version 2.070 =head1 SYNOPSIS diff --git a/lib/Config/Model/Utils/GenClassPod.pm b/lib/Config/Model/Utils/GenClassPod.pm index e87752a..c4e8344 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.069'; +$Config::Model::Utils::GenClassPod::VERSION = '2.070'; # 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.069 +version 2.070 =head1 SYNOPSIS diff --git a/lib/Config/Model/Value.pm b/lib/Config/Model/Value.pm index f7ce67c..92184f3 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.069'; +$Config::Model::Value::VERSION = '2.070'; use 5.10.1; use Mouse; @@ -1159,14 +1159,17 @@ sub store { # $self->{data} represents what written in the file my $old_value = $self->{data}; - my $value = $self->transform_value( value => $args{value}, check => $check ); + my $incoming_value = $args{value}; + $self->transform_boolean( \$incoming_value ) if $self->value_type eq 'boolean'; + + my $value = $self->transform_value( value => $incoming_value, check => $check ); no warnings qw/uninitialized/; if ($self->instance->initial_load) { # may send more than one notification - if ( $args{value} ne $value ) { + if ( $incoming_value ne $value ) { # data was transformed by model - $self->notify_change(really => 1, old => $args{value} , new => $value, note =>"initial value changed by model"); + $self->notify_change(really => 1, old => $incoming_value , new => $value, note =>"initial value changed by model"); } if (defined $old_value and $old_value ne $value) { $self->notify_change(really => 1, old => $old_value , new => $value, note =>"conflicting initial values"); @@ -1322,8 +1325,6 @@ sub transform_value { $self->{ref_object}->get_choice_from_refered_to; } - $self->transform_boolean( \$value ) if $self->value_type eq 'boolean'; - $value = $self->{convert_sub}($value) if ( defined $self->{convert_sub} and defined $value ); @@ -1696,6 +1697,11 @@ sub fetch_preset { return $self->map_write_as( $self->{preset} ); } +sub clear { + my $self = shift; + $self->store(undef); +} + sub clear_preset { my $self = shift; delete $self->{preset}; @@ -1787,7 +1793,7 @@ Config::Model::Value - Strongly typed configuration value =head1 VERSION -version 2.069 +version 2.070 =head1 SYNOPSIS @@ -2416,6 +2422,11 @@ skip validation check. Optional C<callback> is now deprecated. +=head2 clear + +Clear the stored value. Further read will return the default value (or +computed or migrated value). + =head2 load_data( scalar_value ) Load scalar data. Data is simply forwarded to L<store>. diff --git a/lib/Config/Model/Value/LayeredInclude.pm b/lib/Config/Model/Value/LayeredInclude.pm index 702e905..7db7f93 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.069'; +$Config::Model::Value::LayeredInclude::VERSION = '2.070'; use 5.010; use strict; use warnings; @@ -108,7 +108,7 @@ Config::Model::Value::LayeredInclude - Include a sub layer configuration =head1 VERSION -version 2.069 +version 2.070 =head1 SYNOPSIS diff --git a/lib/Config/Model/ValueComputer.pm b/lib/Config/Model/ValueComputer.pm index 5c5d97d..4e271a2 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.069'; +$Config::Model::ValueComputer::VERSION = '2.070'; use Mouse; use MouseX::StrictConstructor; @@ -578,7 +578,7 @@ Config::Model::ValueComputer - Provides configuration value computation =head1 VERSION -version 2.069 +version 2.070 =head1 SYNOPSIS diff --git a/lib/Config/Model/WarpedNode.pm b/lib/Config/Model/WarpedNode.pm index 3bf0aa8..f03f805 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.069'; +$Config::Model::WarpedNode::VERSION = '2.070'; use Mouse; with "Config::Model::Role::NodeLoader"; @@ -310,7 +310,7 @@ Config::Model::WarpedNode - Node that change config class properties =head1 VERSION -version 2.069 +version 2.070 =head1 SYNOPSIS diff --git a/lib/Config/Model/Warper.pm b/lib/Config/Model/Warper.pm index cf98066..579d3c0 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.069'; +$Config::Model::Warper::VERSION = '2.070'; use Mouse; use Log::Log4perl qw(get_logger :levels); @@ -607,7 +607,7 @@ Config::Model::Warper - Warp tree properties =head1 VERSION -version 2.069 +version 2.070 =head1 SYNOPSIS diff --git a/t/array_id.t b/t/array_id.t index 48a3dcc..2aeb4a1 100644 --- a/t/array_id.t +++ b/t/array_id.t @@ -350,12 +350,15 @@ foreach my $what (qw/forbid warn suppress/) { 'string1', "check that original values is untouched after $what duplicates" ); } +$inst->clear_changes; +$pl->clear; +is( $inst->needs_save, 1, "verify instance needs_save status after clear array" ); +eq_or_diff( [ $pl->fetch_all_indexes ], [], "check that array was cleared" ); +eq_or_diff([$inst->list_changes],['plain_list: cleared all entries'],"check change message after clear"); + # test preset clear stuff # done after auto_create_ids tests, because preset_clear or layered_clear # also clean up auto_create_ids (if there's no data in there) -$pl->clear; -eq_or_diff( [ $pl->fetch_all_indexes ], [], "check that preset stuff was cleared" ); - $inst->preset_start; $pl->fetch_with_id(0)->store('prefoo'); $pl->fetch_with_id(1)->store('prebar'); diff --git a/t/hash_id_of_values.t b/t/hash_id_of_values.t index cf15e7f..6e3f325 100644 --- a/t/hash_id_of_values.t +++ b/t/hash_id_of_values.t @@ -368,7 +368,10 @@ $oh->move_after( 'd', 'e' ); eq_or_diff( [ $oh->fetch_all_indexes ], [qw/a z x e d/], "check index order of ordered_hash after move_after(d e)" ); +$inst->clear_changes; $oh->clear; +is( $inst->needs_save, 1, "verify instance needs_save status after clear" ); +eq_or_diff([$inst->list_changes],['ordered_hash: cleared all entries'],"check change message after clear"); eq_or_diff( [ $oh->fetch_all_indexes ], [], "check index order of ordered_hash after clear" ); $oh->load_data( [qw/a va b vb c vc d vd e ve/] ); diff --git a/t/include.t b/t/include.t index c5bceac..1f035c6 100644 --- a/t/include.t +++ b/t/include.t @@ -98,7 +98,7 @@ throws_ok { $model->get_model('EvilMaster'); } qr/cannot clobber/i, # test include of read/write spec $model->create_config_class( name => 'LikeXorg', - 'include' => [ + 'include_backend' => [ 'Xorg::ConfigDir' ], element => [ diff --git a/t/term_ui.t b/t/term_ui.t index 8c9b4c3..16f549e 100644 --- a/t/term_ui.t +++ b/t/term_ui.t @@ -79,7 +79,7 @@ my @std_id_list = ('std_id:','std_id:ab ','std_id:"abc def" ' ,'std_id:"abc hij" my @test = ( # text line start ## expected completions [ [ '', '', 0 ], - [qw/cd changes delete desc description display dump help ll ls reset save set/] + [qw/cd changes clear delete desc description display dump fix help ll ls reset save set/] ], [ [ '', 'cd ', 3 ], [ '!', '-', @std_id_list , 'olist:', 'warp ', 'slave_y ' ] ], [ [ 's', 'cd s', 3 ], [ @std_id_list, 'slave_y ' ] ], diff --git a/t/value.t b/t/value.t index 62cbd2b..e986127 100644 --- a/t/value.t +++ b/t/value.t @@ -394,10 +394,18 @@ while (@bool_test) { is( $mb->fetch, $read, "mandatory boolean: store $store and read $read value" ); } +$inst->clear_changes; my $bwwa = $root->fetch_element('boolean_with_write_as'); is( $bwwa->fetch, undef, "boolean_with_write_as reads undef" ); $bwwa->store('no'); is( $bwwa->fetch, 'false', "boolean_with_write_as returns 'false'" ); +is( $inst->needs_save, 1, "check needs_save after writing 'boolean_with_write_as'" ); +eq_or_diff([$inst->list_changes],["boolean_with_write_as: '<undef>' -> '0'"], + "check change message after writing 'boolean_with_write_as'"); + +$bwwa->store('false'); +is( $inst->needs_save, 1, "check needs_save after writing twice 'boolean_with_write_as'" ); + $bwwa->store(1); is( $bwwa->fetch, 'true', "boolean_with_write_as returns 'true'" ); @@ -762,6 +770,11 @@ $s->parent->fetch_element('uc_convert')->store('foo'); eq_or_diff([$inst2->list_changes],['uc_convert: \'foo\' -> \'FOO\' # initial value changed by model'], "check change message when model changes data coming from config file"); +$inst2->clear_changes; +$s->parent->fetch_element('boolean_with_write_as')->store('true'); +is( $inst2->needs_save, 0, "verify instance needs_save status after writing 'boolean_with_write_as'" ); + + $inst2->initial_load_stop; -- 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