Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package perl-Config-Tiny for 
openSUSE:Factory checked in at 2021-09-27 20:09:08
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Config-Tiny (Old)
 and      /work/SRC/openSUSE:Factory/.perl-Config-Tiny.new.1899 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "perl-Config-Tiny"

Mon Sep 27 20:09:08 2021 rev:19 rq:921845 version:2.27

Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-Config-Tiny/perl-Config-Tiny.changes        
2021-02-03 19:56:23.521722949 +0100
+++ 
/work/SRC/openSUSE:Factory/.perl-Config-Tiny.new.1899/perl-Config-Tiny.changes  
    2021-09-27 20:09:44.710517412 +0200
@@ -1,0 +2,18 @@
+Thu Sep 23 03:06:04 UTC 2021 - Tina M??ller <timueller+p...@suse.de>
+
+- updated to 2.27
+   see /usr/share/doc/packages/perl-Config-Tiny/Changelog.ini
+
+  [V 2.27]
+  Date=2021-09-21T15:48:00
+  Comments= <<EOT
+  - Add the option of passing a hashref to the constructor, where it is turned 
into an
+  object of the class. See POD under new([$config]) for details.
+  This patch to the code and POD includes the new test t/08.constructor.t.
+  The patch was provided by D Hauke, with thanx.
+  - Move test.conf back into t/, where it was years ago, before someone tried 
to remove
+  all uses of File::Spec. But since File::Spec is used often now, there is no 
point
+  in keeping test.conf in the root directory of the distro.
+  EOT
+
+-------------------------------------------------------------------

Old:
----
  Config-Tiny-2.26.tgz

New:
----
  Config-Tiny-2.27.tgz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ perl-Config-Tiny.spec ++++++
--- /var/tmp/diff_new_pack.fc0DLU/_old  2021-09-27 20:09:45.146517892 +0200
+++ /var/tmp/diff_new_pack.fc0DLU/_new  2021-09-27 20:09:45.146517892 +0200
@@ -18,7 +18,7 @@
 
 %define cpan_name Config-Tiny
 Name:           perl-Config-Tiny
-Version:        2.26
+Version:        2.27
 Release:        0
 Summary:        Read/Write .ini style files with as little code as possible
 License:        Artistic-1.0 OR GPL-1.0-or-later
@@ -59,7 +59,6 @@
 
 %prep
 %autosetup  -n %{cpan_name}-%{version}
-find . -type f ! -path "*/t/*" ! -name "*.pl" ! -path "*/bin/*" ! -path 
"*/script/*" ! -name "configure" -print0 | xargs -0 chmod 644
 
 %build
 perl Makefile.PL INSTALLDIRS=vendor
@@ -74,7 +73,7 @@
 %perl_gen_filelist
 
 %files -f %{name}.files
-%doc Changes README test.conf
+%doc Changes README
 %license LICENSE
 
 %changelog

++++++ Config-Tiny-2.26.tgz -> Config-Tiny-2.27.tgz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Config-Tiny-2.26/Changelog.ini 
new/Config-Tiny-2.27/Changelog.ini
--- old/Config-Tiny-2.26/Changelog.ini  2021-02-01 07:18:46.000000000 +0100
+++ new/Config-Tiny-2.27/Changelog.ini  2021-09-22 08:40:46.000000000 +0200
@@ -3,6 +3,18 @@
 Changelog.Creator=Module::Metadata::Changes V 2.12
 Changelog.Parser=Config::IniFiles V 3.000003
 
+[V 2.27]
+Date=2021-09-21T15:48:00
+Comments= <<EOT
+- Add the option of passing a hashref to the constructor, where it is turned 
into an
+object of the class. See POD under new([$config]) for details.
+This patch to the code and POD includes the new test t/08.constructor.t.
+The patch was provided by D Hauke, with thanx.
+- Move test.conf back into t/, where it was years ago, before someone tried to 
remove
+all uses of File::Spec. But since File::Spec is used often now, there is no 
point
+in keeping test.conf in the root directory of the distro.
+EOT
+
 [V 2.26]
 Date=2021-02-01T17:11:00
 Comments= <<EOT
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Config-Tiny-2.26/Changes new/Config-Tiny-2.27/Changes
--- old/Config-Tiny-2.26/Changes        2021-02-01 07:14:02.000000000 +0100
+++ new/Config-Tiny-2.27/Changes        2021-09-21 07:59:17.000000000 +0200
@@ -1,5 +1,14 @@
 ???Revision history for Perl extension Config-Tiny:
 
