DeploymentHandler/VersionStorage/Deprecated/VersionResultSet.pm

filter: Statementstmt 100% 30 / 30 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 10 / 10 Podpod 100% 3 / 3 totaltotal 100% 43 / 43 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« DeploymentHandler/VersionStorage/Deprecated/VersionResult.pm ↑ Summary DeploymentHandler/VersionStorage/Standard/VersionResultSet.pm »
1 package DBIx::Class::DeploymentHandler::VersionStorage::Deprecated::VersionResultSet;
2 1 $DBIx::Class::DeploymentHandler::VersionStorage::Deprecated::VersionResultSet::VERSION = '0.002235';
3 # ABSTRACT: (DEPRECATED) Predefined searches to find what you want from the version storage
4  
5 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 ▶use parent 'DBIx::Class::ResultSet';
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 ▶use Try::Tiny;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use Time::HiRes 'gettimeofday';
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 2 ▶sub version_storage_is_installed {
Subroutine version_storage_is_installed: called CC=1 SCAR=0.0
Pod documented
14 2 my $self = shift;
15 2 ▶ try { $self->count; 1 } catch { undef }
Subroutine __ANON__: called CC=1 SCAR=0.0
Subroutine __ANON__: called CC=1 SCAR=0.0
16 2 }
17  
18 2 ▶sub database_version {
Subroutine database_version: called CC=1 SCAR=0.0
Pod documented
19 2 my $self = shift;
20 2 $self->search(undef, {
21 order_by => { -desc => 'installed' },
22 rows => 1
23 })->get_column('version')->next;
24 }
25  
26 # this is why it's deprecated guys... Serially.
27 3 ▶sub create {
Subroutine create: called CC=1 SCAR=0.0
Pod documented
28 3 my $self = shift;
29 3 my $args = shift;
30  
31 3 my @tm = gettimeofday();
32 3 my @dt = gmtime ($tm[0]);
33  
34 $self->next::method({
35 3 %{$args},
36 installed => sprintf("v%04d%02d%02d_%02d%02d%02d.%03.0f",
37 $dt[5] + 1900,
38 $dt[4] + 1,
39 $dt[3],
40 $dt[2],
41 $dt[1],
42 $dt[0],
43 $tm[1] / 1000, # convert to millisecs, format as up/down rounded int above
44 ),
45 });
46 }
47  
48 1 1;
49  
50 # vim: ts=2 sw=2 expandtab
51  
52 __END__
« DeploymentHandler/VersionStorage/Deprecated/VersionResult.pm ↑ Summary DeploymentHandler/VersionStorage/Standard/VersionResultSet.pm »