r72318 - in /trunk/libconfig-model-itself-perl: ./ data/ debian/ lib/Config/Model/ lib/Config/Model/Itself/ lib/Config/Model/models/Itself/ lib/Config/Model/models/Itself/CommonElement/ t/

ddumont-guest at users.alioth.debian.org ddumont-guest at users.alioth.debian.org
Thu Apr 7 12:13:36 UTC 2011


Author: ddumont-guest
Date: Thu Apr  7 12:13:18 2011
New Revision: 72318

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=72318
Log:
new upstream release

Added:
    trunk/libconfig-model-itself-perl/lib/Config/Model/models/Itself/Class.pod
      - copied unchanged from r72317, branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/Class.pod
    trunk/libconfig-model-itself-perl/lib/Config/Model/models/Itself/CommonElement/
      - copied from r72317, branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/CommonElement/
    trunk/libconfig-model-itself-perl/lib/Config/Model/models/Itself/ConfigAccept.pod
      - copied unchanged from r72317, branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/ConfigAccept.pod
    trunk/libconfig-model-itself-perl/lib/Config/Model/models/Itself/ConfigRead.pod
      - copied unchanged from r72317, branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/ConfigRead.pod
    trunk/libconfig-model-itself-perl/lib/Config/Model/models/Itself/ConfigWrite.pod
      - copied unchanged from r72317, branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/ConfigWrite.pod
    trunk/libconfig-model-itself-perl/lib/Config/Model/models/Itself/Element.pod
      - copied unchanged from r72317, branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/Element.pod
    trunk/libconfig-model-itself-perl/lib/Config/Model/models/Itself/Model.pod
      - copied unchanged from r72317, branches/upstream/libconfig-model-itself-perl/current/lib/Config/Model/models/Itself/Model.pod
    trunk/libconfig-model-itself-perl/t/pod_gen.t
      - copied unchanged from r72317, branches/upstream/libconfig-model-itself-perl/current/t/pod_gen.t
Modified:
    trunk/libconfig-model-itself-perl/Build.PL
    trunk/libconfig-model-itself-perl/ChangeLog
    trunk/libconfig-model-itself-perl/MANIFEST
    trunk/libconfig-model-itself-perl/META.yml
    trunk/libconfig-model-itself-perl/data/MasterModel.pl
    trunk/libconfig-model-itself-perl/debian/changelog
    trunk/libconfig-model-itself-perl/debian/control
    trunk/libconfig-model-itself-perl/debian/copyright
    trunk/libconfig-model-itself-perl/lib/Config/Model/Itself.pm
    trunk/libconfig-model-itself-perl/lib/Config/Model/Itself/BackendDetector.pm
    trunk/libconfig-model-itself-perl/lib/Config/Model/Itself/TkEditUI.pm
    trunk/libconfig-model-itself-perl/lib/Config/Model/models/Itself/Class.pl
    trunk/libconfig-model-itself-perl/lib/Config/Model/models/Itself/CommonElement.pl
    trunk/libconfig-model-itself-perl/lib/Config/Model/models/Itself/NonWarpableElement.pl
    trunk/libconfig-model-itself-perl/t/itself-editor.t
    trunk/libconfig-model-itself-perl/t/itself.t

