Permalink
Browse files

first working empty application stub

  • Loading branch information...
1 parent 176d305 commit a4f21a1d50c9be934137335cb1e0a00a11716d93 @xdg xdg committed Dec 6, 2011
Showing with 88 additions and 6 deletions.
  1. +15 −4 META.json
  2. +2 −1 bin/pantry
  3. +0 −1 lib/Pantry.pm
  4. +16 −0 lib/Pantry/App.pm
  5. +26 −0 lib/Pantry/App/Command.pm
  6. +29 −0 lib/Pantry/App/Command/init.pm
View
@@ -32,25 +32,36 @@
},
"runtime" : {
"requires" : {
- "Pantry::App" : 0,
- "autodie" : "2.00",
+ "App::Cmd::Setup" : "0.311",
"perl" : "v5.14.0",
- "strict" : 0,
"warnings" : 0
}
},
"test" : {
"requires" : {
"File::Find" : 0,
"File::Temp" : 0,
- "Test::More" : 0
+ "Test::More" : 0,
+ "strict" : 0
}
}
},
"provides" : {
"Pantry" : {
"file" : "lib/Pantry.pm",
"version" : "0.001"
+ },
+ "Pantry::App" : {
+ "file" : "lib/Pantry/App.pm",
+ "version" : "0.001"
+ },
+ "Pantry::App::Command" : {
+ "file" : "lib/Pantry/App/Command.pm",
+ "version" : "0.001"
+ },
+ "Pantry::App::Command::init" : {
+ "file" : "lib/Pantry/App/Command/init.pm",
+ "version" : "0.001"
}
},
"release_status" : "stable",
View
@@ -1,13 +1,14 @@
#!perl
use v5.14;
use warnings;
+
package pantry;
# ABSTRACT: Manage resources for chef-solo
# PODNAME: pantry
# VERSION
use Pantry::App;
-Pantry->run;
+Pantry::App->run;
# Pod for this file is generated from the pod/ directory in the source
# repository using the 'AppendExternalData' dzil plugin
View
@@ -1,5 +1,4 @@
use v5.14;
-use strict;
use warnings;
package Pantry;
View
@@ -0,0 +1,16 @@
+use v5.14;
+use warnings;
+
+package Pantry::App;
+# ABSTRACT: Internal pantry application class
+# VERSION
+
+use App::Cmd::Setup 0.311 -app;
+
+sub global_opt_spec { # none yet, so just an empty stub
+ return;
+}
+
+1;
+
+# vim: ts=2 sts=2 sw=2 et:
View
@@ -0,0 +1,26 @@
+use v5.14;
+use warnings;
+
+package Pantry::App::Command;
+# ABSTRACT: Implements common command options
+# VERSION
+
+use App::Cmd::Setup -command;
+
+sub opt_spec {
+ my ($class, $app) = @_;
+ return (
+ [ 'help' => "This usage screen" ],
+ $class->options($app),
+ )
+}
+
+sub validate_args {
+ my ( $self, $opt, $args ) = @_;
+ die $self->_usage_text if $opt->{help};
+ $self->validate( $opt, $args );
+}
+
+1;
+
+# vim: ts=2 sts=2 sw=2 et:
@@ -0,0 +1,29 @@
+use v5.14;
+use warnings;
+
+package Pantry::App::Command::init;
+# ABSTRACT: Implements pantry init subcommand
+# VERSION
+
+use Pantry::App -command;
+
+sub abstract {
+ return 'initialize a pantry in the current directory';
+}
+
+sub options {
+ return;
+}
+
+sub validate {
+ return;
+}
+
+sub execute {
+ my ($self, $opt, $args) = @_;
+
+}
+
+1;
+
+# vim: ts=2 sts=2 sw=2 et:

0 comments on commit a4f21a1

Please sign in to comment.