From 7ebcd29044492b365b180c8caeba253af5b59255 Mon Sep 17 00:00:00 2001 From: dakkar Date: Wed, 22 Feb 2017 16:05:17 +0000 Subject: presentation --- .gitmodules | 6 ++ docs/presentation/css | 1 + docs/presentation/css2 | 1 + docs/presentation/highlight.js | 1 + docs/presentation/js | 1 + docs/presentation/lib | 1 + docs/presentation/plugin | 1 + docs/presentation/reveal.js | 1 + docs/presentation/sietima.html | 221 +++++++++++++++++++++++++++++++++++++++++ 9 files changed, 234 insertions(+) create mode 100644 .gitmodules create mode 120000 docs/presentation/css create mode 120000 docs/presentation/css2 create mode 160000 docs/presentation/highlight.js create mode 120000 docs/presentation/js create mode 120000 docs/presentation/lib create mode 120000 docs/presentation/plugin create mode 160000 docs/presentation/reveal.js create mode 100644 docs/presentation/sietima.html diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..7020267 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule "docs/presentation/reveal.js"] + path = docs/presentation/reveal.js + url = git@github.com:hakimel/reveal.js.git +[submodule "docs/presentation/highlight.js"] + path = docs/presentation/highlight.js + url = git@github.com:isagalaev/highlight.js.git diff --git a/docs/presentation/css b/docs/presentation/css new file mode 120000 index 0000000..e95a0e7 --- /dev/null +++ b/docs/presentation/css @@ -0,0 +1 @@ +reveal.js/css \ No newline at end of file diff --git a/docs/presentation/css2 b/docs/presentation/css2 new file mode 120000 index 0000000..0ca84e4 --- /dev/null +++ b/docs/presentation/css2 @@ -0,0 +1 @@ +highlight.js/src/styles \ No newline at end of file diff --git a/docs/presentation/highlight.js b/docs/presentation/highlight.js new file mode 160000 index 0000000..ac3f2db --- /dev/null +++ b/docs/presentation/highlight.js @@ -0,0 +1 @@ +Subproject commit ac3f2db5e434f6344d226d57d7e49290201696ca diff --git a/docs/presentation/js b/docs/presentation/js new file mode 120000 index 0000000..ebce293 --- /dev/null +++ b/docs/presentation/js @@ -0,0 +1 @@ +reveal.js/js \ No newline at end of file diff --git a/docs/presentation/lib b/docs/presentation/lib new file mode 120000 index 0000000..892bcc7 --- /dev/null +++ b/docs/presentation/lib @@ -0,0 +1 @@ +reveal.js/lib \ No newline at end of file diff --git a/docs/presentation/plugin b/docs/presentation/plugin new file mode 120000 index 0000000..426257b --- /dev/null +++ b/docs/presentation/plugin @@ -0,0 +1 @@ +reveal.js/plugin \ No newline at end of file diff --git a/docs/presentation/reveal.js b/docs/presentation/reveal.js new file mode 160000 index 0000000..a349ff4 --- /dev/null +++ b/docs/presentation/reveal.js @@ -0,0 +1 @@ +Subproject commit a349ff43c58c23f9c837b8ea9b5fc7d4761b8de3 diff --git a/docs/presentation/sietima.html b/docs/presentation/sietima.html new file mode 100644 index 0000000..6b82e72 --- /dev/null +++ b/docs/presentation/sietima.html @@ -0,0 +1,221 @@ + + + + + + + Sietima — a minimalist MLM + + +
+
+
+

Sietima — a minimalist MLM

+

Author: dakkar <dakkar@thenautilus.net>

+

Date: 2016-08-08

+
+
+

A bit of history

+
+

Siesta

+ +
+
+

written in 2003

+
+
+

14 years ago

+
+
+

Class::DBI

+

no Moo

+

Perl 5.8

+ +
+
+
+

Plugin style

+
+

simple base class

+