Modified: trunk/libconfig-model-itself-perl/Build.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-model-itself-perl/Build.PL?rev=72318&op=diff
==============================================================================
--- trunk/libconfig-model-itself-perl/Build.PL (original)
+++ trunk/libconfig-model-itself-perl/Build.PL Thu Apr  7 12:13:18 2011
@@ -43,13 +43,15 @@
    @version_info,
 
   'build_requires' => {
-    'Module::Build' => '0.3601'
+    'Module::Build' => '0.3601',
+    'Test::Differences' => '0',
+    'Test::More' => '0'
   },
   'configure_requires' => {
     'Module::Build' => '0.3601'
   },
   'requires' => {
-    'Config::Model' => '1.230',
+    'Config::Model' => '1.236',
     'Config::Model::TkUI' => '1.210',
     'Log::Log4perl' => '0',
     'Pod::POM' => '0',

Modified: trunk/libconfig-model-itself-perl/ChangeLog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-model-itself-perl/ChangeLog?rev=72318&op=diff
==============================================================================
--- trunk/libconfig-model-itself-perl/ChangeLog (original)
+++ trunk/libconfig-model-itself-perl/ChangeLog Thu Apr  7 12:13:18 2011
@@ -1,3 +1,17 @@
+2011-04-04 Dominique Dumont  <domi.dumont at free.fr> 1.224
+
+        * Class.pl: added full_dump parameter for YAML and Perl backend
+
+2011-04-01 Dominique Dumont  <domi.dumont at free.fr> 1.223
+
+        * dump and load annotations in pod doc in config class file
+        * Class.pl: added copyright, author, license elements
+        * Search backend in all @INC directories (useful for dev)
+        * Reduced indentation of generated Perl files.
+        * NonWarpableElement: added replace_follow parameter 
+        * Build depend on Test::Differences
+        * Requires Config::Model 1.236
+
 2011-01-20 Dominique Dumont  <domi.dumont at free.fr> 1.222
 
         * added migrate_keys_from, undef_is parameters 

Modified: trunk/libconfig-model-itself-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-model-itself-perl/MANIFEST?rev=72318&op=diff
==============================================================================
--- trunk/libconfig-model-itself-perl/MANIFEST (original)
+++ trunk/libconfig-model-itself-perl/MANIFEST Thu Apr  7 12:13:18 2011
@@ -21,11 +21,18 @@
 lib/Config/Model/models/Itself/CargoWarpRule.pl
 lib/Config/Model/models/Itself/CargoWarpValue.pl
 lib/Config/Model/models/Itself/Class.pl
+lib/Config/Model/models/Itself/Class.pod
 lib/Config/Model/models/Itself/CommonElement.pl
+lib/Config/Model/models/Itself/CommonElement/WarnIf.pod
 lib/Config/Model/models/Itself/ComputedValue.pl
+lib/Config/Model/models/Itself/ConfigAccept.pod
+lib/Config/Model/models/Itself/ConfigRead.pod
+lib/Config/Model/models/Itself/ConfigWrite.pod
 lib/Config/Model/models/Itself/Element.pl
+lib/Config/Model/models/Itself/Element.pod
 lib/Config/Model/models/Itself/MigratedValue.pl
 lib/Config/Model/models/Itself/Model.pl
+lib/Config/Model/models/Itself/Model.pod
 lib/Config/Model/models/Itself/NonWarpableElement.pl
 lib/Config/Model/models/Itself/WarpOnlyElement.pl
 lib/Config/Model/models/Itself/WarpRule.pl
@@ -39,4 +46,5 @@
 t/list_itself_structure.t
 t/load_write_itself.t
 t/pod.t
+t/pod_gen.t
 t/release-pod-syntax.t

Modified: trunk/libconfig-model-itself-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-model-itself-perl/META.yml?rev=72318&op=diff
==============================================================================
--- trunk/libconfig-model-itself-perl/META.yml (original)
+++ trunk/libconfig-model-itself-perl/META.yml Thu Apr  7 12:13:18 2011
@@ -4,20 +4,22 @@
   - 'Dominique Dumont'
 build_requires:
   Module::Build: 0.3601
+  Test::Differences: 0
+  Test::More: 0
 configure_requires:
   Module::Build: 0.3601
 dynamic_config: 0
-generated_by: 'Dist::Zilla version 4.200000, CPAN::Meta::Converter version 2.102400'
+generated_by: 'Dist::Zilla version 4.200004, CPAN::Meta::Converter version 2.110580'
 license: lgpl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
   version: 1.4
 name: Config-Model-Itself
 requires:
-  Config::Model: 1.230
+  Config::Model: 1.236
   Config::Model::TkUI: 1.210
   Log::Log4perl: 0
   Pod::POM: 0
   Tk: 0
   YAML::Any: 0
-version: 1.222
+version: 1.224

Modified: trunk/libconfig-model-itself-perl/data/MasterModel.pl
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-model-itself-perl/data/MasterModel.pl?rev=72318&op=diff
==============================================================================
--- trunk/libconfig-model-itself-perl/data/MasterModel.pl (original)
+++ trunk/libconfig-model-itself-perl/data/MasterModel.pl Thu Apr  7 12:13:18 2011
@@ -332,7 +332,6 @@
             },
             'Source' => {
                 'value_type'   => 'string',
-                'mandatory'    => '1',
                 'migrate_from' => {
                     'use_eval'  => '1',
                     'formula'   => '$old || $older ;',
@@ -355,7 +354,10 @@
                 config_class_name => 'MasterModel::SshdWithAugeas',
             },
         ],
