Created
December 1, 2011 01:36
-
-
Save ejhayes/1412615 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub versions { | |
my ($s) = @_; | |
# get a summary of the actions for this build (in some cases all versions will be the same) | |
my $sth = BS::db::action->db_Main->prepare(<<SQL); | |
select max(action_id) from actions where build_id = ? group by branch_id, revision, storm_branch_id, storm_revision, build_id; | |
SQL | |
$sth->execute($s->id); | |
return BS::db::action->sth_to_objects($sth); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% | |
# version information | |
my ($status) = join '', map { $_->branch->name . $_->revision } $build->versions; | |
$Response->Write("<li>$a</li>"); | |
%> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi -
That would be:
my ($status) = map { $_->branch->name . $_->revision } $build->versions;
Or:
my $status = join '', map { $_->branch->name, $_->revision } $build->versions;
Also, variables '
$a
' and '$b
' are considered magical, since they are autovivified insort BLOCK
expressions likemy @sorted_by_name = sort { $a->name cmp $b->name } @list