Skip to content

Commit

Permalink
updated POD, 0.3.2 release rolled
Browse files Browse the repository at this point in the history
  • Loading branch information
oodler577 committed Aug 31, 2023
1 parent 57671b6 commit 2132521
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 9 deletions.
2 changes: 2 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,5 @@
- yaml2o is like ini2o, but used with YAML files and YAML saved directly
as a string to a SCALAR variable

0.3.2 Wed Aug 30 01:05:00 2023
- POD update
54 changes: 45 additions & 9 deletions lib/Util/H2O/More.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use warnings;
package Util::H2O::More;
use parent q/Exporter/;

our $VERSION = q{0.3.1};
our $VERSION = q{0.3.2};

our @EXPORT_OK = (qw/baptise opt2h2o h2o o2h d2o o2d o2h2o ini2h2o ini2o h2o2ini o2ini Getopt2h2o ddd dddie tr4h2o yaml2o/);

Expand Down Expand Up @@ -294,12 +294,14 @@ __END__
=head1 NAME
Util::H2O::More - provides C<baptise>, a drop-in replacement for
C<bless>; like if C<bless> created accessors for you. This module
also provides additional methods built using C<h2o> or C<o2h> from
L<Util::H2O> that allow for the incremental addition of I<OOP> into
existing or small scale Perl code without having to fully commit
to a Perl I<OOP> framework or compromise one's personal Perl style.
Util::H2O::More - Provides C<baptise>, a drop-in replacement C<bless>
that creates accessors for you.
This module also provides additional methods built using C<h2o>
or C<o2h> from L<Util::H2O> that allow for the incremental addition
of I<OOP> into existing or small scale Perl code without having to
fully commit to a Perl I<OOP> framework or compromise one's personal
Perl style.
C<Util::H2O::More> now provides a wrapper method now, C<d2o>
that will find and I<objectify> all C<HASH> refs contained in
Expand Down Expand Up @@ -537,7 +539,7 @@ C<baptise> and friends.
# now $o can be used to query all possible options, even if they were
# never passed at the commandline
=head C<yaml2o FILENAME_OR_YAML_STRING>
=head2 C<yaml2o FILENAME_OR_YAML_STRING>
Takes a single parameter that may be the name of a YAML file (in which case
it uses L<YAML>'s C<LoadFile>) or as a string of YAML (in which case it uses
Expand Down Expand Up @@ -590,13 +592,47 @@ If you just need, e.g., the C<$dbconfig>; then this trick would apply well also:
my ($dbconfig, undef) = yaml2o q{/path/to/myfile.yaml};
Similarly, the following works as expected. The only different is that C<$YAML>
contains a string.
my $YAML =<< EOYAML;
---
database:
host: localhost
port: 3306
db: users
username: appuser
password: 1uggagel2345
---
devices:
copter1:
active: 1
macaddr: a0:ff:6b:14:19:6e
host: 192.168.0.14
port: 80
thingywhirl:
active: 1
macaddr: 00:88:fb:1a:5f:08
host: 192.168.0.14
port: 80
EOYAML
my ($dbconfig, $devices) = yaml2o $YAML;
=head3 C<yaml2o> May C<die>!
If whatever is passed to C<yaml2o> looks like neither a block of YAML or a file
name, an exception will be thrown with an error saying as much.
Note: There is no C<o2yaml> that serializes an object to a file. One may be provided
=head3 Note on Serialization to YAML
There is no C<o2yaml> that serializes an object to a file. One may be provided
at a later date. If you're reading this and want it, please create an issue at
the Github repository to request it (or other things).
See also, C<o2h>, which returns the pure underlying Perl data structure that is
objectified by C<h2o>, C<baptise>, C<ini2o>, C<yaml2o>, C<d2o>, etc.
=head2 C<ini2h2o FILENAME>
Takes the name of a file, uses L<Config::Tiny> to open it, then gives it
Expand Down
Binary file added releases/Util-H2O-More-0.3.2.tar.gz
Binary file not shown.

0 comments on commit 2132521

Please sign in to comment.