+sub handle_mail($self,$incoming_mail) {
+ my (@outgoing_messages) = $self->munge_mail($incoming_mail);
+ for my $outgoing_message (@outgoing_messages) {
+  $self->send_message($outgoing_message);
+ }
+ return;
+}
+            
+
+
+

provide all the needed extensions points

+

+sub munge_mail($self,$incoming_mail) {
+ return Sietima::Message->new({
+  mail => $incoming_mail,
+  from => $self->return_path,
+  to => $self->subscribers_to_send_to($incoming_mail),
+ });
+}
+            
+
+
+

but no more than that

+
+
+

traits / roles

+
    +
  • AvoidDups
  • +
  • Debounce
  • +
  • Headers
  • +
  • ManualSubscription
  • +
  • NoMail
  • +
  • ReplyTo
  • +
  • SubjectTag
  • +
  • SubscriberOnly::Drop
  • +
  • SubscriberOnly::Moderate
  • +
+
+
+

try to avoid cross-trait dependencies

+

«ReplyTo needs WithPostAddress» is fine

+

but «SubscriberOnly::Moderate should be added after Debounce» is not

+

sadly I couldn't avoid it, suggestions welcome

+
+
+
+

Driver

+
+

App::Spec

+
+
+

minimal spec in base class

+

+sub command_line_spec($self) {
+ return {
+  name => 'sietima',
+  title => 'a simple mailing list manager',
+  subcommands => {
+   send => {
+    op => 'handle_mail_from_stdin',
+    summary => 'send email from STDIN',
+   },
+  },
+ };
+}
+            
+
+
+

enriched by plugins

+

+around command_line_spec => sub ($orig,$self) {
+ my $spec = $self->$orig();
+
+ my $list_mail_ids = sub ($self,$runner,$args) {
+  $self->mail_store->retrieve_ids_by_tags('moderation');
+ };
+
+ my $with_mail_id = sub($cmd) { return (
+  summary => "$cmd the given mail, currently held for moderation",
+  parameters => [ {
+   name => 'mail-id', required => 1,
+   summary => "id of the mail to $cmd",
+   completion => { op => $list_mail_ids },
+  } ],
+ ) };
+
+ $spec->{subcommands}{'list-held'} = {
+  op => 'list_mails_in_moderation_queue',
+  summary => 'list all mails currently held for moderation',
+ };
+ $spec->{subcommands}{'show-held'} = {
+  op => 'show_mail_from_moderation_queue',
+  $with_mail_id->('show'),
+ };
+ $spec->{subcommands}{'resume-held'} = {
+  op => sub ($self,$runner,$args) {
+   $self->resume($runner->parameters->{'mail-id'});
+  },
+  $with_mail_id->('resume'),
+ };
+ $spec->{subcommands}{'drop-held'} = {
+  op => sub ($self,$runner,$args) {
+   $self->drop($runner->parameters->{'mail-id'});
+  },
+  $with_mail_id->('drop'),
+ };
+
+ return $spec;
+};
+            
+
+
+

+$ sietima-test <TAB>
+drop-held   -- drop the given mail, currently held for moderation
+help        -- Show command help
+list-held   -- list all mails currently held for moderation
+resume-held -- resume the given mail, currently held for moderation
+send        -- send email from STDIN
+show-held   -- show the given mail, currently held for moderation
+            
+
+
+

+$ sietima-test resume-held <TAB>
+0f0571203ef5ee2f786b7f7f2832093ed4c34fe8
+4d43ee7a2a17457606c07475b14054839fad9b7e
+            
+
+
+
+

Production ready!

+
+

all my lists now run with Sietima

+
+
+

coming soon to a CPAN near you

+
+
+
+

CPAN is awesome

+
+

Email::*, RJBS

+
+
+

Moo, MST + HAARG

+

Type::Tiny, TOBYINK

+
+
+

App::Spec, TINITA

+
+
+

Test2, EXODIST

+
+
+
+

Thank you

+
+
+
+ + + + + -- cgit v1.2.3