+2.27  2021-09-21T15:48:00
+       - Add the option of passing a hashref to the constructor, where it is 
turned into an
+               object of the class. See POD under new([$config]) for details.
+               This patch to the code and POD includes the new test 
t/08.constructor.t.
+               The patch was provided by D Hauke, with thanx.
+       - Move test.conf back into t/, where it was years ago, before someone 
tried to remove
+               all uses of File::Spec. But since File::Spec is used often now, 
there is no point
+               in keeping test.conf in the root directory of the distro.
+
 2.26  2021-02-01T17:11:00
        - Update POD to change RT to github.
        - Reformat Makefile.PL.
@@ -20,7 +29,7 @@
        - Add corresponding test t/07.trailing.comment.t.
        - Romanize Gregory Kidrenko's name so Config::IniFiles does not get 
'Wide char in print'.
        - Move xt/pod.t to xt/author/pod.t.
-       - Adopt new repo structure. See
+       - Adopt new repo structure. See
                
http://savage.net.au/Ron/html/My.Workflow.for.Building.Distros.html.
        - Move require 5.008001 from Tiny.pm into Makefile.PL.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Config-Tiny-2.26/MANIFEST 
new/Config-Tiny-2.27/MANIFEST
--- old/Config-Tiny-2.26/MANIFEST       2021-02-01 07:18:48.000000000 +0100
+++ new/Config-Tiny-2.27/MANIFEST       2021-09-22 08:40:47.000000000 +0200
@@ -18,7 +18,8 @@
 t/05.zero.t
 t/06.repeat.key.t
 t/07.trailing.comment.t
-test.conf
+t/08.constructor.t
+t/test.conf
 xt/author/pod.t
 xt/meta.t
 xt/pmv.t
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Config-Tiny-2.26/META.json 
new/Config-Tiny-2.27/META.json
--- old/Config-Tiny-2.26/META.json      2021-02-01 07:18:48.000000000 +0100
+++ new/Config-Tiny-2.27/META.json      2021-09-22 08:40:47.000000000 +0200
@@ -4,7 +4,7 @@
       "Adam Kennedy <ad...@cpan.org>"
    ],
    "dynamic_config" : 1,
-   "generated_by" : "ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter 
version 2.150010",
+   "generated_by" : "ExtUtils::MakeMaker version 7.62, CPAN::Meta::Converter 
version 2.150010",
    "license" : [
       "perl_5"
    ],
@@ -58,6 +58,6 @@
          "web" : "https://github.com/ronsavage/Config-Tiny";
       }
    },
-   "version" : "2.26",
-   "x_serialization_backend" : "JSON::PP version 4.02"
+   "version" : "2.27",
+   "x_serialization_backend" : "JSON::PP version 4.06"
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Config-Tiny-2.26/META.yml 
new/Config-Tiny-2.27/META.yml
--- old/Config-Tiny-2.26/META.yml       2021-02-01 07:18:48.000000000 +0100
+++ new/Config-Tiny-2.27/META.yml       2021-09-22 08:40:47.000000000 +0200
@@ -7,7 +7,7 @@
 configure_requires:
   ExtUtils::MakeMaker: '0'
 dynamic_config: 1
-generated_by: 'ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 
2.150010'
+generated_by: 'ExtUtils::MakeMaker version 7.62, CPAN::Meta::Converter version 
2.150010'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -26,5 +26,5 @@
   bugtracker: https://github.com/ronsavage/Config-Tiny/issues
   license: http://opensource.org/licenses/Perl
   repository: https://github.com/ronsavage/Config-Tiny.git
-version: '2.26'
+version: '2.27'
 x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Config-Tiny-2.26/lib/Config/Tiny.pm 
new/Config-Tiny-2.27/lib/Config/Tiny.pm
--- old/Config-Tiny-2.26/lib/Config/Tiny.pm     2021-02-01 07:18:46.000000000 
+0100
+++ new/Config-Tiny-2.27/lib/Config/Tiny.pm     2021-09-22 08:40:46.000000000 
+0200
@@ -6,16 +6,16 @@
 
 # Warning: There is another version line, in t/02.main.t.
 
-our $VERSION = '2.26';
+our $VERSION = '2.27';
 
 BEGIN {
        require 5.008001; # For the utf8 stuff.
        $Config::Tiny::errstr  = '';
 }
 
-# Create an empty object.
+# Create an object.
 
-sub new { return bless {}, shift }
+sub new { return bless defined $_[1] ? $_[1] : {}, $_[0] }
 
 # Create an object from a file.
 
@@ -181,9 +181,14 @@
        # In your program
        use Config::Tiny;
 
-       # Create a config
+       # Create an empty config
        my $Config = Config::Tiny->new;
 
+       # Create a config with data
+       my $config = Config::Tiny->new({
+               _ => { rootproperty => "Bar" },
+               section => { one => "value", Foo => 42 } });
+
        # Open the config
        $Config = Config::Tiny->read( 'file.conf' );
        $Config = Config::Tiny->read( 'file.conf', 'utf8' ); # Neither ':' nor 
