[Bps-public-commit] r10189 - bpsbuilder/BPB/lib/BPB/Script

sunnavy at bestpractical.com sunnavy at bestpractical.com
Sun Dec 30 04:29:42 EST 2007


Author: sunnavy
Date: Sun Dec 30 04:29:41 2007
New Revision: 10189

Added:
   bpsbuilder/BPB/lib/BPB/Script/Maintain.pm

Log:
bpb maintian -n name --update-order to update order

Added: bpsbuilder/BPB/lib/BPB/Script/Maintain.pm
==============================================================================
--- (empty file)
+++ bpsbuilder/BPB/lib/BPB/Script/Maintain.pm	Sun Dec 30 04:29:41 2007
@@ -0,0 +1,70 @@
+package BPB::Script::Maintain;
+
+use strict;
+use warnings;
+use Carp;
+
+use base qw/App::CLI::Command Class::Accessor::Fast/;
+__PACKAGE__->mk_accessors(qw/config name update_order/);
+
+use BPB;
+use BPB::Config;
+
+sub options {
+    (
+        'c|config=s'     => 'config',
+        'n|name=s'       => 'name',
+        'update-order'  => 'update_order',
+    );
+}
+
+sub run {
+    my $self   = shift;
+    my $source = shift;
+
+    $self->source($source) if $source;
+
+    for (qw/name/) {
+        die "need $_ arg" unless $self->$_();
+    }
+
+    my $bpb = BPB->new(
+        config => $self->config,
+        name   => $self->name,
+    );
+
+    if ( $self->update_order ) {
+        $bpb->backend->update_order;
+    }
+}
+
+
+1;
+
+__END__
+
+=head1 NAME
+
+BPB::Script::Maintain - maintain a project
+
+=head1 SYNOPSIS
+
+  bpb maintain --update-order        update the order
+
+ Options:
+   --config(-c)       specify which config.yml we'll use
+   --name(-n)         specify the project's name
+   --update-order     update the build order
+
+=head1 AUTHOR
+
+sunnavy  C<< <sunnavy at bestpractical.com> >>
+
+
+=head1 LICENCE AND COPYRIGHT
+
+Copyright 2007 Best Practical Solutions.
+
+This program is free software; you can redistribute it and/or modify it
+under the same terms as Perl itself.
+



More information about the Bps-public-commit mailing list