From 3fbd864971d19f724ae234c371006592dc393336 Mon Sep 17 00:00:00 2001 From: Doug Bell Date: Sun, 28 Feb 2016 19:30:41 -0600 Subject: [PATCH] release v1.018 - add better error when object config incomplete - fix unprefixed metadata allowed outside the root - add debugging info with BEAM_WIRE_DEBUG envvar --- CHANGES | 7 ++++++- Makefile.PL | 4 ++-- README | 23 ++++++++++++++++++----- README.mkdn | 21 +++++++++++++++------ 4 files changed, 41 insertions(+), 14 deletions(-) diff --git a/CHANGES b/CHANGES index 4c5e421..efc40b6 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,11 @@ Changelog for Beam-Wire -1.017 2016-02-28T05:43:50 +1.018 2016-02-29T01:30:05 + - add better error when object config incomplete + - fix unprefixed metadata allowed outside the root + - add debugging info with BEAM_WIRE_DEBUG envvar + +1.017 2016-02-28T05:43:50Z - add bare services - rewrite and expand the documentation diff --git a/Makefile.PL b/Makefile.PL index b8d630e..f7ad025 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -40,9 +40,9 @@ my %WriteMakefileArgs = ( "Test::Lib" => 0, "Test::More" => "1.001005" }, - "VERSION" => "1.017", + "VERSION" => "1.018", "test" => { - "TESTS" => "t/*.t t/container/*.t t/dependency/*.t t/deprecated/*.t t/service/*.t" + "TESTS" => "t/*.t t/container/*.t t/dependency/*.t t/deprecated/*.t t/method/*.t t/regression/*.t t/service/*.t" } ); diff --git a/README b/README index c579d43..e62ee5e 100644 --- a/README +++ b/README @@ -305,17 +305,20 @@ dependencies are created first. =method is_meta - my $is_meta = $wire->is_meta( $ref_hash ); + my $is_meta = $wire->is_meta( $ref_hash, $root ); Returns true if the given hash reference describes some kind of Beam::Wire service. This is used to identify service configuration hashes inside of larger data structures. A service hash reference must contain at least one key, and must either -be made completely of meta keys (as returned by L), or contain a L key that -could create or reference an object (one of C, C, -C, C, or C); +contain a L key that could create or reference an +object (one of C, C, C, C, or C) or, +if the C<$root> flag exists, be made completely of unprefixed meta keys +(as returned by L). + +The C<$root> flag is used by L to allow unprefixed +meta keys in the top-level hash values. =method get_meta_names @@ -438,3 +441,13 @@ Both "value" and "class" or "extends" are defined. These are mutually-exclusive. =back +=head1 ENVIRONMENT VARIABLES + +=over 4 + +=item BEAM_WIRE_DEBUG + +If set, print a bunch of internal debugging information to STDERR. + +=back + diff --git a/README.mkdn b/README.mkdn index db61518..7dd358a 100644 --- a/README.mkdn +++ b/README.mkdn @@ -4,7 +4,7 @@ Beam::Wire - Lightweight Dependency Injection Container # VERSION -version 1.017 +version 1.018 # STATUS @@ -316,17 +316,20 @@ dependencies are created first. ## is\_meta - my $is_meta = $wire->is_meta( $ref_hash ); + my $is_meta = $wire->is_meta( $ref_hash, $root ); Returns true if the given hash reference describes some kind of Beam::Wire service. This is used to identify service configuration hashes inside of larger data structures. A service hash reference must contain at least one key, and must either -be made completely of meta keys (as returned by [the get\_meta\_names -method](#get_meta_names)), or contain a [prefixed](#meta_prefix) key that -could create or reference an object (one of `class`, `extends`, -`config`, `value`, or `ref`); +contain a [prefixed](#meta_prefix) key that could create or reference an +object (one of `class`, `extends`, `config`, `value`, or `ref`) or, +if the `$root` flag exists, be made completely of unprefixed meta keys +(as returned by [the get\_meta\_names method](#get_meta_names)). + +The `$root` flag is used by [the get method](#get) to allow unprefixed +meta keys in the top-level hash values. ## get\_meta\_names @@ -439,6 +442,12 @@ The configuration is invalid: - Both "value" and "class" or "extends" are defined. These are mutually-exclusive. +# ENVIRONMENT VARIABLES + +- BEAM\_WIRE\_DEBUG + + If set, print a bunch of internal debugging information to STDERR. + # AUTHORS - Doug Bell