-        description => [ tree_macro => 'controls behavior of other elements' ]
+        description => [ tree_macro => 'controls behavior of other elements' ],
+        author    => "dod\@foo.com",
+        copyright => "2011 dod",
+        license   =>  "LGPL",
     ],
 ];
 

Modified: trunk/libconfig-model-itself-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-model-itself-perl/debian/changelog?rev=72318&op=diff
==============================================================================
--- trunk/libconfig-model-itself-perl/debian/changelog (original)
+++ trunk/libconfig-model-itself-perl/debian/changelog Thu Apr  7 12:13:18 2011
@@ -1,3 +1,15 @@
+libconfig-model-itself-perl (1.224-1) UNRELEASED; urgency=low
+
+  * New upstream release:
+    - fixed tests wrt new Config::Model (Closes: #616566)
+    - Class.pl: added copyright, author, license elements
+    - dump and load annotations in pod doc in config class file
+  * control:
+    - Bumped libconfig-model-perl version 1.236 in depends
+    - BDI: added libtest-differences-perl
+
+ -- Dominique Dumont <domi.dumont at free.fr>  Thu, 07 Apr 2011 13:50:12 +0200
+
 libconfig-model-itself-perl (1.222-1) unstable; urgency=low
 
   * New upstream release.

Modified: trunk/libconfig-model-itself-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-model-itself-perl/debian/control?rev=72318&op=diff
==============================================================================
--- trunk/libconfig-model-itself-perl/debian/control (original)
+++ trunk/libconfig-model-itself-perl/debian/control Thu Apr  7 12:13:18 2011
@@ -1,6 +1,6 @@
 Source: libconfig-model-itself-perl
 Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
-Uploaders: Dominique Dumont <dominique.dumont at hp.com>,
+Uploaders: Dominique Dumont <domi.dumont at free.fr>,
            gregor herrmann <gregoa at debian.org>
 Section: perl
 Priority: optional
@@ -9,12 +9,13 @@
                xauth,
                libmodule-build-perl (>= 0.360100)
 Build-Depends-Indep: perl,
-                     libconfig-model-perl (>= 1.230),
+                     libconfig-model-perl (>= 1.236),
                      libconfig-model-tkui-perl,
                      liblog-log4perl-perl,
                      libpod-pom-perl,
                      libyaml-perl,
-                     libtest-pod-perl
+                     libtest-pod-perl,
+                     libtest-differences-perl
 Standards-Version: 3.9.1
 Vcs-Browser: http://svn.debian.org/viewsvn/pkg-perl/trunk/libconfig-model-itself-perl/
 Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libconfig-model-itself-perl/
@@ -24,7 +25,7 @@
 Architecture: all
 Depends: ${perl:Depends},
          ${misc:Depends},
-         libconfig-model-perl (>= 1.230),
+         libconfig-model-perl (>= 1.236),
          libconfig-model-tkui-perl,
          liblog-log4perl-perl,
          libpod-pom-perl,

Modified: trunk/libconfig-model-itself-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-model-itself-perl/debian/copyright?rev=72318&op=diff
==============================================================================
--- trunk/libconfig-model-itself-perl/debian/copyright (original)
+++ trunk/libconfig-model-itself-perl/debian/copyright Thu Apr  7 12:13:18 2011
@@ -7,10 +7,12 @@
 Copyright: 2007-2011, Dominique Dumont (ddumont at cpan.org)
 License: LGPL-2.1+
 
+
 Files: debian/*
 Copyright: 2009-2011, Dominique Dumont <dominique.dumont at hp.com>
            2009-2011, gregor herrmann <gregoa at debian.org>
 License: LGPL-2.1+
+
 
 License: LGPL-2.1+
  This program is free software; you can redistribute it and/or

Modified: trunk/libconfig-model-itself-perl/lib/Config/Model/Itself.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-model-itself-perl/lib/Config/Model/Itself.pm?rev=72318&op=diff
==============================================================================
--- trunk/libconfig-model-itself-perl/lib/Config/Model/Itself.pm (original)
+++ trunk/libconfig-model-itself-perl/lib/Config/Model/Itself.pm Thu Apr  7 12:13:18 2011
@@ -7,7 +7,7 @@
 #
 #   The GNU Lesser General Public License, Version 2.1, February 1999
 #
-#    Copyright (c) 2007-2010 Dominique Dumont.
+#    Copyright (c) 2007-2011 Dominique Dumont.
 #
 #    This file is part of Config-Model-Itself.
 #
@@ -27,7 +27,7 @@
 
 package Config::Model::Itself ;
 BEGIN {
-  $Config::Model::Itself::VERSION = '1.222';
+  $Config::Model::Itself::VERSION = '1.224';
 }
 
 use strict;
@@ -148,14 +148,14 @@
     my %args = @_ ;
     my $model_obj = $self->{model_object};
     my $dir = $args{model_dir} 
-      || croak __PACKAGE__," read_all: undefined config dir";
+      || croak __PACKAGE__," read_all: undefined model dir";
     my $model = $args{root_model} 
       || croak __PACKAGE__," read_all: undefined root_model";
     my $force_load = $args{force_load} || 0 ;
     my $legacy = $args{legacy} ;
 
     unless (-d $dir ) {
-        croak __PACKAGE__," read_all: unknown config dir $dir";
+        croak __PACKAGE__," read_all: unknown model dir $dir";
     }
 
     my $root_model_file = $model ;
@@ -166,7 +166,7 @@
         my $n = $File::Find::name ;
         push @files, $n if (-f $_ and not /~$/ 
                             and $n !~ /CVS/
-                            and $n !~ m!.svn!
+                            and $n !~ m!.(svn|orig|pod)$!
                             and $n =~ m!$dir/$root_model_file!
                            ) ;
     } ;
@@ -174,6 +174,7 @@
 
     my $i = $model_obj->instance ;
     my %read_models ;
+    my %pod_data ;
     my %class_file_map ;
 
     for my $file (@files) {
@@ -229,13 +230,22 @@
     # Create all classes listed in %read_models to avoid problems with
     # include statement while calling load_data
     my $class_element = $model_obj->fetch_element('class') ;
-    map { $class_element->fetch_with_id($_) } keys %read_models ;
+    map { $class_element->fetch_with_id($_) } sort keys %read_models ;
 
     #require Tk::ObjScanner; Tk::ObjScanner::scan_object(\%read_models) ;
 
     $logger->info("loading all extracted data in Config::Model::Itself");
     # load with a array ref to avoid warnings about missing order
     $model_obj->load_data( {class => [ %read_models ] }, undef, $force_load ? 'no' : 'yes' ) ;
+
+    # load annotations
+    for my $file (@files) {
+        $logger->info("loading annotations from file $file");
+        my $fh = IO::File->new($file) || die "Can't open $file: $!" ;
+        my @lines = $fh->getlines ;  
+        $fh->close;
+        $model_obj->load_pod_annotation(join('', at lines)) ;
+    }
 
     return $self->{map} = \%class_file_map ;
 }
@@ -299,7 +309,7 @@
         mkpath($dir,0, 0755) || die "Can't mkpath $dir:$!";
     }
 
-    my $i = $model_obj->instance ;
+    #my $i = $model_obj->instance ;
 
     # get list of all classes loaded by the editor
     my %loaded_classes 
@@ -326,12 +336,16 @@
         $logger->info("writing config file $file");
 
         my @data ;
+        my @notes ;
 
         foreach my $class_name (@{$map_to_write{$file}}) {
             $logger->info("writing class $class_name");
             my $model 
               = $self-> get_perl_data_model(class_name => $class_name) ;
             push @data, $model if defined $model;
+            
+            my $node = $self->{model_object}->grab("class:".$class_name) ;
+            push @notes, $node->dump_annotations_as_pod ;
             # remove class name from above list
             delete $loaded_classes{$class_name} ;
         }
@@ -342,13 +356,17 @@
             mkpath($wr_dir,0, 0755) || die "Can't mkpath $wr_dir:$!";
         }
 
-        open (WR, ">$wr_file") || croak "Cannot open file $wr_file:$!" ;
+        my $wr = IO::File->new ($wr_file,'>') || croak "Cannot open file $wr_file:$!" ;
+
         my $dumper = Data::Dumper->new([\@data]) ;
-        $dumper->Terse(1) ;
-        print WR $dumper->Dump , ";\n";
-        close WR ;
-    }
-
+        $dumper->Indent(1) ; # avoid too deep indentation
+        $dumper->Terse(1) ; # allow unnamed variables in dump
+        $wr->print ($dumper->Dump , ";\n\n");
+
+        $wr->print( join("\n", at notes )) ;
+
+        $wr->close ;
+    }
 }
 
 

Modified: trunk/libconfig-model-itself-perl/lib/Config/Model/Itself/BackendDetector.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-model-itself-perl/lib/Config/Model/Itself/BackendDetector.pm?rev=72318&op=diff
==============================================================================
--- trunk/libconfig-model-itself-perl/lib/Config/Model/Itself/BackendDetector.pm (original)
+++ trunk/libconfig-model-itself-perl/lib/Config/Model/Itself/BackendDetector.pm Thu Apr  7 12:13:18 2011
@@ -27,7 +27,7 @@
 
 package Config::Model::Itself::BackendDetector ;
 BEGIN {
-  $Config::Model::Itself::BackendDetector::VERSION = '1.222';
+  $Config::Model::Itself::BackendDetector::VERSION = '1.224';
 }
 
 use Pod::POM ;
@@ -42,11 +42,7 @@
     my $self = shift ;
     my @choices = ref $_[0] ? @{$_[0]} : @_ ;
 
-    #find available backends
-
-    my $path = $INC{"Config/Model.pm"} ;
-    $path =~ s!\.pm!/Backend! ;
-
+    # find available backends in all @INC directories
     my $wanted = sub { 
         my $n = $File::Find::name ;
         if (-f $_ and $n =~ s/\.pm$// and $n !~ /Any$/) {
@@ -55,7 +51,11 @@
 	    push @choices , $n ;
         }
     } ;
-    find ($wanted, $path ) ;
+
+    foreach my $inc (@INC) {
+        my $path = "$inc/Config/Model/Backend" ;
+        find ($wanted, $path ) if -d $path;
+    }
     
     $self->SUPER::setup_enum_choice(@choices) ;
 }

Modified: trunk/libconfig-model-itself-perl/lib/Config/Model/Itself/TkEditUI.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-model-itself-perl/lib/Config/Model/Itself/TkEditUI.pm?rev=72318&op=diff
==============================================================================
--- trunk/libconfig-model-itself-perl/lib/Config/Model/Itself/TkEditUI.pm (original)
+++ trunk/libconfig-model-itself-perl/lib/Config/Model/Itself/TkEditUI.pm Thu Apr  7 12:13:18 2011
@@ -27,7 +27,7 @@
 
 package Config::Model::Itself::TkEditUI ;
 BEGIN {
-  $Config::Model::Itself::TkEditUI::VERSION = '1.222';
+  $Config::Model::Itself::TkEditUI::VERSION = '1.224';
 }
 
 use strict;

Modified: trunk/libconfig-model-itself-perl/lib/Config/Model/models/Itself/Class.pl
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-model-itself-perl/lib/Config/Model/models/Itself/Class.pl?rev=72318&op=diff
==============================================================================
--- trunk/libconfig-model-itself-perl/lib/Config/Model/models/Itself/Class.pl (original)
+++ trunk/libconfig-model-itself-perl/lib/Config/Model/models/Itself/Class.pl Thu Apr  7 12:13:18 2011
@@ -7,7 +7,7 @@
 #
 #   The GNU Lesser General Public License, Version 2.1, February 1999
 #
-#    Copyright (c) 2007-2010 Dominique Dumont.
+#    Copyright (c) 2007-2011 Dominique Dumont.
 #
 #    This file is part of Config-Model-Itself.
 #
@@ -28,11 +28,27 @@
 [
     [
         name => "Itself::Class",
+        author => 'Dominique Dumont',
+        copyright => '2007-2011 Dominique Dumont.',
+        license => 'LGPL-2',
 
         class_description =>
-          "Configuration class. This class will contain elements",
+          "Configuration class. This class represents a node of a configuration tree.",
 
         'element' => [
+
+            [qw/class_description license/] => {
+                type       => 'leaf',
+                value_type => 'string',
+            },
+
+            [qw/author copyright/] => {
+                type  => 'list',
+                cargo => {
+                    type       => 'leaf',
+                    value_type => 'uniline',
+                }
+            },
 
             'element' => {
                 type       => 'hash',
@@ -60,11 +76,6 @@
                 refer_to   => '- element',
             },
 
-            'class_description' => {
-                type       => 'leaf',
-                value_type => 'string',
-            },
-
             [qw/write_config_dir read_config_dir/] => {
                 type       => 'leaf',
                 value_type => 'uniline',
@@ -104,7 +115,7 @@
             element => "Specify the elements names of this configuration class.",
             include => "Include the specification of another class into this class.",
             include_after => "insert the included elements after a specific element",
-            class_description => "Explain the purpose of this configuration class",
+            class_description => "Explain the purpose of this configuration class. This description will be re-used to generate the documentation of your configuration class",
             read_config => "Specify the Perl class(es) and function(s) used to read configuration data. The specified function will be tried in sequence to get configuration data. ",
             write_config => "Specify the Perl class and function used to write configuration data.",
             generated_by => "When set, this class was generated by some program. You should not edit it as your modification may be clobbered later on",
@@ -201,7 +212,18 @@
                 description =>
 'Specify the configuration file (without path) that will store configuration information',
             },
-            'comment_delimiter' => {
+             'full_dump' => {
+                type             => 'leaf',
+                value_type       => 'boolean',
+                level            => 'hidden',
+                description      => 'Also dump default values in the data structure. Useful if the dumped configuration data will be used by the application. (default is yes)',
+                upstream_default => '1',
+                warp             => {
+                    follow => { backend => '- backend' },
+                    rules  => [ '$backend =~ /yaml|perl/i' => { level => 'normal', } ],
+                }
+            },
+           'comment_delimiter' => {
                 type             => 'leaf',
                 value_type       => 'uniline',
                 level            => 'hidden',

Modified: trunk/libconfig-model-itself-perl/lib/Config/Model/models/Itself/CommonElement.pl
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-model-itself-perl/lib/Config/Model/models/Itself/CommonElement.pl?rev=72318&op=diff
==============================================================================
--- trunk/libconfig-model-itself-perl/lib/Config/Model/models/Itself/CommonElement.pl (original)
+++ trunk/libconfig-model-itself-perl/lib/Config/Model/models/Itself/CommonElement.pl Thu Apr  7 12:13:18 2011
@@ -50,14 +50,14 @@
     experience => 'advanced',
     cargo      => {
         type              => 'node',
-        config_class_name => 'CommonElement::WarnIf',
+        config_class_name => 'Itself::CommonElement::WarnIf',
     },
     @warp_in_uniline_or_string,
 );
 
 [
     [
-        name    => 'CommonElement::WarnIf',
+        name    => 'Itself::CommonElement::WarnIf',
         element => [
             msg => {
                 type       => 'leaf',

Modified: trunk/libconfig-model-itself-perl/lib/Config/Model/models/Itself/NonWarpableElement.pl
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-model-itself-perl/lib/Config/Model/models/Itself/NonWarpableElement.pl?rev=72318&op=diff
==============================================================================
--- trunk/libconfig-model-itself-perl/lib/Config/Model/models/Itself/NonWarpableElement.pl (original)
+++ trunk/libconfig-model-itself-perl/lib/Config/Model/models/Itself/NonWarpableElement.pl Thu Apr  7 12:13:18 2011
@@ -7,7 +7,7 @@
 #
 #   The GNU Lesser General Public License, Version 2.1, February 1999
 #
-#    Copyright (c) 2007-2010 Dominique Dumont.
+#    Copyright (c) 2007-2011 Dominique Dumont.
 #
 #    This file is part of Config-Model-Itself.
 #
@@ -26,171 +26,189 @@
 #    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 
 [
- [
-  name => 'Itself::NonWarpableElement',
-
-  # warp often depend on this one, so list it first
-  'element'
-  => [
-      'value_type' 
-      => { type => 'leaf',
-	   level => 'hidden',
-	   value_type => 'enum',
-	   'warp'
-	   => { follow => { 't' => '- type' },
-		'rules'
-		=> [ '$t eq "leaf"' 
-		     => {
-			 choice => [qw/boolean enum integer reference
-				       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',
-			}
-		   ]
-	      }
-	 },
-
-
-      # node element (may be within a hash or list)
-
-      # warped_node: warp parameter for warped_node. They must be
-      # warped out when type is not a warped_node
-      'follow' => 
-      => {
-	  type => 'hash',
-	  index_type => 'string',
-	  level      => 'hidden' ,
-	  'warp'
-	  => { follow => '- type',
-	       'rules' => { 'warped_node' => {level => 'normal',},}
-	     },
-	  cargo => { type => 'leaf',
-		     value_type => 'uniline' 
-		   },
-	  description => "Specifies the path to the value elements that drive the "
-			 ."change of this node. Each key of the has is a variable name used "
-			 ."in the 'rules' parameter. The value of the hash is a path in the "
-			 ."configuration tree",
-	 },
-
-      'morph' => 
-      => {
-	  type => 'leaf',
-	  level      => 'hidden' ,
-	  value_type => 'boolean', 
-	  'warp'
-	  => { follow => '- type',
-	       'rules'
-	       => { 'warped_node' 
-		    => {
-			level => 'normal',
-			upstream_default => 0 ,
-		       },
-		  }
-	     },
-	  description => "When set, a recurse copy of the value from the old object "
-	       ."to the new object will be attemped. When a copy is not possible, "
-		    ."undef values will be assigned.",
-	 },
-
-      # end warp elements for warped_node
-
-      # leaf element
-
-      'refer_to' 
-      => { type => 'leaf',
-	   level      => 'hidden' ,
-	   value_type => 'uniline',
-	   experience => 'advanced',
-	   warp => { follow => { t  => '- type',
-				 vt => '- value_type',
-			       },
-		     'rules'
-		     => [ '   $t  eq "check_list"
-                           or $vt eq "reference"  '
-			  => {
-			      level => 'important',
-			     },
-			]
-		   },
-	   description => "points to an array or hash element in the configuration "
-			 ."tree using the path syntax. The available choice of this "
-			 ."reference value (or check list)is made from the available "
-			 ."keys of the pointed hash element or the values of the pointed array element.",
-	 },
-
-      'computed_refer_to' 
-      => { type => 'warped_node',
-	   follow => { t  => '- type',
-		       vt => '- value_type',
-		     },
-	   level => 'hidden',
-	   experience => 'master',
-	   'rules'
-	   => [ '   $t  eq "check_list" 
-                 or $vt eq "reference"  '
-		=> {
-		    level => 'normal',
-		    config_class_name => 'Itself::ComputedValue',
-		   },
-	      ],
-	   description => "points to an array or hash element in the configuration tree using a path computed with value from several other elements in the configuration tree. The available choice of this reference value (or check list) is made from the available keys of the pointed hash element or the values of the pointed array element.",
-	 },
-
-      'compute' 
-      => { type => 'warped_node',
-	   level => 'hidden',
-	   experience => 'advanced',
-
-	   follow => { t  => '- type',},
-	   'rules' => [ '$t  eq "leaf"'
-			=> {
-			    level => 'normal',
-			    config_class_name => 'Itself::ComputedValue',
-			   },
-		      ],
-	   description => "compute the default value according to a formula and value from other elements in the configuration tree.",
-	 },
-
-      'migrate_from' 
-      => { type => 'warped_node',
-	   level => 'hidden',
-	   experience => 'advanced',
-
-	   follow => { t  => '- type',},
-	   'rules' => [ '$t  eq "leaf"'
-			=> {
-			    level => 'normal',
-			    config_class_name => 'Itself::MigratedValue',
-			   },
-		      ],
-	   description => "Specify an upgrade path from an old value and compute the value to store in the new element.",
-	 },
-
-
-      # hash element
-
-      # list element
-
-
-     ],
- ],
+    [
+        name => 'Itself::NonWarpableElement',
+
+        # warp often depend on this one, so list it first
+        'element' => [
+            'value_type' => {
+                type       => 'leaf',
+                level      => 'hidden',
+                value_type => 'enum',
+                'warp'     => {
+                    follow  => { 't' => '- type' },
+                    'rules' => [
+                        '$t eq "leaf"' => {
+                            choice => [
+                                qw/boolean enum integer reference
+                                  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', } ]
+                }
+            },
+
+            # node element (may be within a hash or list)
+
+            # warped_node: warp parameter for warped_node. They must be
+            # warped out when type is not a warped_node
+            'follow' => {
+                type       => 'hash',
+                index_type => 'string',
+                level      => 'hidden',
+                'warp'     => {
+                    follow  => '- type',
+                    'rules' => { 'warped_node' => { level => 'normal', }, }
+                },
+                cargo => {
+                    type       => 'leaf',
+                    value_type => 'uniline'
+                },
+                description =>
+                  "Specifies the path to the value elements that drive the "
+                  . "change of this node. Each key of the has is a variable name used "
+                  . "in the 'rules' parameter. The value of the hash is a path in the "
+                  . "configuration tree",
+            },
+
+            'morph' => {
+                type       => 'leaf',
+                level      => 'hidden',
+                value_type => 'boolean',
+                'warp'     => {
+                    follow  => '- type',
+                    'rules' => {
+                        'warped_node' => {
+                            level            => 'normal',
+                            upstream_default => 0,
+                        },
+                    }
+                },
+                description =>
+                  "When set, a recurse copy of the value from the old object "
+                  . "to the new object will be attemped. When a copy is not possible, "
+                  . "undef values will be assigned.",
+            },
+
+            # end warp elements for warped_node
+
+            # leaf element
+
+            'refer_to' => {
+                type       => 'leaf',
+                level      => 'hidden',
+                value_type => 'uniline',
+                experience => 'advanced',
+                warp       => {
+                    follow => {
+                        t  => '- type',
+                        vt => '- value_type',
+                    },
+                    'rules' => [
+                        '$t  eq "check_list" or $vt eq "reference"' =>
+                          { level => 'important', },
+                    ]
+                },
+                description =>
+                  "points to an array or hash element in the configuration "
+                  . "tree using the path syntax. The available choice of this "
+                  . "reference value (or check list)is made from the available "
+                  . "keys of the pointed hash element or the values of the pointed array element.",
+            },
+
+            'computed_refer_to' => {
+                type   => 'warped_node',
+                follow => {
+                    t  => '- type',
+                    vt => '- value_type',
+                },
+                level      => 'hidden',
+                experience => 'master',
+                'rules'    => [
+                    '$t  eq "check_list" or $vt eq "reference"' => {
+                        level             => 'normal',
+                        config_class_name => 'Itself::ComputedValue',
+                    },
+                ],
+                description =>
+                  "points to an array or hash element in the configuration "
+                  . "tree using a path computed with value from several other "
+                  . "elements in the configuration tree. The available choice "
+                  . "of this reference value (or check list) is made from the "
+                  . "available keys of the pointed hash element or the values "
+                  . "of the pointed array element.",
+            },
+
+            'replace_follow' => {
+                type       => 'leaf',
+                level      => 'hidden',
+                value_type => 'uniline',
+                experience => 'advanced',
+                warp       => {
+                    follow  => { t               => '- type' },
+                    'rules' => [ '$t  eq "leaf"' => { level => 'important', }, ]
+                },
+                description =>
+                  "Path specifying a hash of value element in the configuration "
+                  . "tree. The hash if used in a way similar to the replace "
+                  . "parameter. In this case, the replacement is not coded "
+                  . "in the model but specified by the configuration.",
+            },
+
+            'compute' => {
+                type       => 'warped_node',
+                level      => 'hidden',
+                experience => 'advanced',
+
+                follow  => { t => '- type', },
+                'rules' => [
+                    '$t  eq "leaf"' => {
+                        level             => 'normal',
+                        config_class_name => 'Itself::ComputedValue',
+                    },
+                ],
+                description =>
+                  "compute the default value according to a formula and value "
+                  . "from other elements in the configuration tree.",
+            },
+
+            'migrate_from' => {
+                type       => 'warped_node',
+                level      => 'hidden',
+                experience => 'advanced',
+
+                follow  => { t => '- type', },
+                'rules' => [
+                    '$t  eq "leaf"' => {
+                        level             => 'normal',
+                        config_class_name => 'Itself::MigratedValue',
+                    },
+                ],
+                description =>
+"                  Specify an upgrade path from an old value and compute "
+                  . "the value to store in the new element.",
+            },
+
+            # hash element
+
+            # list element
+
+        ],
+    ],
 ];

Modified: trunk/libconfig-model-itself-perl/t/itself-editor.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-model-itself-perl/t/itself-editor.t?rev=72318&op=diff
==============================================================================
--- trunk/libconfig-model-itself-perl/t/itself-editor.t (original)
+++ trunk/libconfig-model-itself-perl/t/itself-editor.t Thu Apr  7 12:13:18 2011
@@ -67,6 +67,14 @@
 my $meta_model = Config::Model -> new ( ) ;
 
 Config::Model::Exception::Any->Trace(1) if $arg =~ /e/;
+
+{
+    no warnings "redefine" ;
+    sub Tk::Error {
+        my ($widget,$error, at locations) = @_;
+        die $error ;
+    }
+}
 
 ok(1,"compiled");
 

Modified: trunk/libconfig-model-itself-perl/t/itself.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-model-itself-perl/t/itself.t?rev=72318&op=diff
==============================================================================
--- trunk/libconfig-model-itself-perl/t/itself.t (original)
+++ trunk/libconfig-model-itself-perl/t/itself.t Thu Apr  7 12:13:18 2011
@@ -15,8 +15,9 @@
 
 use strict;
 
-my $arg = shift || '' ;
-my $trace = $arg =~ /t/ ? 1 : 0 ;
+my $arg = $ARGV[0] || '' ;
+
+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/;




More information about the Pkg-perl-cvs-commits mailing list