aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2017-03-16 19:12:27 +0000
committerdakkar <dakkar@thenautilus.net>2017-03-16 19:12:27 +0000
commit5dd624746164999e812fb2648fea1991c0f3e8e1 (patch)
treeff218ce686ca58ee78c4750229cbd6bf82122648
parentv1.0.0 (diff)
downloadSietima-5dd624746164999e812fb2648fea1991c0f3e8e1.tar.gz
Sietima-5dd624746164999e812fb2648fea1991c0f3e8e1.tar.bz2
Sietima-5dd624746164999e812fb2648fea1991c0f3e8e1.zip
updated presentation
-rw-r--r--docs/presentation/sietima.html104
1 files changed, 44 insertions, 60 deletions
diff --git a/docs/presentation/sietima.html b/docs/presentation/sietima.html
index 6b82e72..3f032f9 100644
--- a/docs/presentation/sietima.html
+++ b/docs/presentation/sietima.html
@@ -3,6 +3,15 @@
<link rel="stylesheet" href="css/reveal.css">
<link rel="stylesheet" href="css/theme/white.css" id="theme">
<link rel="stylesheet" href="css2/github-gist.css">
+ <style type="text/css">
+ .reveal kbd {
+ font-size: 0.8em;
+ padding: 0.1em;
+ border: outset 0.2em #888;
+ background-color: #AAA;
+ color: #EEE;
+ }
+ </style>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Sietima — a minimalist MLM</title>
</head>
@@ -31,7 +40,7 @@
</section>
<section>
<p><code>Class::DBI</code></p>
- <p class="fragment">no <code>Moo</code></p>
+ <p class="fragment">no <code>Moo(?:se)?</code></p>
<p class="fragment">Perl 5.8</p>
<aside class="notes">
<p>Surely things have got better!</p>
@@ -43,27 +52,23 @@
<h2>Plugin style</h2>
<section>
<p>simple base class</p>
- <pre><code class="perl">
-sub handle_mail($self,$incoming_mail) {
+ <pre><code class="perl">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;
-}
- </code></pre>
+}</code></pre>
</section>
<section>
<p>provide all the needed extensions points</p>
- <pre><code class="perl">
-sub munge_mail($self,$incoming_mail) {
+ <pre><code class="perl">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),
});
-}
- </code></pre>
+}</code></pre>
</section>
<section>
<p>but no more than that</p>
@@ -84,9 +89,21 @@ sub munge_mail($self,$incoming_mail) {
</section>
<section>
<p>try to avoid cross-trait dependencies</p>
- <p class="fragment">«<code>ReplyTo</code> needs <code>WithPostAddress</code>» is fine</p>
- <p class="fragment">but «<code>SubscriberOnly::Moderate</code> should be added after <code>Debounce</code>» is not</p>
- <p class="fragment">sadly I couldn't avoid it, suggestions welcome</p>
+ <p class="fragment">«<code>ReplyTo</code>
+ needs <code>WithPostAddress</code>» is fine</p>
+ <p class="fragment">but
+ «<code>SubscriberOnly::Moderate</code> should be added
+ after <code>Debounce</code>» is not</p>
+ <p class="fragment">sadly I couldn't avoid it, suggestions
+ welcome</p>
+ <aside class="notes">
+ <p>Debounce adds a X-Been-Here header; if that happens
+ before the message is put into moderation, when the
+ message comes out it will be dropped because it was
+ already seen!</p>
+ <p>Adding the header after the moderation happens is
+ fine</p>
+ </aside>
</section>
</section>
<section>
@@ -96,8 +113,7 @@ sub munge_mail($self,$incoming_mail) {
</section>
<section>
<p>minimal spec in base class</p>
- <pre><code class="perl">
-sub command_line_spec($self) {
+ <pre><code class="perl">sub command_line_spec($self) {
return {
name => 'sietima',
title => 'a simple mailing list manager',
@@ -108,70 +124,38 @@ sub command_line_spec($self) {
},
},
};
-}
- </code></pre>
+}</code></pre>
</section>
<section>
<p>enriched by plugins</p>
- <pre><code class="perl">
-around command_line_spec => sub ($orig,$self) {
+ <pre><code class="perl">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",
+ $spec->{subcommands}{'show-held'} = {
+ op => 'show_mail_from_moderation_queue',
parameters => [ {
name => 'mail-id', required => 1,
- summary => "id of the mail to $cmd",
- completion => { op => $list_mail_ids },
+ completion => { op => sub ($self,$runner,$args) {
+ $self->mail_store->retrieve_ids_by_tags('moderation');
+ } },
} ],
- ) };
-
- $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'),
};
-
+ # etc etc
return $spec;
-};
- </code></pre>
+};</code></pre>
</section>
<section>
- <pre><code class="shell" data-noescape>
-$ sietima-test <span style="color:blue">&lt;TAB&gt;</span>
+ <pre>$ sietima-test <kbd>TAB</kbd>
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
- </code></pre>
+show-held -- show the given mail, currently held for moderation</pre>
</section>
<section>
- <pre><code class="shell" data-noescape>
-$ sietima-test resume-held <span style="color:blue">&lt;TAB&gt;</span>
+ <pre>$ sietima-test show-held <kbd>TAB</kbd>
0f0571203ef5ee2f786b7f7f2832093ed4c34fe8
-4d43ee7a2a17457606c07475b14054839fad9b7e
- </code></pre>
+4d43ee7a2a17457606c07475b14054839fad9b7e</pre>
</section>
</section>
<section>
@@ -180,7 +164,7 @@ $ sietima-test resume-held <span style="color:blue">&lt;TAB&gt;</span>
<p>all my lists now run with Sietima</p>
</section>
<section>
- <p>coming soon to a CPAN near you</p>
+ <p>on CPAN now</p>
</section>
</section>
<section>