Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Checking in changes prior to tagging of version 0.04_02. Changelog di…

…ff is:
  • Loading branch information...
commit 0d73b544ee56a06778331fd9716b076220f67b82 1 parent c6ba90d
@dann authored
View
5 Changes
@@ -1,5 +1,10 @@
Revision history for Perl extension Shell::Amazon::S3
+0.04_02 Tue Sep 30 1:50:03 2008
+ * removed MooseX::Singleton because it doesn't work well with lates Moose.
+ * changed setup_api method to class method
+ * use Module::Pluggable::Object to load classes
+
0.04_01 Tue Jun 29 21:50:03 2008
* Made developer release to change API
View
5 META.yml
@@ -16,14 +16,15 @@ no_index:
- inc
- t
requires:
+ Class::MOP: 0
File::HomeDir: 0
File::Slurp: 0
Module::Find: 0
+ Module::Pluggable::Object: 0
Moose: 0
Moose::Role: 0
MooseX::ClassAttribute: 0
MooseX::Object::Pluggable: 0
- MooseX::Singleton: 0
Net::Amazon::S3: 0
Path::Class: 0
Perl6::Say: 0
@@ -32,4 +33,4 @@ requires:
Term::ReadLine: 0
YAML: 0
namespace::clean: 0
-version: 0.04_01
+version: 0.04_02
View
3  Makefile.PL
@@ -16,10 +16,11 @@ requires $_
Term::ReadLine
YAML
namespace::clean
+ Class::MOP
Moose
Moose::Role
MooseX::ClassAttribute
- MooseX::Singleton
+ Module::Pluggable::Object
MooseX::Object::Pluggable
/
);
View
14 lib/Shell/Amazon/S3.pm
@@ -6,7 +6,7 @@ use Shell::Amazon::S3::CommandDispatcher;
use Shell::Amazon::S3::ConfigLoader;
use Perl6::Say;
-our $VERSION = '0.04_01';
+our $VERSION = '0.04_02';
with 'MooseX::Object::Pluggable';
@@ -52,7 +52,7 @@ sub setup {
sub setup_config {
my ($self) = @_;
- my $config_loader = Shell::Amazon::S3::ConfigLoader->instance;
+ my $config_loader = Shell::Amazon::S3::ConfigLoader->new;
$config_loader->load;
}
@@ -112,7 +112,7 @@ sub print {
}
sub show_banner {
- say "Welcome to pSh3ll (Amazon S3 command shell for Perl) (c) 2008 Dann.";
+ say "Welcome to pSh3ll (Amazon S3 command shell for Perl) (c) 2008 Takatoshi Kitano.";
say "Type 'help' for command list.";
say ;
}
@@ -129,6 +129,14 @@ Shell::Amazon::S3 - Shell for Amazon S3
use Shell::Amazon::S3;
+ my $shell = Shell::Amazon::S3->new;
+ $shell->load_plugins($_) for qw(ReadLineHistory Completion);
+ $shell->run;
+
+Alternatively, use the 'psh3ll.pl' script installed with the distribution
+
+ system$ psh3ll.pl
+
=head1 DESCRIPTION
Shell::Amazon::S3 is Shell for Amazon S3
View
5 lib/Shell/Amazon/S3/Command.pm
@@ -6,9 +6,8 @@ use Shell::Amazon::S3::ConfigLoader;
class_has 'api_' => (
is => 'rw',
- required => 1,
default => sub {
- shift->setup_api;
+ Shell::Amazon::S3::Command->setup_api;
}
);
@@ -73,7 +72,7 @@ sub bucket {
sub setup_api {
my $self = shift;
- my $config_loader = Shell::Amazon::S3::ConfigLoader->instance;
+ my $config_loader = Shell::Amazon::S3::ConfigLoader->new;
my $config = $config_loader->load;
my $api = Net::Amazon::S3->new(
{ aws_access_key_id => $config->{aws_access_key_id},
View
6 lib/Shell/Amazon/S3/Command/quit.pm
@@ -3,14 +3,16 @@ use Moose;
extends 'Shell::Amazon::S3::Command';
-sub parse_tokens {
+override 'parse_tokens', sub {
my ($self, $token) = @_;
return $token;
-}
+};
sub execute {
my ($self, $args) = @_;
return 'EXIT';
}
+__PACKAGE__->meta->make_immutable;
+
1;
View
9 lib/Shell/Amazon/S3/CommandDispatcher.pm
@@ -1,6 +1,7 @@
package Shell::Amazon::S3::CommandDispatcher;
use Moose;
-use Module::Find;
+use Module::Pluggable::Object;
+use Class::MOP;
use Shell::Amazon::S3::Utils;
has 'dispatch_table' => (
@@ -8,8 +9,10 @@ has 'dispatch_table' => (
isa => 'HashRef',
required => 1,
default => sub {
- my @commands = usesub Shell::Amazon::S3::Command;
- #require $_ for @commands;
+ my $finder = Module::Pluggable::Object->new(
+ search_path => 'Shell::Amazon::S3::Command', );
+ my @commands = $finder->plugins;
+ Class::MOP::load_class($_) for @commands;
my %table
= map { Shell::Amazon::S3::Utils->classsuffix($_) => $_->new }
@commands;
View
2  lib/Shell/Amazon/S3/ConfigLoader.pm
@@ -1,9 +1,9 @@
package Shell::Amazon::S3::ConfigLoader;
+use Moose;
use YAML;
use File::HomeDir;
use Path::Class qw(file);
use ExtUtils::MakeMaker ();
-use MooseX::Singleton;
has 'changed' => (
is => 'rw',
View
6 script/psh3ll.pl
@@ -23,6 +23,12 @@ =head1 NAME
psh3ll.pl - Amazon S3 command shell for Perl
=head1 SYNOPSIS
+
+You need to setup aws key and secret key after run pSh3ll.pl.
+These configuration is stored in ~/.psh3ll.
+
+After configuring AWS settings, you can use psh3ll.
+you can use commands with psh3ll.The commands are listed as below:
bucket [bucketname]
count [prefix]
Please sign in to comment.
Something went wrong with that request. Please try again.