r55043 - in /branches/upstream/libconfig-model-itself-perl/current: ./ data/ lib/Config/Model/ lib/Config/Model/Itself/ lib/Config/Model/models/Itself/ t/
gregoa at users.alioth.debian.org
gregoa at users.alioth.debian.org
Mon Mar 29 19:39:49 UTC 2010
Author: gregoa
Date: Mon Mar 29 19:39:43 2010
New Revision: 55043
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=55043
Log:
[svn-upgrade] Integrating new upstream version, libconfig-model-itself-perl (1.213)
Added:
branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/Itself/BackendDetector.pm
branches/upstream/libconfig-model-itself-perl/current/t/backend_detect.t
Modified:
branches/upstream/libconfig-model-itself-perl/current/Build.PL
branches/upstream/libconfig-model-itself-perl/current/ChangeLog
branches/upstream/libconfig-model-itself-perl/current/MANIFEST
branches/upstream/libconfig-model-itself-perl/current/META.yml
branches/upstream/libconfig-model-itself-perl/current/config-model-edit
branches/upstream/libconfig-model-itself-perl/current/data/MasterModel.pl
branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/Itself.pm
branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/Itself/TkEditUI.pm
branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/CargoElement.pl
branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/Class.pl
branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/CommonElement.pl
branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/ComputedValue.pl
branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/Element.pl
branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/Model.pl
branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/NonWarpableElement.pl
branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/WarpRule.pl
branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/WarpValue.pl
branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/WarpableElement.pl
branches/upstream/libconfig-model-itself-perl/current/t/dot_graph.t
branches/upstream/libconfig-model-itself-perl/current/t/itself-editor.t
branches/upstream/libconfig-model-itself-perl/current/t/itself.t
Modified: branches/upstream/libconfig-model-itself-perl/current/Build.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-model-itself-perl/current/Build.PL?rev=55043&op=diff
==============================================================================
--- branches/upstream/libconfig-model-itself-perl/current/Build.PL (original)
+++ branches/upstream/libconfig-model-itself-perl/current/Build.PL Mon Mar 29 19:39:43 2010
@@ -1,7 +1,3 @@
-# $Author: ddumont $
-# $Date: 2008-02-07 11:29:57 $
-# $Revision: 1.3 $
-
# Copyright (c) 2007-2010 Dominique Dumont.
#
# This file is part of Config-Model-Itself.
@@ -35,9 +31,11 @@
dist_author => "Dominique Dumont (ddumont at cpan dot org)",
dist_abstract => "Graphical model editor for Config::Model",
requires => {
- 'Config::Model' => '0.643',
+ 'Config::Model' => '1.001',
'Log::Log4perl' => 0 ,
'Config::Model::TkUI' => '1.210',
+ 'Pod::POM' => 0,
+ 'YAML::Any' => 0,
},
script_files => [ 'config-model-edit' ],
add_to_cleanup => [qw/wr_test/] ,
Modified: branches/upstream/libconfig-model-itself-perl/current/ChangeLog
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-model-itself-perl/current/ChangeLog?rev=55043&op=diff
==============================================================================
--- branches/upstream/libconfig-model-itself-perl/current/ChangeLog (original)
+++ branches/upstream/libconfig-model-itself-perl/current/ChangeLog Mon Mar 29 19:39:43 2010
@@ -1,6 +1,27 @@
+2010-03-25 Dominique Dumont <dominique.dumont at hp.com> 1.213
+
+ * lib/Config/Model/Itself/BackendDetector.pm (): New class derived
+ from Config::Model::Value so config-model-edit can detect
+ available read/write plugin backend and propose relevant choice
+ for 'backend' model specification.
+
+ * Build.PL: Added dedendency on Pod::POM, depends on Config::Model
+ 1.001
+
+2010-03-17 Dominique Dumont <domi.dumont at free.fr>
+
+ * lib/Config/Model/models/Itself/CommonElement.pl: add match
+ parameter from Config::Model 1.001
+
+2010-03-16 Dominique Dumont <dominique.dumont at hp.com>
+
+ * config-model-edit (): can use -force_load when loading data or
+ yaml data.
+ * Build.PL: depends on YAML::Any
+
2010-02-26 Dominique Dumont <dominique.dumont at hp.com> 1.212
- * Build.PL: depend on Config::Model 0.643
+ * Build.PL: depends on Config::Model 0.643
2010-02-25 Dominique Dumont <dominique.dumont at hp.com>
Modified: branches/upstream/libconfig-model-itself-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-model-itself-perl/current/MANIFEST?rev=55043&op=diff
==============================================================================
--- branches/upstream/libconfig-model-itself-perl/current/MANIFEST (original)
+++ branches/upstream/libconfig-model-itself-perl/current/MANIFEST Mon Mar 29 19:39:43 2010
@@ -14,6 +14,7 @@
data/MasterModel/References.pl
data/MasterModel/X_base_class.pl
lib/Config/Model/Itself.pm
+lib/Config/Model/Itself/BackendDetector.pm
lib/Config/Model/Itself/TkEditUI.pm
lib/Config/Model/models/Itself/CargoElement.pl
lib/Config/Model/models/Itself/CargoWarpRule.pl
@@ -30,6 +31,7 @@
lib/Config/Model/models/Itself/WarpValue.pl
lib/Config/Model/models/Itself/WarpableCargoElement.pl
lib/Config/Model/models/Itself/WarpableElement.pl
+t/backend_detect.t
t/dot_graph.t
t/itself.t
t/itself-editor.t
Modified: branches/upstream/libconfig-model-itself-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-model-itself-perl/current/META.yml?rev=55043&op=diff
==============================================================================
--- branches/upstream/libconfig-model-itself-perl/current/META.yml (original)
+++ branches/upstream/libconfig-model-itself-perl/current/META.yml Mon Mar 29 19:39:43 2010
@@ -13,14 +13,19 @@
provides:
Config::Model::Itself:
file: lib/Config/Model/Itself.pm
- version: 1.212
+ version: 1.213
+ Config::Model::Itself::BackendDetector:
+ file: lib/Config/Model/Itself/BackendDetector.pm
+ version: 1.001
Config::Model::Itself::TkEditUI:
file: lib/Config/Model/Itself/TkEditUI.pm
- version: 1.0615
+ version: 1.212
requires:
- Config::Model: 0.643
+ Config::Model: 1.001
Config::Model::TkUI: 1.210
Log::Log4perl: 0
+ Pod::POM: 0
+ YAML::Any: 0
resources:
- license: http://opensource.org/licenses/lgpl-license.php
-version: 1.212
+ license: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt
+version: 1.213
Modified: branches/upstream/libconfig-model-itself-perl/current/config-model-edit
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-model-itself-perl/current/config-model-edit?rev=55043&op=diff
==============================================================================
--- branches/upstream/libconfig-model-itself-perl/current/config-model-edit (original)
+++ branches/upstream/libconfig-model-itself-perl/current/config-model-edit Mon Mar 29 19:39:43 2010
@@ -27,14 +27,13 @@
use Pod::Usage ;
use Log::Log4perl ;
use Config::Model::Itself ;
+use YAML::Any;
use Tk ;
use Config::Model::TkUI ;
use Config::Model::Itself::TkEditUI ;
# lame tracing that will be replaced by Log4perl
-use vars qw/$verbose $debug $VERSION/ ;
-
-$VERSION = sprintf "1.%04d", q$Revision: 1094 $ =~ /(\d+)/;
+use vars qw/$verbose $debug/ ;
$verbose = 0;
$debug = 0;
@@ -133,7 +132,7 @@
Provides a full stack trace when exiting on error.
-=item -force-load
+=item -force_load
Load file even if error are found in data. Bad data are discarded
@@ -271,6 +270,8 @@
legacy =>'ignore',
) ;
+$meta_inst->push_no_value_check(qw/store type/) if $force_load ;
+
if (defined $load) {
my $data = load_data($load) ;
$meta_root->load($data);
@@ -278,8 +279,6 @@
if (defined $load_yaml) {
my $yaml = load_data($load_yaml) ;
- require YAML::Tiny;
- import YAML::Tiny qw/Load/;
my $pdata = Load($yaml) ;
$meta_root->load_data($pdata) ;
}
@@ -287,6 +286,9 @@
if (@ARGV) {
$meta_root->load("@ARGV") ;
}
+
+$meta_inst->pop_no_value_check() if $force_load ;
+
if ($do_dot) {
print $rw_obj->get_dot_diagram ;
@@ -381,6 +383,3 @@
=cut
-
-
-
Modified: branches/upstream/libconfig-model-itself-perl/current/data/MasterModel.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-model-itself-perl/current/data/MasterModel.pl?rev=55043&op=diff
==============================================================================
--- branches/upstream/libconfig-model-itself-perl/current/data/MasterModel.pl (original)
+++ branches/upstream/libconfig-model-itself-perl/current/data/MasterModel.pl Mon Mar 29 19:39:43 2010
@@ -222,6 +222,10 @@
type => 'node',
config_class_name => 'MasterModel::References',
},
+ match => { type => 'leaf',
+ value_type => 'string',
+ match => '^foo\d{2}$',
+ },
## too difficult to correctly test Augeas here
'sshd_augeas'
=> {
Modified: branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/Itself.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/Itself.pm?rev=55043&op=diff
==============================================================================
--- branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/Itself.pm (original)
+++ branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/Itself.pm Mon Mar 29 19:39:43 2010
@@ -1,12 +1,8 @@
-# $Author: ddumont $
-# $Date: 2010-02-25 13:32:26 +0100 (Thu, 25 Feb 2010) $
-# $Revision: 1094 $
-
# Copyright (c) 2007-2010 Dominique Dumont.
#
# This file is part of Config-Model-Itself.
#
-# Config-Xorg is free software; you can redistribute it and/or
+# Config-Model-Itself is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser Public License as
# published by the Free Software Foundation; either version 2.1 of
# the License, or (at your option) any later version.
@@ -32,9 +28,7 @@
use File::Path ;
use File::Basename ;
-use vars qw($VERSION) ;
-
-$VERSION = '1.212';
+our $VERSION = '1.213';
my $logger = Log::Log4perl::get_logger(__PACKAGE__);
@@ -78,7 +72,7 @@
=head1 DESCRIPTION
-The Config::Itself and its model files provide a model of Config:Model
+Config::Itself module and its model files provide a model of Config:Model
(hence the Itself name).
Let's step back a little to explain. Any configuration data is, in
Added: branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/Itself/BackendDetector.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/Itself/BackendDetector.pm?rev=55043&op=file
==============================================================================
--- branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/Itself/BackendDetector.pm (added)
+++ branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/Itself/BackendDetector.pm Mon Mar 29 19:39:43 2010
@@ -1,0 +1,153 @@
+# Copyright (c) 2010 Dominique Dumont.
+#
+# This file is part of Config-Model-Itself.
+#
+# Config-Model-Itself is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser Public License as
+# published by the Free Software Foundation; either version 2.1 of
+# the License, or (at your option) any later version.
+#
+# Config-Xorg is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser Public License for more details.
+#
+# You should have received a copy of the GNU Lesser Public License
+# along with Config-Model; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+
+package Config::Model::Itself::BackendDetector ;
+
+use Pod::POM ;
+
+use base qw/Config::Model::Value/ ;
+
+use strict ;
+use warnings ;
+
+our $VERSION="1.001";
+
+sub setup_enum_choice {
+ my $self = shift ;
+ my @choices = ref $_[0] ? @{$_[0]} : @_ ;
+
+ #find available backends
+
+ my $path = $INC{"Config/Model.pm"} ;
+ $path =~ s!\.pm!/Backend! ;
+
+ if (-d $path) {
+ opendir(BACK,$path) || die "Can't opendir $path:$!" ;
+ foreach (readdir(BACK)) {
+ next unless s/\.pm// ;
+ next if /Any$/ ; # Virtual class
+ s!/!::!g ;
+ push @choices , $_ ;
+ }
+ }
+
+ $self->SUPER::setup_enum_choice(@choices) ;
+}
+
+sub set_help {
+ my ($self,$args) = @_ ;
+
+ my $help = delete $args->{help} || {} ;
+
+ my $path = $INC{"Config/Model.pm"} ;
+ $path =~ s!\.pm!/Backend! ;
+
+ if (-d $path) {
+ my $parser = Pod::POM->new();
+
+ opendir(BACK,$path) || die "Can't opendir $path:$!" ;
+ foreach (readdir(BACK)) {
+ next unless /\.pm$/ ;
+ next if /Any$/ ; # Virtual class
+ my ($backend) = ( /(\w+)\.pm/ ) ;
+ my $file = "$path/$_" ;
+ my ($backend_class) = ($file =~ m!(Config/Model/Backend/\w*)\.pm! ) ;
+ $backend_class =~ s!/!::!g ;
+
+ my $pom = $parser->parse_file($file)|| die $parser->error();
+
+ foreach my $head1 ($pom->head1()) {
+ if ($head1->title() eq 'NAME') {
+ my $c = $head1->content();
+ $c =~ s/.*?-\s*//;
+ $c =~ s/\n//g;
+ $help->{$backend} = $c . " provided by $backend_class";
+ last ;
+ }
+ }
+ }
+ }
+
+ $self->{help} = $help;
+}
+
+1;
+
+__END__
+
+=head1 NAME
+
+Config::Model::Itself::BackendDetector - Detect available read/write backends
+
+=head1 SYNOPSIS
+
+ # this class should be referenced in a configuration model and
+ # created only by Config::Model::Node
+
+ my $model = Config::Model->new() ;
+
+ $model ->create_config_class
+ (
+ name => "Test",
+ 'element'
+ => [
+ 'backend' => { type => 'leaf',
+ class => 'Config::Model::Itself::BackendDetector' ,
+ value_type => 'enum',
+ # specify backends built in Config::Model
+ choice => [qw/cds_file perl_file ini_file augeas custom/],
+
+ help => {
+ cds_file => "file ...",
+ ini_file => "Ini file ...",
+ perl_file => "file perl",
+ custom => "Custom format",
+ augeas => "Experimental backend",
+ }
+ }
+ ],
+ );
+
+ my $root = $model->instance(root_class_name => 'Test') -> config_root ;
+
+ my $backend = $root->fetch_element('backend') ;
+
+ my @choices = $backend->get_choice ;
+
+
+=head1 DESCRIPTION
+
+This class is derived from L<Config::Model::Value>. It is designed to
+be used in a 'enum' value where the choice (the available backends)
+are the backend built in L<Config::Model> and all the plugin backends. The
+plugin backends are all the C<Config::Model::Backend::*> classes.
+
+This module will detect available plugin backend and query their pod
+documentation to provide a contextual help for config-model graphical
+editor.
+
+=head1 AUTHOR
+
+Dominique Dumont, (ddumont at cpan dot org)
+
+=head1 SEE ALSO
+
+L<Config::Model>, L<Config::Model::Node>, L<Config::Model::Value>
+
+=cut
+
Modified: branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/Itself/TkEditUI.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/Itself/TkEditUI.pm?rev=55043&op=diff
==============================================================================
--- branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/Itself/TkEditUI.pm (original)
+++ branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/Itself/TkEditUI.pm Mon Mar 29 19:39:43 2010
@@ -1,8 +1,4 @@
-# $Author: ddumont $
-# $Date: 2008-04-17 15:38:28 +0200 (Thu, 17 Apr 2008) $
-# $Revision: 615 $
-
-# Copyright (c) 2008 Dominique Dumont.
+# Copyright (c) 2008,2010 Dominique Dumont.
#
# This file is part of Config-Model-Itself.
#
@@ -27,9 +23,8 @@
use Carp ;
use base qw/Config::Model::TkUI/;
-use vars qw/$VERSION/ ;
-$VERSION = sprintf "1.%04d", q$Revision: 615 $ =~ /(\d+)/;
+our $VERSION="1.212";
Construct Tk::Widget 'ConfigModelEditUI';
@@ -58,7 +53,8 @@
my $items = [[ qw/command test -command/, sub{ $cw->test_model }],
] ;
- my $model_menu = $cw->{my_menu}->cascade(-label => 'Model', -menuitems => $items) ;
+ my $model_menu = $cw->{my_menu}->cascade(-label => 'Model',
+ -menuitems => $items) ;
$cw->{read_model_dir} = $r_model_dir ;
$cw->{write_model_dir} = $w_model_dir ;
$cw->{model_name} = $model_name ;
Modified: branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/CargoElement.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/CargoElement.pl?rev=55043&op=diff
==============================================================================
--- branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/CargoElement.pl (original)
+++ branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/CargoElement.pl Mon Mar 29 19:39:43 2010
@@ -1,6 +1,6 @@
-# $Author: ddumont $
-# $Date: 2009-04-03 17:50:41 +0200 (Fri, 03 Apr 2009) $
-# $Revision: 916 $
+# $Author$
+# $Date$
+# $Revision$
# Copyright (c) 2007-2008 Dominique Dumont.
#
Modified: branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/Class.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/Class.pl?rev=55043&op=diff
==============================================================================
--- branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/Class.pl (original)
+++ branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/Class.pl Mon Mar 29 19:39:43 2010
@@ -1,8 +1,4 @@
-# $Author: ddumont $
-# $Date: 2009-06-23 13:41:22 +0200 (Tue, 23 Jun 2009) $
-# $Revision: 979 $
-
-# Copyright (c) 2007-2008 Dominique Dumont.
+# Copyright (c) 2007-2010 Dominique Dumont.
#
# This file is part of Config-Model-Itself.
#
@@ -111,6 +107,7 @@
},
'backend' => { type => 'leaf',
+ class => 'Config::Model::Itself::BackendDetector' ,
value_type => 'enum',
choice => [qw/cds_file perl_file ini_file augeas custom/],
migrate_from => { formula => '$old' ,
Modified: branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/CommonElement.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/CommonElement.pl?rev=55043&op=diff
==============================================================================
--- branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/CommonElement.pl (original)
+++ branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/CommonElement.pl Mon Mar 29 19:39:43 2010
@@ -209,6 +209,28 @@
},
+ 'match'
+ => { type => 'leaf',
+ value_type => 'uniline',
+ level => 'hidden',
+ description => 'Perl regular expression to assert the validity of the value.',
+ warp => { follow => { 'type' => '?type',
+ 'vtype' => '?value_type' ,
+ },
+ 'rules'
+ => [ ' $type eq "leaf"
+ and ( $vtype eq "uniline"
+ or $vtype eq "string"
+ )
+ '
+ => {
+ level => 'normal',
+ }
+ ]
+ },
+ },
+
+
'default_list'
=> { type => 'check_list',
level => 'hidden',
Modified: branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/ComputedValue.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/ComputedValue.pl?rev=55043&op=diff
==============================================================================
--- branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/ComputedValue.pl (original)
+++ branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/ComputedValue.pl Mon Mar 29 19:39:43 2010
@@ -1,6 +1,6 @@
-# $Author: ddumont $
-# $Date: 2009-06-23 13:41:22 +0200 (Tue, 23 Jun 2009) $
-# $Revision: 979 $
+# $Author$
+# $Date$
+# $Revision$
# Copyright (c) 2007-2008 Dominique Dumont.
#
Modified: branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/Element.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/Element.pl?rev=55043&op=diff
==============================================================================
--- branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/Element.pl (original)
+++ branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/Element.pl Mon Mar 29 19:39:43 2010
@@ -1,6 +1,6 @@
-# $Author: ddumont $
-# $Date: 2009-06-23 13:41:22 +0200 (Tue, 23 Jun 2009) $
-# $Revision: 979 $
+# $Author$
+# $Date$
+# $Revision$
# Copyright (c) 2007-2008 Dominique Dumont.
#
Modified: branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/Model.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/Model.pl?rev=55043&op=diff
==============================================================================
--- branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/Model.pl (original)
+++ branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/Model.pl Mon Mar 29 19:39:43 2010
@@ -1,7 +1,7 @@
-# $Author: ddumont $
-# $Date: 2008-04-13 18:37:11 +0200 (Sun, 13 Apr 2008) $
+# $Author$
+# $Date$
# $Name: not supported by cvs2svn $
-# $Revision: 602 $
+# $Revision$
# Copyright (c) 2007 Dominique Dumont.
#
Modified: branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/NonWarpableElement.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/NonWarpableElement.pl?rev=55043&op=diff
==============================================================================
--- branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/NonWarpableElement.pl (original)
+++ branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/NonWarpableElement.pl Mon Mar 29 19:39:43 2010
@@ -1,8 +1,4 @@
-# $Author: ddumont $
-# $Date: 2008-04-11 18:20:21 +0200 (ven, 11 avr 2008) $
-# $Revision: 600 $
-
-# Copyright (c) 2007-2008 Dominique Dumont.
+# Copyright (c) 2007-2010 Dominique Dumont.
#
# This file is part of Config-Model-Itself.
#
@@ -40,6 +36,24 @@
number uniline string/],
level => 'normal',
mandatory => 1,
+ }
+ ]
+ }
+ },
+
+ 'class'
+ => { type => 'leaf',
+ level => 'hidden',
+ value_type => 'uniline',
+ summary => "Override Config::Model::Value:",
+ description => "Perl class name of a child of Config::Model::Value",
+ experience => 'master',
+ 'warp'
+ => { follow => { 't' => '- type' },
+ 'rules'
+ => [ '$t eq "leaf"'
+ => {
+ level => 'normal',
}
]
}
Modified: branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/WarpRule.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/WarpRule.pl?rev=55043&op=diff
==============================================================================
--- branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/WarpRule.pl (original)
+++ branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/WarpRule.pl Mon Mar 29 19:39:43 2010
@@ -1,6 +1,6 @@
-# $Author: ddumont $
-# $Date: 2008-04-15 14:14:43 +0200 (Tue, 15 Apr 2008) $
-# $Revision: 609 $
+# $Author$
+# $Date$
+# $Revision$
# Copyright (c) 2007-2008 Dominique Dumont.
#
Modified: branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/WarpValue.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/WarpValue.pl?rev=55043&op=diff
==============================================================================
--- branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/WarpValue.pl (original)
+++ branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/WarpValue.pl Mon Mar 29 19:39:43 2010
@@ -1,6 +1,6 @@
-# $Author: ddumont $
-# $Date: 2008-04-15 14:14:43 +0200 (Tue, 15 Apr 2008) $
-# $Revision: 609 $
+# $Author$
+# $Date$
+# $Revision$
# Copyright (c) 2007-2008 Dominique Dumont.
#
Modified: branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/WarpableElement.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/WarpableElement.pl?rev=55043&op=diff
==============================================================================
--- branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/WarpableElement.pl (original)
+++ branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/WarpableElement.pl Mon Mar 29 19:39:43 2010
@@ -1,6 +1,6 @@
-# $Author: ddumont $
-# $Date: 2009-06-23 13:41:22 +0200 (Tue, 23 Jun 2009) $
-# $Revision: 979 $
+# $Author$
+# $Date$
+# $Revision$
# Copyright (c) 2007-2008 Dominique Dumont.
#
Added: branches/upstream/libconfig-model-itself-perl/current/t/backend_detect.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-model-itself-perl/current/t/backend_detect.t?rev=55043&op=file
==============================================================================
--- branches/upstream/libconfig-model-itself-perl/current/t/backend_detect.t (added)
+++ branches/upstream/libconfig-model-itself-perl/current/t/backend_detect.t Mon Mar 29 19:39:43 2010
@@ -1,0 +1,61 @@
+# -*- cperl -*-
+
+use ExtUtils::testlib;
+use Test::More tests => 4 ;
+use Config::Model;
+use Log::Log4perl qw(:easy) ;
+use Data::Dumper ;
+
+use warnings;
+no warnings qw(once);
+
+use strict;
+
+my $arg = shift || '' ;
+my $trace = $arg =~ /t/ ? 1 : 0 ;
+$::verbose = 1 if $arg =~ /v/;
+$::debug = 1 if $arg =~ /d/;
+Config::Model::Exception::Any->Trace(1) if $arg =~ /e/;
+
+Log::Log4perl->easy_init($arg =~ /l/ ? $DEBUG: $ERROR);
+
+my $model = Config::Model->new() ;
+
+$model ->create_config_class
+ (
+ name => "Master",
+ 'element'
+ => [
+ 'backend' => { type => 'leaf',
+ class => 'Config::Model::Itself::BackendDetector' ,
+ value_type => 'enum',
+ choice => [qw/cds_file perl_file ini_file augeas custom/],
+
+ help => {
+ cds_file => "file ...",
+ ini_file => "Ini file ...",
+ perl_file => "file perl",
+ custom => "Custom format",
+ augeas => "Experimental backend",
+ }
+ }
+ ],
+ );
+
+ok(1,"test class created") ;
+
+my $root = $model->instance(root_class_name => 'Master') -> config_root ;
+
+my $backend = $root->fetch_element('backend') ;
+
+my @choices = $backend->get_choice ;
+
+ok( (scalar grep { $_ eq 'Yaml'} @choices), "Yaml plugin backend was found") ;
+
+
+my $help = $backend->get_help('Yaml') ;
+like($help,qr/provided by Config::Model::Backend::Yaml/,
+ "Found Yaml NAME section from pod") ;
+
+$help = $backend->get_help('cds_file') ;
+is($help,"file ...", "cds_file help was kept") ;
Modified: branches/upstream/libconfig-model-itself-perl/current/t/dot_graph.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-model-itself-perl/current/t/dot_graph.t?rev=55043&op=diff
==============================================================================
--- branches/upstream/libconfig-model-itself-perl/current/t/dot_graph.t (original)
+++ branches/upstream/libconfig-model-itself-perl/current/t/dot_graph.t Mon Mar 29 19:39:43 2010
@@ -1,7 +1,7 @@
# -*- cperl -*-
-# $Author: ddumont $
-# $Date: 2009-04-06 13:57:55 +0200 (Mon, 06 Apr 2009) $
-# $Revision: 919 $
+# $Author$
+# $Date$
+# $Revision$
use ExtUtils::testlib;
use Test::More tests => 4;
Modified: branches/upstream/libconfig-model-itself-perl/current/t/itself-editor.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-model-itself-perl/current/t/itself-editor.t?rev=55043&op=diff
==============================================================================
--- branches/upstream/libconfig-model-itself-perl/current/t/itself-editor.t (original)
+++ branches/upstream/libconfig-model-itself-perl/current/t/itself-editor.t Mon Mar 29 19:39:43 2010
@@ -20,11 +20,11 @@
use strict;
my ($log,$show) = (0) x 2 ;
-my $arg = shift || '' ;
+my $arg = $ARGV[0] || '' ;
my $trace = $arg =~ /t/ ? 1 : 0 ;
$::verbose = 1 if $arg =~ /v/;
$::debug = 1 if $arg =~ /d/;
-$log = 1 if $arg =~ /l/;
+$log = 1 if $arg =~ /l/;
$show = 1 if $arg =~ /s/;
print "You can play with the widget if you run the test with 's' argument\n";
Modified: branches/upstream/libconfig-model-itself-perl/current/t/itself.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-model-itself-perl/current/t/itself.t?rev=55043&op=diff
==============================================================================
--- branches/upstream/libconfig-model-itself-perl/current/t/itself.t (original)
+++ branches/upstream/libconfig-model-itself-perl/current/t/itself.t Mon Mar 29 19:39:43 2010
@@ -1,8 +1,4 @@
# -*- cperl -*-
-# $Author: ddumont $
-# $Date: 2008-03-10 12:57:54 $
-# $Name: not supported by cvs2svn $
-# $Revision: 1.5 $
use ExtUtils::testlib;
use Test::More ;
More information about the Pkg-perl-cvs-commits
mailing list