diff --git a/README.md b/README.md index 221b20d..e4c5186 100644 --- a/README.md +++ b/README.md @@ -32,8 +32,6 @@ Run the tests locally (against development environment): ## TODOs -1. Implement - [bcrypt](https://metacpan.org/pod/Mojolicious::Plugin::BcryptSecure) 1. Some sort of admin/moderator login and view 1. CSS diff --git a/lib/PostText.pm b/lib/PostText.pm index 30361d6..659c301 100644 --- a/lib/PostText.pm +++ b/lib/PostText.pm @@ -48,6 +48,8 @@ sub startup($self) { $self->asset->process('main.css', 'css/PostText.css'); + push @{$self->commands->namespaces}, 'PostText::Command'; + # Begin routing my $r = $self->routes->under(sub ($c) { $c->session(expires => time + 31536000); diff --git a/lib/PostText/Command/bcrypt.pm b/lib/PostText/Command/bcrypt.pm new file mode 100644 index 0000000..2128ea8 --- /dev/null +++ b/lib/PostText/Command/bcrypt.pm @@ -0,0 +1,18 @@ +package PostText::Command::bcrypt; + +use Mojo::Base 'Mojolicious::Command', -signatures; + +has description => 'Hash a string with brcypt'; +has usage => sub ($self) { $self->extract_usage }; + +sub run($self, @args) { + say $self->app->bcrypt($_) for @args; +} + +1; + +=head1 SYNOPSIS + + Usage: APPLICATION bcrypt STRING(S) + +=cut