Aion-Format
view release on metacpan or search on metacpan
lib/Aion/Format.pm view on Meta::CPAN
no strict; no warnings; no diagnostics;
use common::sense;
our $VERSION = "0.1.0";
require POSIX;
require Term::ANSIColor;
use Exporter qw/import/;
our @EXPORT = our @EXPORT_OK = grep {
*{$Aion::Format::{$_}}{CODE} && !/^(_|(NaN|import)\z)/n
} keys %Aion::Format::;
#@category ÐÑвод ÑÑÑÑкÑÑÑ
use DDP qw//;
sub _extends_ddp_properties {
my ($properties) = @_;
+{
lib/Aion/Format/Html.pm view on Meta::CPAN
package Aion::Format::Html;
use common::sense;
use Exporter qw/import/;
our @EXPORT = our @EXPORT_OK = grep {
*{$Aion::Format::Html::{$_}}{CODE} && !/^(_|(NaN|import)\z)/n
} keys %Aion::Format::Html::;
# ÐкÑаниÑÑÐµÑ ÑÐ¸Ð¼Ð²Ð¾Ð»Ñ html
my %HTML_SIM = (qw/< < > > & & \' ' " "/, "\n" => '<br>', "\t" => ' ');
sub to_html (;$) {
my ($s) = @_? @_: $_;
$s =~ s/[<>&\'\"]/$HTML_SIM{$&}/ge;
$s
}
lib/Aion/Format/Json.pm view on Meta::CPAN
package Aion::Format::Json;
use common::sense;
use JSON::XS qw//;
use Exporter qw/import/;
our @EXPORT = our @EXPORT_OK = grep {
*{$Aion::Format::Json::{$_}}{CODE} && !/^(_|(NaN|import)\z)/n
} keys %Aion::Format::Json::;
#@category json
# ÐаÑÑÑаиваем json
our $JSON = JSON::XS->new->allow_nonref->indent(1)->space_after(1)->canonical(1);
# Ð json
sub to_json(;$) {
$JSON->encode(@_ == 0? $_: @_)
lib/Aion/Format/Url.pm view on Meta::CPAN
package Aion::Format::Url;
use common::sense;
use List::Util qw//;
use Encode qw//;
use Exporter qw/import/;
our @EXPORT = our @EXPORT_OK = grep {
ref \$Aion::Format::Url::{$_} eq "GLOB"
&& *{$Aion::Format::Url::{$_}}{CODE} && !/^(_|(NaN|import)\z)/n
} keys %Aion::Format::Url::;
#@category escape url
use constant UNSAFE_RFC3986 => qr/[^A-Za-z0-9\-\._~]/;
# ÐÑÐºÐµÐ¹Ð¿Ð¸Ñ Ð·Ð½Ð°Ñение
sub to_url_param(;$) {
my ($param) = @_ == 0? $_: @_;
lib/Aion/Format/Yaml.pm view on Meta::CPAN
package Aion::Format::Yaml;
use common::sense;
use YAML::Syck qw//;
use Exporter qw/import/;
our @EXPORT = our @EXPORT_OK = grep {
*{$Aion::Format::Yaml::{$_}}{CODE} && !/^(_|(NaN|import)\z)/n
} keys %Aion::Format::Yaml::;
#@category yaml
# ÐаÑÑÑаиваем yaml
$YAML::Syck::Headless = 1;
$YAML::Syck::SortKeys = 1;
$YAML::Syck::ImplicitTyping = 1;
$YAML::Syck::ImplicitUnicode = 1;
$YAML::Syck::ImplicitBinary = 1;
t/aion/format/url.pm view on Meta::CPAN
use common::sense; use open qw/:std :utf8/; use Carp qw//; use Cwd qw//; use File::Basename qw//; use File::Find qw//; use File::Slurper qw//; use File::Spec qw//; use File::Path qw//; use Scalar::Util qw//; use Test::More 0.98; use String::Diff q...
#
# use common::sense;
#
# use List::Util qw//;
# use Encode qw//;
#
# use Exporter qw/import/;
# our @EXPORT = our @EXPORT_OK = grep {
# ref \$Aion::Format::Url::{$_} eq "GLOB"
# && *{$Aion::Format::Url::{$_}}{CODE} && !/^(_|(NaN|import)\z)/n
# } keys %Aion::Format::Url::;
#
#
# #@category escape url
#
# use constant UNSAFE_RFC3986 => qr/[^A-Za-z0-9\-\._~]/;
#
# # ÐÑÐºÐµÐ¹Ð¿Ð¸Ñ Ð·Ð½Ð°Ñение
# sub to_url_param(;$) {
# my ($param) = @_ == 0? $_: @_;
( run in 0.823 second using v1.01-cache-2.11-cpan-30a0b3e4e11 )