.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "App::Sqitch::ItemFormatter 3pm" .TH App::Sqitch::ItemFormatter 3pm "2014-09-28" "perl v5.20.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "Name" .IX Header "Name" App::Sqitch::ItemFormatter \- Format events and changes for command output .SH "Synopsis" .IX Header "Synopsis" .Vb 2 \& my $formatter = App::Sqitch::ItemFormatter\->new(%params); \& say $formatter\->format($format, $item); .Ve .SH "Description" .IX Header "Description" This class is used by commands to format items for output. For example, \&\f(CW\*(C`log\*(C'\fR uses it to format the events it finds. It uses String::Formatter to do the actual formatting, but configures it for all the various times of things typically displayed, such as change names, IDs, event types, etc. This keeps things relatively simple, as all one needs to pass to \f(CW\*(C`format()\*(C'\fR is a format and then a hash reference of values to be used in the format. .SH "Interface" .IX Header "Interface" .SS "Constructor" .IX Subsection "Constructor" \fI\f(CI\*(C`new\*(C'\fI\fR .IX Subsection "new" .PP .Vb 1 \& my $formatter = App::Sqitch::ItemFormatter\->new(%params); .Ve .PP Constructs and returns a formatter object. The supported parameters are: .ie n .IP """abbrev""" 4 .el .IP "\f(CWabbrev\fR" 4 .IX Item "abbrev" Instead of showing the full 40\-byte hexadecimal change \s-1ID,\s0 format as a partial prefix the specified number of characters long. .ie n .IP """date_format""" 4 .el .IP "\f(CWdate_format\fR" 4 .IX Item "date_format" Format to use for timestamps. Defaults to \f(CW\*(C`iso\*(C'\fR. Allowed values: .RS 4 .ie n .IP """iso""" 4 .el .IP "\f(CWiso\fR" 4 .IX Item "iso" .PD 0 .ie n .IP """iso8601""" 4 .el .IP "\f(CWiso8601\fR" 4 .IX Item "iso8601" .PD \&\s-1ISO\-8601\s0 format. .ie n .IP """rfc""" 4 .el .IP "\f(CWrfc\fR" 4 .IX Item "rfc" .PD 0 .ie n .IP """rfc2822""" 4 .el .IP "\f(CWrfc2822\fR" 4 .IX Item "rfc2822" .PD \&\s-1RFC\-2822\s0 format. .ie n .IP """full""" 4 .el .IP "\f(CWfull\fR" 4 .IX Item "full" .PD 0 .ie n .IP """long""" 4 .el .IP "\f(CWlong\fR" 4 .IX Item "long" .ie n .IP """medium""" 4 .el .IP "\f(CWmedium\fR" 4 .IX Item "medium" .ie n .IP """short""" 4 .el .IP "\f(CWshort\fR" 4 .IX Item "short" .PD A format length to pass to the system locale's \f(CW\*(C`LC_TIME\*(C'\fR category. .ie n .IP """raw""" 4 .el .IP "\f(CWraw\fR" 4 .IX Item "raw" Raw format, which is strict \s-1ISO\-8601\s0 in the \s-1UTC\s0 time zone. .ie n .IP """strftime:$string""" 4 .el .IP "\f(CWstrftime:$string\fR" 4 .IX Item "strftime:$string" An arbitrary \f(CW\*(C`strftime\*(C'\fR pattern. See \*(L"strftime Paterns\*(R" in DateTime for comprehensive documentation of supported patterns. .ie n .IP """cldr:$pattern""" 4 .el .IP "\f(CWcldr:$pattern\fR" 4 .IX Item "cldr:$pattern" An arbitrary \f(CW\*(C`cldr\*(C'\fR pattern. See \*(L"\s-1CLDR\s0 Paterns\*(R" in DateTime for comprehensive documentation of supported patterns. .RE .RS 4 .RE .ie n .IP """color""" 4 .el .IP "\f(CWcolor\fR" 4 .IX Item "color" Controls the use of \s-1ANSI\s0 color formatting. The value may be one of: .RS 4 .ie n .IP """auto"" (the default)" 4 .el .IP "\f(CWauto\fR (the default)" 4 .IX Item "auto (the default)" .PD 0 .ie n .IP """always""" 4 .el .IP "\f(CWalways\fR" 4 .IX Item "always" .ie n .IP """never""" 4 .el .IP "\f(CWnever\fR" 4 .IX Item "never" .RE .RS 4 .RE .ie n .IP """formatter""" 4 .el .IP "\f(CWformatter\fR" 4 .IX Item "formatter" .PD A String::Formatter object. You probably don't want to pass one of these, as the default one understands all the values to that Sqitch is likely to want to format. .SS "Instance Methods" .IX Subsection "Instance Methods" \fI\f(CI\*(C`format\*(C'\fI\fR .IX Subsection "format" .PP .Vb 1 \& $formatter\->format( $format, $item ); .Ve .PP Formats an item as a string and returns it. The item will be formatted using the first argument. See \*(L"Formats\*(R" for the gory details. .PP The second argument is a hash reference defining the item to be formatted. These are simple key/value pairs, generally identifying attribute names and values. The supported keys are: .ie n .IP """event""" 4 .el .IP "\f(CWevent\fR" 4 .IX Item "event" The type of event, which is one of: .RS 4 .ie n .IP """deploy""" 4 .el .IP "\f(CWdeploy\fR" 4 .IX Item "deploy" .PD 0 .ie n .IP """revert""" 4 .el .IP "\f(CWrevert\fR" 4 .IX Item "revert" .ie n .IP """fail""" 4 .el .IP "\f(CWfail\fR" 4 .IX Item "fail" .RE .RS 4 .RE .ie n .IP """project""" 4 .el .IP "\f(CWproject\fR" 4 .IX Item "project" .PD The name of the project with which the change is associated. .ie n .IP """change_id""" 4 .el .IP "\f(CWchange_id\fR" 4 .IX Item "change_id" The change \s-1ID.\s0 .ie n .IP """change""" 4 .el .IP "\f(CWchange\fR" 4 .IX Item "change" The name of the change. .ie n .IP """note""" 4 .el .IP "\f(CWnote\fR" 4 .IX Item "note" A brief description of the change. .ie n .IP """tags""" 4 .el .IP "\f(CWtags\fR" 4 .IX Item "tags" An array reference of the names of associated tags. .ie n .IP """requires""" 4 .el .IP "\f(CWrequires\fR" 4 .IX Item "requires" An array reference of the names of any changes required by the change. .ie n .IP """conflicts""" 4 .el .IP "\f(CWconflicts\fR" 4 .IX Item "conflicts" An array reference of the names of any changes that conflict with the change. .ie n .IP """committed_at""" 4 .el .IP "\f(CWcommitted_at\fR" 4 .IX Item "committed_at" An App::Sqitch::DateTime object representing the date and time at which the event was logged. .ie n .IP """committer_name""" 4 .el .IP "\f(CWcommitter_name\fR" 4 .IX Item "committer_name" Name of the user who deployed the change. .ie n .IP """committer_email""" 4 .el .IP "\f(CWcommitter_email\fR" 4 .IX Item "committer_email" Email address of the user who deployed the change. .ie n .IP """planned_at""" 4 .el .IP "\f(CWplanned_at\fR" 4 .IX Item "planned_at" An App::Sqitch::DateTime object representing the date and time at which the change was added to the plan. .ie n .IP """planner_name""" 4 .el .IP "\f(CWplanner_name\fR" 4 .IX Item "planner_name" Name of the user who added the change to the plan. .ie n .IP """planner_email""" 4 .el .IP "\f(CWplanner_email\fR" 4 .IX Item "planner_email" Email address of the user who added the change to the plan. .SH "Formats" .IX Header "Formats" The format argument to \f(CW\*(C`format()\*(C'\fR specifies the item information to be included in the resulting string. It works a little bit like \f(CW\*(C`printf\*(C'\fR format and a little like Git log format. For example, this format: .PP .Vb 1 \& format:The committer of %h was %{name}c%vThe title was >>%s<<%v .Ve .PP Would show something like this: .PP .Vb 2 \& The committer of f26a3s was Tom Lane \& The title was >>We really need to get this right.<< .Ve .PP The placeholders are: .IP "\(bu" 4 \&\f(CW%H\fR: Event change \s-1ID\s0 .IP "\(bu" 4 \&\f(CW%h\fR: Event change \s-1ID \s0(respects \f(CW\*(C`\-\-abbrev\*(C'\fR) .IP "\(bu" 4 \&\f(CW%n\fR: Event change name .IP "\(bu" 4 \&\f(CW%o\fR: Event change project name .IP "\(bu" 4 \&\f(CW\*(C`%($len)h\*(C'\fR: abbreviated change of length \f(CW$len\fR .IP "\(bu" 4 \&\f(CW%e\fR: Event type (deploy, revert, fail) .IP "\(bu" 4 \&\f(CW%l\fR: Localized lowercase event type label .IP "\(bu" 4 \&\f(CW%L\fR: Localized title case event type label .IP "\(bu" 4 \&\f(CW%c\fR: Event committer name and email address .IP "\(bu" 4 \&\f(CW\*(C`%{name}c\*(C'\fR: Event committer name .IP "\(bu" 4 \&\f(CW\*(C`%{email}c\*(C'\fR: Event committer email address .IP "\(bu" 4 \&\f(CW\*(C`%{date}c\*(C'\fR: commit date (respects \f(CW\*(C`\-\-date\-format\*(C'\fR) .IP "\(bu" 4 \&\f(CW\*(C`%{date:rfc}c\*(C'\fR: commit date, \s-1RFC2822\s0 format .IP "\(bu" 4 \&\f(CW\*(C`%{date:iso}c\*(C'\fR: commit date, \s-1ISO\-8601\s0 format .IP "\(bu" 4 \&\f(CW\*(C`%{date:full}c\*(C'\fR: commit date, full format .IP "\(bu" 4 \&\f(CW\*(C`%{date:long}c\*(C'\fR: commit date, long format .IP "\(bu" 4 \&\f(CW\*(C`%{date:medium}c\*(C'\fR: commit date, medium format .IP "\(bu" 4 \&\f(CW\*(C`%{date:short}c\*(C'\fR: commit date, short format .IP "\(bu" 4 \&\f(CW\*(C`%{date:cldr:$pattern}c\*(C'\fR: commit date, formatted with custom \s-1CLDR\s0 pattern .IP "\(bu" 4 \&\f(CW\*(C`%{date:strftime:$pattern}c\*(C'\fR: commit date, formatted with custom strftime pattern .IP "\(bu" 4 \&\f(CW%c\fR: Change planner name and email address .IP "\(bu" 4 \&\f(CW\*(C`%{name}p\*(C'\fR: Change planner name .IP "\(bu" 4 \&\f(CW\*(C`%{email}p\*(C'\fR: Change planner email address .IP "\(bu" 4 \&\f(CW\*(C`%{date}p\*(C'\fR: plan date (respects \f(CW\*(C`\-\-date\-format\*(C'\fR) .IP "\(bu" 4 \&\f(CW\*(C`%{date:rfc}p\*(C'\fR: plan date, \s-1RFC2822\s0 format .IP "\(bu" 4 \&\f(CW\*(C`%{date:iso}p\*(C'\fR: plan date, \s-1ISO\-8601\s0 format .IP "\(bu" 4 \&\f(CW\*(C`%{date:full}p\*(C'\fR: plan date, full format .IP "\(bu" 4 \&\f(CW\*(C`%{date:long}p\*(C'\fR: plan date, long format .IP "\(bu" 4 \&\f(CW\*(C`%{date:medium}p\*(C'\fR: plan date, medium format .IP "\(bu" 4 \&\f(CW\*(C`%{date:short}p\*(C'\fR: plan date, short format .IP "\(bu" 4 \&\f(CW\*(C`%{date:cldr:$pattern}p\*(C'\fR: plan date, formatted with custom \s-1CLDR\s0 pattern .IP "\(bu" 4 \&\f(CW\*(C`%{date:strftime:$pattern}p\*(C'\fR: plan date, formatted with custom strftime pattern .IP "\(bu" 4 \&\f(CW%t\fR: Comma-delimited list of tags .IP "\(bu" 4 \&\f(CW\*(C`%{$sep}t\*(C'\fR: list of tags delimited by \f(CW$sep\fR .IP "\(bu" 4 \&\f(CW%T\fR: Parenthesized list of comma-delimited tags .IP "\(bu" 4 \&\f(CW\*(C`%{$sep}T\*(C'\fR: Parenthesized list of tags delimited by \f(CW$sep\fR .IP "\(bu" 4 \&\f(CW%s\fR: Subject (a.k.a. title line) .IP "\(bu" 4 \&\f(CW%r\fR: Comma-delimited list of required changes .IP "\(bu" 4 \&\f(CW\*(C`%{$sep}r\*(C'\fR: list of required changes delimited by \f(CW$sep\fR .IP "\(bu" 4 \&\f(CW%R\fR: Localized label and list of comma-delimited required changes .IP "\(bu" 4 \&\f(CW\*(C`%{$sep}R\*(C'\fR: Localized label and list of required changes delimited by \f(CW$sep\fR .IP "\(bu" 4 \&\f(CW%x\fR: Comma-delimited list of conflicting changes .IP "\(bu" 4 \&\f(CW\*(C`%{$sep}x\*(C'\fR: list of conflicting changes delimited by \f(CW$sep\fR .IP "\(bu" 4 \&\f(CW%X\fR: Localized label and list of comma-delimited conflicting changes .IP "\(bu" 4 \&\f(CW\*(C`%{$sep}X\*(C'\fR: Localized label and list of conflicting changes delimited by \f(CW$sep\fR .IP "\(bu" 4 \&\f(CW%b\fR: Body .IP "\(bu" 4 \&\f(CW%B\fR: Raw body (unwrapped subject and body) .IP "\(bu" 4 \&\f(CW\*(C`%{$prefix}\*(C'\fRB: Raw body with \f(CW$prefix\fR prefixed to every line .IP "\(bu" 4 \&\f(CW\*(C`%{event}_\*(C'\fR Localized label for \*(L"event\*(R" .IP "\(bu" 4 \&\f(CW\*(C`%{change}_\*(C'\fR Localized label for \*(L"change\*(R" .IP "\(bu" 4 \&\f(CW\*(C`%{committer}_\*(C'\fR Localized label for \*(L"committer\*(R" .IP "\(bu" 4 \&\f(CW\*(C`%{planner}_\*(C'\fR Localized label for \*(L"planner\*(R" .IP "\(bu" 4 \&\f(CW\*(C`%{by}_\*(C'\fR Localized label for \*(L"by\*(R" .IP "\(bu" 4 \&\f(CW\*(C`%{date}_\*(C'\fR Localized label for \*(L"date\*(R" .IP "\(bu" 4 \&\f(CW\*(C`%{committed}_\*(C'\fR Localized label for \*(L"committed\*(R" .IP "\(bu" 4 \&\f(CW\*(C`%{planned}_\*(C'\fR Localized label for \*(L"planned\*(R" .IP "\(bu" 4 \&\f(CW\*(C`%{name}_\*(C'\fR Localized label for \*(L"name\*(R" .IP "\(bu" 4 \&\f(CW\*(C`%{project}_\*(C'\fR Localized label for \*(L"project\*(R" .IP "\(bu" 4 \&\f(CW\*(C`%{email}_\*(C'\fR Localized label for \*(L"email\*(R" .IP "\(bu" 4 \&\f(CW\*(C`%{requires}_\*(C'\fR Localized label for \*(L"requires\*(R" .IP "\(bu" 4 \&\f(CW\*(C`%{conflicts}_\*(C'\fR Localized label for \*(L"conflicts\*(R" .IP "\(bu" 4 \&\f(CW%v\fR vertical space (newline) .IP "\(bu" 4 \&\f(CW\*(C`%{$color}C\*(C'\fR: An \s-1ANSI\s0 color: black, red, green, yellow, reset, etc. .IP "\(bu" 4 \&\f(CW\*(C`%{:event}C\*(C'\fR: An \s-1ANSI\s0 color based on event type (green deploy, blue revert, red fail) .IP "\(bu" 4 \&\f(CW\*(C`%{$attribute}a\*(C'\fR: The raw attribute name and value, if it exists and has a value .SH "See Also" .IX Header "See Also" .IP "sqitch-log" 4 .IX Item "sqitch-log" Documentation for the \f(CW\*(C`log\*(C'\fR command to the Sqitch command-line client. .IP "sqitch" 4 .IX Item "sqitch" The Sqitch command-line client. .SH "Author" .IX Header "Author" David E. Wheeler .SH "License" .IX Header "License" Copyright (c) 2012\-2014 iovation Inc. .PP Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \*(L"Software\*(R"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: .PP The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. .PP \&\s-1THE SOFTWARE IS PROVIDED \*(L"AS IS\*(R", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\s0