| 1 | package SBOM::CycloneDX::Component::Commit; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use 5.010001; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 1 | ▶ | use utf8; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 1 | ▶ | use SBOM::CycloneDX::List; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | 1 | ▶ | use Types::Standard qw(Str InstanceOf); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | |||||||||||
| 12 | 1 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 13 | 1 | ▶ | use namespace::autoclean; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 14 | |||||||||||
| 15 | 1 | extends 'SBOM::CycloneDX::Base'; | |||||||||
| 16 | |||||||||||
| 17 | 1 | has uid => (is => 'rw', isa => Str); | |||||||||
| 18 | 1 | has url => (is => 'rw', isa => Str); | |||||||||
| 19 | 1 | has author => (is => 'rw', isa => InstanceOf ['SBOM::CycloneDX::IdentifiableAction']); | |||||||||
| 20 | 1 | has committer => (is => 'rw', isa => InstanceOf ['SBOM::CycloneDX::IdentifiableAction']); | |||||||||
| 21 | 1 | has message => (is => 'rw', isa => Str); | |||||||||
| 22 | |||||||||||
| 23 | 0 | ▶ | sub TO_JSON { | ||||||||
|
Subroutine
TO_JSON: not called CC=6 SCAR=37.4
Pod
documented
| |||||||||||
| 24 | |||||||||||
| 25 | 0 | my $self = shift; | |||||||||
| 26 | |||||||||||
| 27 | 0 | my $json = {}; | |||||||||
| 28 | |||||||||||
| 29 | 0 | ▶ | $json->{uid} = $self->uid if $self->uid; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 30 | 0 | ▶ | $json->{url} = $self->url if $self->url; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 31 | 0 | ▶ | $json->{author} = $self->author if $self->author; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 32 | 0 | ▶ | $json->{committer} = $self->committer if $self->committer; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 33 | 0 | ▶ | $json->{message} = $self->message if $self->message; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 34 | |||||||||||
| 35 | 0 | return $json; | |||||||||
| 36 | |||||||||||
| 37 | } | ||||||||||
| 38 | |||||||||||
| 39 | 1 | 1; | |||||||||
| 40 | |||||||||||
| 41 | =encoding utf-8 | ||||||||||
| 42 | |||||||||||
| 43 | =head1 NAME | ||||||||||
| 44 | |||||||||||
| 45 | SBOM::CycloneDX::Component::Commit - Commit | ||||||||||
| 46 | |||||||||||
| 47 | =head1 SYNOPSIS | ||||||||||
| 48 | |||||||||||
| 49 | SBOM::CycloneDX::Component::Commit->new(); | ||||||||||
| 50 | |||||||||||
| 51 | |||||||||||
| 52 | =head1 DESCRIPTION | ||||||||||
| 53 | |||||||||||
| 54 | L<SBOM::CycloneDX::Component::Commit> specifies an individual commit. | ||||||||||
| 55 | |||||||||||
| 56 | =head2 METHODS | ||||||||||
| 57 | |||||||||||
| 58 | L<SBOM::CycloneDX::Component::Commit> inherits all methods from L<SBOM::CycloneDX::Base> | ||||||||||
| 59 | and implements the following new ones. | ||||||||||
| 60 | |||||||||||
| 61 | =over | ||||||||||
| 62 | |||||||||||
| 63 | =item SBOM::CycloneDX::Component::Commit->new( %PARAMS ) | ||||||||||
| 64 | |||||||||||
| 65 | Properties: | ||||||||||
| 66 | |||||||||||
| 67 | =over | ||||||||||
| 68 | |||||||||||
| 69 | =item * C<author>, The author who created the changes in the commit | ||||||||||
| 70 | |||||||||||
| 71 | =item * C<committer>, The person who committed or pushed the commit | ||||||||||
| 72 | |||||||||||
| 73 | =item * C<message>, The text description of the contents of the commit | ||||||||||
| 74 | |||||||||||
| 75 | =item * C<uid>, A unique identifier of the commit. This may be version | ||||||||||
| 76 | control specific. For example, Subversion uses revision numbers whereas git | ||||||||||
| 77 | uses commit hashes. | ||||||||||
| 78 | |||||||||||
| 79 | =item * C<url>, The URL to the commit. This URL will typically point to a | ||||||||||
| 80 | commit in a version control system. | ||||||||||
| 81 | |||||||||||
| 82 | =back | ||||||||||
| 83 | |||||||||||
| 84 | =item $commit->author | ||||||||||
| 85 | |||||||||||
| 86 | =item $commit->committer | ||||||||||
| 87 | |||||||||||
| 88 | =item $commit->message | ||||||||||
| 89 | |||||||||||
| 90 | =item $commit->uid | ||||||||||
| 91 | |||||||||||
| 92 | =item $commit->url | ||||||||||
| 93 | |||||||||||
| 94 | =back | ||||||||||
| 95 | |||||||||||
| 96 | |||||||||||
| 97 | =head1 SUPPORT | ||||||||||
| 98 | |||||||||||
| 99 | =head2 Bugs / Feature Requests | ||||||||||
| 100 | |||||||||||
| 101 | Please report any bugs or feature requests through the issue tracker | ||||||||||
| 102 | at L<https://github.com/giterlizzi/perl-SBOM-CycloneDX/issues>. | ||||||||||
| 103 | You will be notified automatically of any progress on your issue. | ||||||||||
| 104 | |||||||||||
| 105 | =head2 Source Code | ||||||||||
| 106 | |||||||||||
| 107 | This is open source software. The code repository is available for | ||||||||||
| 108 | public review and contribution under the terms of the license. | ||||||||||
| 109 | |||||||||||
| 110 | L<https://github.com/giterlizzi/perl-SBOM-CycloneDX> | ||||||||||
| 111 | |||||||||||
| 112 | git clone https://github.com/giterlizzi/perl-SBOM-CycloneDX.git | ||||||||||
| 113 | |||||||||||
| 114 | |||||||||||
| 115 | =head1 AUTHOR | ||||||||||
| 116 | |||||||||||
| 117 | =over 4 | ||||||||||
| 118 | |||||||||||
| 119 | =item * Giuseppe Di Terlizzi <gdt@cpan.org> | ||||||||||
| 120 | |||||||||||
| 121 | =back | ||||||||||
| 122 | |||||||||||
| 123 | |||||||||||
| 124 | =head1 LICENSE AND COPYRIGHT | ||||||||||
| 125 | |||||||||||
| 126 | This software is copyright (c) 2025-2026 by Giuseppe Di Terlizzi. | ||||||||||
| 127 | |||||||||||
| 128 | This is free software; you can redistribute it and/or modify it under | ||||||||||
| 129 | the same terms as the Perl 5 programming language system itself. | ||||||||||
| 130 | |||||||||||
| 131 | =cut | ||||||||||