| 1 | package Aion::Format::Yaml; | ||||||||||||||||||||
| 2 | |||||||||||||||||||||
| 3 | 1 | ▶ | use common::sense; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 1 | ▶ | use YAML::Syck qw//; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | |||||||||||||||||||||
| 6 | 1 | ▶ | use Exporter qw/import/; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 7 | our @EXPORT = our @EXPORT_OK = grep { | ||||||||||||||||||||
| 8 | 1 | ▶ | *{$Aion::Format::Yaml::{$_}}{CODE} && !/^(_|(NaN|import)\z)/n | ||||||||||||||||||
|
Condition100%3/3
*{$Aion::Format::Yaml::{$_};}{'CODE'} && !/^(_|(NaN|import)\z)/nu
MC/DC100%2/2
*{$Aion::Format::Yaml::{$_};}{'CODE'} && !/^(_|(NaN|import)\z)/nu
*{$Aion::Format::Yaml::{$_};}{'CODE'}
!/^(_|(NaN|import)\z)/nu
Truth table100%3/3
A && not(B)
A= *{$Aion::Format::Yaml::{$_};}{'CODE'}B= !/^(_|(NaN|import)\z)/nu
| |||||||||||||||||||||
| 9 | } keys %Aion::Format::Yaml::; | ||||||||||||||||||||
| 10 | |||||||||||||||||||||
| 11 | #@category yaml | ||||||||||||||||||||
| 12 | |||||||||||||||||||||
| 13 | # Настраиваем yaml | ||||||||||||||||||||
| 14 | 1 | $YAML::Syck::Headless = 1; | |||||||||||||||||||
| 15 | 1 | $YAML::Syck::SortKeys = 1; | |||||||||||||||||||
| 16 | 1 | $YAML::Syck::ImplicitTyping = 1; | |||||||||||||||||||
| 17 | 1 | $YAML::Syck::ImplicitUnicode = 1; | |||||||||||||||||||
| 18 | 1 | $YAML::Syck::ImplicitBinary = 1; | |||||||||||||||||||
| 19 | 1 | $YAML::Syck::UseCode = 1; | |||||||||||||||||||
| 20 | 1 | $YAML::Syck::LoadCode = 1; | |||||||||||||||||||
| 21 | 1 | $YAML::Syck::DumpCode = 1; | |||||||||||||||||||
| 22 | |||||||||||||||||||||
| 23 | # В yaml | ||||||||||||||||||||
| 24 | 3 | ▶ | sub to_yaml(;$) { | ||||||||||||||||||
|
Subroutine
to_yaml: called CC=2 SCAR=7.6
Pod
documented
| |||||||||||||||||||||
| 25 | 3 | ▶ | YAML::Syck::Dump(@_ == 0? $_: @_) | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 26 | } | ||||||||||||||||||||
| 27 | |||||||||||||||||||||
| 28 | # Из yaml | ||||||||||||||||||||
| 29 | 9 | ▶ | sub from_yaml(;$) { | ||||||||||||||||||
|
Subroutine
from_yaml: called CC=2 SCAR=7.6
Pod
documented
| |||||||||||||||||||||
| 30 | 9 | ▶ | scalar YAML::Syck::Load(@_ == 0? $_: @_) | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 31 | } | ||||||||||||||||||||
| 32 | |||||||||||||||||||||
| 33 | 1 | 1; | |||||||||||||||||||
| 34 | |||||||||||||||||||||
| 35 | __END__ | ||||||||||||||||||||