Skip to content

Commit

Permalink
Checking in changes prior to tagging of version 0.04_02. Changelog di…
Browse files Browse the repository at this point in the history
…ff is:
  • Loading branch information
dann committed Sep 30, 2008
1 parent c6ba90d commit 0d73b54
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 15 deletions.
5 changes: 5 additions & 0 deletions 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

Expand Down
5 changes: 3 additions & 2 deletions META.yml
Expand Up @@ -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
Expand All @@ -32,4 +33,4 @@ requires:
Term::ReadLine: 0
YAML: 0
namespace::clean: 0
version: 0.04_01
version: 0.04_02
3 changes: 2 additions & 1 deletion Makefile.PL
Expand Up @@ -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
/
);
Expand Down
14 changes: 11 additions & 3 deletions lib/Shell/Amazon/S3.pm
Expand Up @@ -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';

Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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 ;
}
Expand All @@ -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
Expand Down
5 changes: 2 additions & 3 deletions lib/Shell/Amazon/S3/Command.pm
Expand Up @@ -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;
}
);

Expand Down Expand Up @@ -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},
Expand Down
6 changes: 4 additions & 2 deletions lib/Shell/Amazon/S3/Command/quit.pm
Expand Up @@ -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;
9 changes: 6 additions & 3 deletions lib/Shell/Amazon/S3/CommandDispatcher.pm
@@ -1,15 +1,18 @@
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' => (
is => 'ro',
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;
Expand Down
2 changes: 1 addition & 1 deletion 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',
Expand Down
6 changes: 6 additions & 0 deletions script/psh3ll.pl
Expand Up @@ -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]
Expand Down

0 comments on commit 0d73b54

Please sign in to comment.