e Archive::Tar;
use CPAN::cpanminus::reporter::RetainReports;
use Data::Dump ( qw| dd pp | );
use JSON;
use Path::Tiny;
use Perl::Download::FTP;
use Text::CSV_XS;
=head1 NAME
Test::Against::Dev - Te
d F<.log.json>
files like these:
$> ls -l ./results/perl-5.27.6/analysis/01 | head -5
total 5824
-rw-r--r-- 1 jkeenan jkeenan 757 Dec 16 13:58 ABH.Mozilla-CA-20160104.log.json
-rw-
7060201.log.json
-rw-r--r-- 1 jkeenan jkeenan 11639 Dec 16 13:58 ABW.Template-Toolkit-2.27.log.json
-rw-r--r-- 1 jkeenan jkeenan 645 Dec 16 13:58 ABW.XML-Namespace-0.02.log.json
In versio
lt => sub { SBOM::CycloneDX::List->new }
);
sub TO_JSON {
my $self = shift;
my $json = {standards => $self->standards};
return $json;
}
1;
=encoding utf-8
=head1 NAME
SBOM::Cyclon
=> 'rw', isa => HashRef);
sub TO_JSON {
my $self = shift;
my $json = {};
$json->{assessors} = $self->assessors if @{$self->assessors};
$json->{attestations} = $self->attestat
{$self->attestations};
$json->{claims} = $self->claims if @{$self->claims};
$json->{evidence} = $self->evidence if @{$self->evidence};
$json->{targets} = $self->ta
if $self->targets;
$json->{affirmation} = $self->affirmation if $self->affirmation;
$json->{signature} = $self->signature if $self->signature;
return $json;
}
1;
=encoding utf-
e Archive::Tar;
use CPAN::cpanminus::reporter::RetainReports;
use Data::Dump ( qw| dd pp | );
use JSON;
use Path::Tiny;
use Text::CSV_XS;
=head1 NAME
Test::Against::Build - Test CPAN modules against
alysis_dir = $self->analyze_cpanm_build_logs( { verbose => 1 } );
$fcdvfile = $self->analyze_json_logs( { verbose => 1, sep_char => '|' } );
=head1 DESCRIPTION
=head2 Who Should Use This Librar
with methods to run F<cpanm> against a specific list of modules, parse the
results into files in JSON format and then summarize those results in a
delimiter-separated-values file (such as a pipe-sepa
:JSON::XS qw(decode_json);
state @LICENSES;
unless (@LICENSES) {
my $spdx_json_schema_file = SBOM::CycloneDX::Schema::schema_file('spdx.schema.json');
my $spdx_json_schema = decode_json
(SBOM::CycloneDX::Util::file_read($spdx_json_schema_file));
@LICENSES = @{$spdx_json_schema->{enum}};
}
use constant SPDX_LICENSES => \@LICENSES;
use constant COMPONENT_TYPES => (qw[
applica
rw', isa => HashRef);
sub TO_JSON {
my $self = shift;
my $json = {};
$json->{'bom-ref'} = $self->bom if $self->bom_ref;
$json->{name} = $self
elf->name;
$json->{version} = $self->version if $self->version;
$json->{description} = $self->description if $self->description;
$json->{owner}
>owner;
$json->{requirements} = $self->requirements if @{$self->requirements};
$json->{levels} = $self->levels if @{$self->levels};
$json->{externalRe
=> 'rw', isa => Enum [qw(base64)]);
has content => (is => 'rw', required => 1);
sub TO_JSON {
my $self = shift;
# TODO use trigger
# TODO guess mime/type from content
C
my $json = {content => $content};
$json->{contentType} = $self->content_type if $self->content_type;
$json->{encoding} = $self->encoding if $self->encoding;
return $json;
}
1
cifies the optional encoding the text is represented in.
=item $c->TO_JSON
Convert the attachment in JSON.
say encode_json($attachment);
# {
# "content": "Y29uc29sZS5sb2coJ0dvb2RCeWU
}
);
sub TO_JSON {
my $self = shift;
my $json = {};
$json->{'bom-ref'} = $self->bom_ref if $self->bom_ref;
$json->{name} = $self->name if $self->name;
$json->{address}
ess if %{$self->address->TO_JSON};
$json->{url} = $self->url if @{$self->url};
$json->{contact} = $self->contact if @{$self->contact};
return $json;
}
1;
=encoding utf-8
=
loneDX::List->new }
);
sub TO_JSON {
my $self = shift;
my $json = {};
$json->{vendor} = $self->vendor if $self->vendor;
$json->{name} = $self
self->name;
$json->{version} = $self->version if $self->version;
$json->{hashes} = $self->hashes if @{$self->hashes};
$json->{externalRefere
nces} = $self->external_references if @{$self->external_references};
return $json;
}
1;
=encoding utf-8
=head1 NAME
SBOM::CycloneDX::Tool - Tool
=head1 SYNOPSIS
SBOM::CycloneDX::Tool->
OrganizationalContact']);
sub TO_JSON {
my $self = shift;
my $json = {};
$json->{organization} = $self->organization if $self->organization;
$json->{contact} = $self->contact
if $self->contact;
return $json;
}
1;
=encoding utf-8
=head1 NAME
SBOM::CycloneDX::DataGovernanceResponsibleParty - Data Custodians
=head1 SYNOPSIS
SBOM::CycloneDX::DataGovernance
p::carp 'Malformed timestamp';
return Time::Piece->new;
}
sub to_string { shift->TO_JSON }
sub TO_JSON { shift->value->datetime . '.000Z' }
1;
=encoding utf-8
=head1 NAME
SBOM::CycloneDX::
=item $ts->value
Return L<Time::Piece> object.
=item $ts->to_string
=item $ts->TO_JSON
Return timestamp in JSON format.
=back
=head1 SUPPORT
=head2 Bugs / Feature Requests
Please report any bu
##############
require IO::Scalar;
require Data::Dumper;
require JSON;
require Text::CSV_XS;
JSON->import('decode_json');
Data::Dumper->import('Dumper');
# +------------------+
# |
--------+
# | READ A JSON FILE |
# +------------------+
my $json_text = <<'END_OF_TEXT';
{
"foo" : "bar",
"baz" : "buz"
}
END_OF_TEXT
$fh = IO::Scalar->new( \$json_text );
print Dump
post(@_);
return decode_json( join $EMPTY, @{ $_[1] } );
}
)
);
$fh = IO::Scalar->new( \$json_text );
print Dumper( decode_json( process_file( $fh, merge_lines => 1,
TO_JSON {
my $self = shift;
my $json = {};
$json->{attachment} = $self->attachment if $self->attachment;
$json->{url} = $self->url if $self->url;
return $json;
b TO_JSON {
my $self = shift;
my $json = {};
$json->{score} = $self->score if $self->score;
$json->{rationale} = $self->rationale if $self->rationale;
return $json;
}
_JSON {
my $self = shift;
my $json = {};
$json->{'bom-ref'} = $self->bom_ref if $self->bom_ref;
$json->{thirdParty} = $self->third_party if $self->third_party;
$json-
>{organization} = $self->organization if $self->organization;
return $json;
}
1;
=encoding utf-8
=head1 NAME
SBOM::CycloneDX::Declarations::Assessor - Assessor
=head1 SYNOPSIS
SBOM::Cy
_JSON {
my $self = shift;
my $json = {};
$json->{statement} = $self->statement if $self->statement;
$json->{signatories} = $self->signatories if @{$self->signatories};
$json
->{signature} = $self->signature if $self->signature;
return $json;
}
1;
=encoding utf-8
=head1 NAME
SBOM::CycloneDX::Declarations::Affirmation - Affirmation
=head1 SYNOPSIS
SBOM::
an
organization to assert validity of this document.
=item C<signature>, Enveloped signature in JSON Signature Format (JSF)
(L<https://cyberphone.github.io/doc/security/jsf.html>).
=item C<statemen
s => 'rw', isa => HashRef);
sub TO_JSON {
my $self = shift;
my $json = {};
$json->{'bom-ref'} = $self->bom_ref if $self->bom_ref;
$json->{propertyName} = $self->property_n
if $self->description;
$json->{data} = $self->data if @{$self->data};
$json->{created} = $self->created if $self->created;
$json->{expires} = $self->expi
if $self->expires;
$json->{author} = $self->author if $self->author;
$json->{reviewer} = $self->reviewer if $self->reviewer;
$json->{signature} = $self->sign
1 NAME
Minima::View::PlainText - Render plain text views
=head1 SYNOPSIS
use Minima::View::JSON;
my $view = Minima::View::PlainText->new;
$view->prepare_response($response);
my $b
[HashRef]);
sub TO_JSON {
my $self = shift;
my $json = {name => $self->name};
$json->{'bom-ref'} = $self->bom_ref if $self->bom_ref;
$json->{provider}
lf->provider;
$json->{group} = $self->group if $self->group;
$json->{version} = $self->version if $self->version;
$json->{description}
iption;
$json->{endpoints} = $self->endpoints if @{$self->endpoints};
$json->{authenticated} = $self->authenticated if $self->authenticated;
$json->{'x-trust-
Plugin::MetaNoIndex;
use Dist::Zilla::Plugin::MetaProvides::Package;
use Dist::Zilla::Plugin::MetaJSON;
use Dist::Zilla::Plugin::ModuleBuild;
use Dist::Zilla::Plugin::Manifest;
use Dist::Zilla::Plugin
>add_plugins(
[ 'Git::GatherDir' =>
{ exclude_filename => [qw/README.pod META.json cpanfile LICENSE/] }],
'PruneCruft',
'ManifestSkip',
'License',
[
examples/],
}],
['MetaProvides::Package' => { meta_noindex => 1 } ],
'MetaJSON',
'ModuleBuild',
'Manifest',
['AutoPrereqs' => {skips=>['^strict$','^warn