'<:' prefix!
@@ -259,9 +264,16 @@
 
 You can also retrieve the error message from the C<$Config::Tiny::errstr> 
variable.
 
-=head2 new()
+=head2 new([$config])
+
+Here, the [] indicate an optional parameter.
+
+The constructor C<new> creates and returns a C<Config::Tiny> object.
 
-The constructor C<new> creates and returns an empty C<Config::Tiny> object.
+This will normally be a new, empty configuration, but you may also pass a
+hashref here which will be turned into an object of this class. This hashref
+should have a structure suitable for a configuration file, that is, a hash of
+hashes where the key C<_> is treated specially as the root section.
 
 =head2 read($filename, [$encoding])
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Config-Tiny-2.26/t/02.main.t 
new/Config-Tiny-2.27/t/02.main.t
--- old/Config-Tiny-2.26/t/02.main.t    2021-02-01 07:18:24.000000000 +0100
+++ new/Config-Tiny-2.27/t/02.main.t    2021-09-21 07:56:52.000000000 +0200
@@ -17,7 +17,7 @@
 
 # Warning: There is another version line, in lib/Config/Tiny.pm.
 
-our $VERSION = '2.26';
+our $VERSION = '2.27';
 
 # --------------------
 
@@ -34,7 +34,7 @@
 ok( scalar keys %$Trivial == 0, 'new() returns an empty object' );
 
 # Try to read in a config
-my $Config = Config::Tiny->read( 'test.conf' );
+my $Config = Config::Tiny->read(File::Spec -> catfile('t', 'test.conf') );
 ok( $Config, 'read() returns true' );
 ok( ref $Config, 'read() returns a reference' );
 # Legitimate use of UNIVERSAL::isa
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Config-Tiny-2.26/t/08.constructor.t 
new/Config-Tiny-2.27/t/08.constructor.t
--- old/Config-Tiny-2.26/t/08.constructor.t     1970-01-01 01:00:00.000000000 
+0100
+++ new/Config-Tiny-2.27/t/08.constructor.t     2021-09-21 07:42:00.000000000 
+0200
@@ -0,0 +1,48 @@
+#!/usr/bin/perl
+
+use Config::Tiny;
+
+use Test::More tests => 4;
+
+# ------------------------
+
+my($conf1) = Config::Tiny -> new( { _=>{foo=>"bar"} } );
+my($str1)  = $conf1->write_string;
+is $str1, "foo=bar\n";
+
+my($conf2) = Config::Tiny -> new( { _=>{hello=>"world"}, 
Cool=>{Beans=>"Dude",someval=>123} } );
+my($str2)  = $conf2->write_string;
+is $str2, <<'EOF';
+hello=world
+
+[Cool]
+Beans=Dude
+someval=123
+EOF
+
+my($conf3) = Config::Tiny -> new( { one => { alpha=>"aaa", beta=>"bbb" },
+       two => { abc => 123, def => 456, ghi => 789 } } );
+my($str3)  = $conf3->write_string;
+is $str3, <<'EOF';
+[one]
+alpha=aaa
+beta=bbb
+
+[two]
+abc=123
+def=456
+ghi=789
+EOF
+
+# from synopsis:
+my $config = Config::Tiny->new({
+       _ => { rootproperty => "Bar" },
+       section => { one => "value", Foo => 42 } });
+is $config->write_string, <<'EOF';
+rootproperty=Bar
+
+[section]
+Foo=42
+one=value
+EOF
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Config-Tiny-2.26/t/test.conf 
new/Config-Tiny-2.27/t/test.conf
--- old/Config-Tiny-2.26/t/test.conf    1970-01-01 01:00:00.000000000 +0100
+++ new/Config-Tiny-2.27/t/test.conf    2021-08-16 08:44:24.000000000 +0200
@@ -0,0 +1,11 @@
+root=something
+
+[section]
+one=two
+Foo=Bar
+this=Your Mother!
+blank=
+
+[Section Two]
+something else=blah
+ remove = whitespace           
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Config-Tiny-2.26/test.conf 
new/Config-Tiny-2.27/test.conf
--- old/Config-Tiny-2.26/test.conf      2021-01-31 10:20:19.000000000 +0100
+++ new/Config-Tiny-2.27/test.conf      1970-01-01 01:00:00.000000000 +0100
@@ -1,11 +0,0 @@
-root=something
-
-[section]
-one=two
-Foo=Bar
-this=Your Mother!
-blank=
-
-[Section Two]
-something else=blah
- remove = whitespace           
\ No newline at end of file

Reply via email to