File: Meta.pm

package info (click to toggle)
libur-perl 0.470%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 7,192 kB
  • sloc: perl: 61,814; javascript: 255; xml: 108; sh: 13; makefile: 9
file content (29 lines) | stat: -rw-r--r-- 689 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package Vending::DataSource::Meta;

use warnings;
use strict;

use UR;

class Vending::DataSource::Meta {
    is => [ 'UR::DataSource::Meta' ],
};

# Don't print out warnings about loading up the DB if running in the test harness
# Similar code exists in URT::DataSource::SomeSQLite
sub _dont_emit_initializing_messages {
    my($dsobj, $message) = @_;

    if ($message =~ m/^Re-creating/) {
        # don't emit the message about re-creating the DB when run in the test harness
        $_[1] = undef;
    }
}

if ($ENV{'HARNESS_ACTIVE'}) {
    # don't emit messages while running in the test harness
    __PACKAGE__->warning_messages_callback(\&_dont_emit_initializing_messages);
}


1;