/[transports]/trunk/lib/Transports/Bootstrap.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /trunk/lib/Transports/Bootstrap.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 10 - (show annotations)
Fri May 5 21:18:58 2006 UTC (18 years ago) by dpavlin
File size: 719 byte(s)
create just one user, and two sources and destinations
1 use warnings;
2 use strict;
3
4 package Transports::Bootstrap;
5 use base qw(Jifty::Bootstrap);
6
7 =head1 Bootstrap application data
8
9 Create initial data
10
11 =cut
12
13 sub run {
14 my $self = shift;
15
16 my $system_user = Transports::CurrentUser->superuser;
17
18 my $u = Transports::Model::User->new(current_user => $system_user);
19
20 $u->create(
21 name => 'System administrator',
22 email => 'admin@example.com',
23 password => 'admin',
24 );
25
26 my $s = Transports::Model::Source->new(current_user => $system_user);
27 $s->create(
28 name => 'SRC/1',
29 );
30 $s->create(
31 name => 'SRC/2',
32 );
33
34 my $d = Transports::Model::Destination->new(current_user => $system_user);
35 $d->create(
36 name => 'DEST/1',
37 );
38 $d->create(
39 name => 'DEST/2',
40 );
41 }
42
43
44 1;

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26