flnews_post_proc 2.05 → 2.08
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/flnews_post_proc +1 -0
- data/changes.txt +27 -0
- data/doc/fr/html/flnews_post_proc.html +81 -7
- data/doc/fr/man/flnews_post_proc.1.gz +0 -0
- data/doc/fr/pdf/flnews_post_proc.pdf +0 -0
- data/doc/fr/rst/flnews_post_proc.rst +54 -3
- data/doc/html/flnews_post_proc.html +22 -2
- data/doc/man/flnews_post_proc.1.gz +0 -0
- data/doc/pdf/flnews_post_proc.pdf +0 -0
- data/doc/rst/flnews_post_proc.rst +15 -0
- data/lib/basic_logging.rb +8 -4
- data/lib/body.rb +9 -2
- data/lib/configuration.rb +1 -1
- data/lib/flnews_post_proc.conf +9 -2
- data/lib/headers.rb +6 -2
- data/lib/newsgroups.rb +6 -2
- data/lib/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2c91b6463159cb90bf142d575d81505c73a93fd978c3c8ea6dd8318edd34a59e
|
|
4
|
+
data.tar.gz: fcc43bbb8fa81b02fcf85ebebc3c89a299659067fa5ea0fb4914fe1fb2014302
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e3ea12979ad3b9230cf41854d0204ba2f443122438dd4b1d2990ca822f578d74dac23c42108607248f6cdb6b70acc40c4f0016ab44e60c93f670e6e07b4b83f6
|
|
7
|
+
data.tar.gz: 1b4463b3048db04aa62e4f6d50dae998303fac7f30f52fd5bb1b93e9315fd784181c8bcc9170c3d14c9ba03beba4064fceb6cb5a907fd4aa6e112f4c23ea8572
|
data/bin/flnews_post_proc
CHANGED
data/changes.txt
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
|
+
V. 2.08
|
|
2
|
+
*) Bugfix: A random signature could not be set due to
|
|
3
|
+
the interfering process of rearranging them in the signature
|
|
4
|
+
file. -> Changed the order of actions.
|
|
5
|
+
*) The gem tool suddenly imposes duplication of the homepage
|
|
6
|
+
URL in the specs. Okay. Done. Beats me.
|
|
7
|
+
|
|
8
|
+
v. 2.07
|
|
9
|
+
*) Logging: exception in case of invalid target file is now handled.
|
|
10
|
+
*) Configuration variable “NAME_POSTPROCESSOR” can be set to true
|
|
11
|
+
or yes in order to create a custom header
|
|
12
|
+
X-Post-Processor: flnews_post_proc [version]
|
|
13
|
+
The default is empty, no or false, i.e. no additional header.
|
|
14
|
+
The setting is independent of the presence of other custom headers
|
|
15
|
+
and cannot be influenced in the Override Dialog, only in the
|
|
16
|
+
configuration file.
|
|
17
|
+
|
|
18
|
+
v. 2.06
|
|
19
|
+
*) The content of the signature file is (again) rearranged after
|
|
20
|
+
having picked a random signature, to provide for better randomness.
|
|
21
|
+
It is not proven that this is better but something must be done.
|
|
22
|
+
|
|
23
|
+
*) Ruby 4.1.0 chokes again at an encoding mismatch, when calling
|
|
24
|
+
Array.join('delimiter') before the encoding is enforced. I have
|
|
25
|
+
forced UTF-8 an all Array elements prior join(). This works now.
|
|
26
|
+
|
|
1
27
|
v.2.05
|
|
2
28
|
*) Gemspec: Dependency for io-console added.
|
|
29
|
+
|
|
3
30
|
v.2.04
|
|
4
31
|
*) Gemspec: Dependencies added
|
|
5
32
|
-) gem New_rfc_2047 was missing from the specs.
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
|
|
83
83
|
<li>
|
|
84
84
|
<p><a class="reference internal" href=
|
|
85
|
-
"#autres-informations" id="toc-entry-7">Autres
|
|
85
|
+
"#autres-informations-1" id="toc-entry-7">Autres
|
|
86
86
|
Informations</a>
|
|
87
87
|
</p>
|
|
88
88
|
|
|
@@ -346,6 +346,24 @@
|
|
|
346
346
|
</li>
|
|
347
347
|
</ul>
|
|
348
348
|
|
|
349
|
+
<p>Il existe une option supplémentaire, désactivée par
|
|
350
|
+
défaut, que vous ne pouvez activer que dans la boîte de
|
|
351
|
+
dialogue et nulle part ailleurs :</p>
|
|
352
|
+
|
|
353
|
+
<ul class="simple">
|
|
354
|
+
<li>
|
|
355
|
+
<p>Le message en cours peut être enregistré comme
|
|
356
|
+
brouillon, au lieu d'être publié sur Usenet.</p>
|
|
357
|
+
</li>
|
|
358
|
+
</ul>
|
|
359
|
+
|
|
360
|
+
<p>Si votre configuration contient le chemin d'accès à un
|
|
361
|
+
répertoire destiné à ces brouillons (option
|
|
362
|
+
<em>DRAFT_DIR</em>), celui-ci sera utilisé pour stocker ces
|
|
363
|
+
brouillons ; sinon, c'est le répertoire temporaire défini
|
|
364
|
+
par la variable d'environnement <em>$TEMP</em> qui sera
|
|
365
|
+
utilisé.</p>
|
|
366
|
+
|
|
349
367
|
<p>En tapant Esc ou en poussant le bouton « Annuler » du
|
|
350
368
|
dialogue, vous pouvez interrompre le processus, flnews ne
|
|
351
369
|
va pas envoyer l'article.</p>
|
|
@@ -517,6 +535,27 @@ alt.fr.test: /home/[utilisateur]/.signatures</pre>
|
|
|
517
535
|
- 'X-Another-Header: care not!'</pre>
|
|
518
536
|
</blockquote>
|
|
519
537
|
|
|
538
|
+
<p><strong>NAME_POSTPROCESSOR</strong>
|
|
539
|
+
</p>
|
|
540
|
+
|
|
541
|
+
<blockquote>
|
|
542
|
+
<p>Si la valeur est "yes" ou "true", ajoute une entête
|
|
543
|
+
"X-Post-Processor" avec le nom et la version du
|
|
544
|
+
programme. Laissez vide ou notez explicitement "no" ou
|
|
545
|
+
"false" afin d'éviter la création de l'entête. Ce réglage
|
|
546
|
+
est indépendant de la présence ou absence d'autres
|
|
547
|
+
entêtes supplémentaires et ne peut pas être manipulé dans
|
|
548
|
+
le dialog graphique avant l'envoi d'un message, seulement
|
|
549
|
+
dans le fichier de configuration.</p>
|
|
550
|
+
|
|
551
|
+
<p>CONTENU : yes, YES, True, no, NO, vide, False et
|
|
552
|
+
variations.</p>
|
|
553
|
+
|
|
554
|
+
<p>PAR DÉFAUT : Vide</p>
|
|
555
|
+
|
|
556
|
+
<p>EXEMPLE : Yes</p>
|
|
557
|
+
</blockquote>
|
|
558
|
+
|
|
520
559
|
<p><strong>NO_ARCHIVE_GROUPS</strong>
|
|
521
560
|
</p>
|
|
522
561
|
|
|
@@ -682,7 +721,7 @@ alt.fr.test: /home/[utilisateur]/.signatures</pre>
|
|
|
682
721
|
|
|
683
722
|
<p>PAR DÉFAUT : yes</p>
|
|
684
723
|
|
|
685
|
-
<p>EXEMPLE: No</p>
|
|
724
|
+
<p>EXEMPLE : No</p>
|
|
686
725
|
</blockquote>
|
|
687
726
|
|
|
688
727
|
<p><strong>USE_OLD</strong>
|
|
@@ -699,14 +738,49 @@ alt.fr.test: /home/[utilisateur]/.signatures</pre>
|
|
|
699
738
|
<p>Ne changez pas cette variable ou notez la valeur
|
|
700
739
|
'false' afin d'ignorer les changements de l'objet.</p>
|
|
701
740
|
|
|
702
|
-
<p>PAR
|
|
741
|
+
<p>PAR DÉFAUT : false</p>
|
|
703
742
|
|
|
704
|
-
<p>EXEMPLE: yes</p>
|
|
743
|
+
<p>EXEMPLE : yes</p>
|
|
744
|
+
</blockquote>
|
|
745
|
+
|
|
746
|
+
<p id="draft-dir"><strong>DRAFT_DIR</strong>
|
|
747
|
+
</p>
|
|
748
|
+
|
|
749
|
+
<blockquote>
|
|
750
|
+
<p>Chemin d'accès au répertoire contenant les brouillons
|
|
751
|
+
de messages.</p>
|
|
752
|
+
|
|
753
|
+
<p>Vous pouvez activer l'option <em>DRAFT_ONLY</em> dans
|
|
754
|
+
la boîte de <cite>Dialogue pour désactiver des
|
|
755
|
+
options</cite>. Le message en cours sera alors enregistré
|
|
756
|
+
dans ce répertoire, <strong>au lieu d'être
|
|
757
|
+
publié</strong> sur Usenet. Si vous ne renseignez pas
|
|
758
|
+
cette option, un répertoire temporaire ($TEMP) sera
|
|
759
|
+
utilisé à la place. Les fichiers de brouillon seront
|
|
760
|
+
nommés selon le schéma suivant :</p>
|
|
761
|
+
|
|
762
|
+
<blockquote>
|
|
763
|
+
<p>[n][1er_groupe][++].draft</p>
|
|
764
|
+
</blockquote>
|
|
765
|
+
|
|
766
|
+
<p>où <em>n</em> correspond au nombre de fichiers dans ce
|
|
767
|
+
répertoire, <em>1er_groupe</em> au premier groupe de
|
|
768
|
+
discussion auquel le message était adressé et <em>++</em>
|
|
769
|
+
à un suffixe facultatif, indiquant qu’il y a d’autres
|
|
770
|
+
groupes de discussion dans la liste (publication
|
|
771
|
+
croisée). Le contenu d’un fichier brouillon correspond au
|
|
772
|
+
corps actuel du message, précédé de la liste des groupes
|
|
773
|
+
de discussion.</p>
|
|
774
|
+
|
|
775
|
+
<p>PAR DÉFAUT : vide</p>
|
|
776
|
+
|
|
777
|
+
<p>EXEMPLE : ~/flnews_brouillons</p>
|
|
705
778
|
</blockquote>
|
|
706
779
|
</section>
|
|
707
780
|
</section>
|
|
708
781
|
|
|
709
|
-
<section id="autres-informations">
|
|
782
|
+
<section id="autres-informations-1">
|
|
783
|
+
<span id="autres-informations"></span>
|
|
710
784
|
<h2>Autres Informations</h2>
|
|
711
785
|
|
|
712
786
|
<section id="changement-de-l-objet-1">
|
|
@@ -908,7 +982,7 @@ alt.fr.test: /home/[utilisateur]/.signatures</pre>
|
|
|
908
982
|
"https://creativecommons.org/licenses/by-nd/4.0/deed.fr">CC
|
|
909
983
|
BY-ND 4.0</a></p>
|
|
910
984
|
|
|
911
|
-
<p>Date: 2026-
|
|
985
|
+
<p>Date: 2026-09-11</p>
|
|
912
986
|
|
|
913
987
|
<p><strong>Ω</strong>
|
|
914
988
|
</p>
|
|
@@ -917,7 +991,7 @@ alt.fr.test: /home/[utilisateur]/.signatures</pre>
|
|
|
917
991
|
</main>
|
|
918
992
|
|
|
919
993
|
<div id='page_dt'>
|
|
920
|
-
2026-
|
|
994
|
+
2026-09-11
|
|
921
995
|
</div>
|
|
922
996
|
</body>
|
|
923
997
|
</html>
|
|
Binary file
|
|
Binary file
|
|
@@ -142,6 +142,15 @@ Vous **ne pouvez pas** activer des options qui n'ont pas été activées au pré
|
|
|
142
142
|
|
|
143
143
|
* L'écriture d'un protocole peut être arrêtée.
|
|
144
144
|
|
|
145
|
+
Il existe une option supplémentaire, désactivée par défaut, que vous ne pouvez activer que dans la boîte de dialogue et nulle part ailleurs :
|
|
146
|
+
|
|
147
|
+
* Le message en cours peut être enregistré comme brouillon, au lieu d'être publié sur Usenet.
|
|
148
|
+
|
|
149
|
+
Si votre configuration contient le chemin d'accès à un répertoire destiné à ces
|
|
150
|
+
brouillons (option *DRAFT_DIR*), celui-ci sera utilisé pour stocker ces
|
|
151
|
+
brouillons ; sinon, c'est le répertoire temporaire défini par la variable
|
|
152
|
+
d'environnement *$TEMP* qui sera utilisé.
|
|
153
|
+
|
|
145
154
|
En tapant Esc ou en poussant le bouton « Annuler » du dialogue, vous pouvez
|
|
146
155
|
interrompre le processus, flnews ne va pas envoyer l'article.
|
|
147
156
|
|
|
@@ -271,6 +280,22 @@ Options de configuration
|
|
|
271
280
|
- 'X-My-Header: nothing fancy'
|
|
272
281
|
- 'X-Another-Header: care not!'
|
|
273
282
|
|
|
283
|
+
**NAME_POSTPROCESSOR**
|
|
284
|
+
|
|
285
|
+
Si la valeur est "yes" ou "true", ajoute une entête "X-Post-Processor" avec
|
|
286
|
+
le nom et la version du programme. Laissez vide ou notez explicitement "no"
|
|
287
|
+
ou "false" afin d'éviter la création de l'entête.
|
|
288
|
+
Ce réglage est indépendant de la présence ou absence d'autres entêtes
|
|
289
|
+
supplémentaires et ne peut pas être manipulé dans le dialog graphique avant
|
|
290
|
+
l'envoi d'un message, seulement dans le fichier de configuration.
|
|
291
|
+
|
|
292
|
+
CONTENU : yes, YES, True, no, NO, vide, False et variations.
|
|
293
|
+
|
|
294
|
+
PAR DÉFAUT : Vide
|
|
295
|
+
|
|
296
|
+
EXEMPLE : Yes
|
|
297
|
+
|
|
298
|
+
|
|
274
299
|
**NO_ARCHIVE_GROUPS**
|
|
275
300
|
|
|
276
301
|
Les newsgroups, où les entêtes « Archive: no » et « X-No-Archive: yes »
|
|
@@ -393,7 +418,7 @@ Options de configuration
|
|
|
393
418
|
|
|
394
419
|
PAR DÉFAUT : yes
|
|
395
420
|
|
|
396
|
-
EXEMPLE: No
|
|
421
|
+
EXEMPLE : No
|
|
397
422
|
|
|
398
423
|
**USE_OLD**
|
|
399
424
|
|
|
@@ -404,10 +429,36 @@ Options de configuration
|
|
|
404
429
|
Ne changez pas cette variable ou notez la valeur 'false' afin d'ignorer
|
|
405
430
|
les changements de l'objet.
|
|
406
431
|
|
|
407
|
-
PAR
|
|
432
|
+
PAR DÉFAUT : false
|
|
433
|
+
|
|
434
|
+
EXEMPLE : yes
|
|
435
|
+
|
|
436
|
+
.. _DRAFT_DIR:
|
|
437
|
+
|
|
438
|
+
**DRAFT_DIR**
|
|
439
|
+
|
|
440
|
+
Chemin d'accès au répertoire contenant les brouillons de messages.
|
|
441
|
+
|
|
442
|
+
Vous pouvez activer l'option *DRAFT_ONLY* dans la boîte de `Dialogue pour
|
|
443
|
+
désactiver des options`. Le message en cours sera alors enregistré dans ce
|
|
444
|
+
répertoire, **au lieu d'être publié** sur Usenet. Si vous ne renseignez pas
|
|
445
|
+
cette option, un répertoire temporaire ($TEMP) sera utilisé à la place. Les
|
|
446
|
+
fichiers de brouillon seront nommés selon le schéma suivant :
|
|
447
|
+
|
|
448
|
+
[n][1er_groupe][++].draft
|
|
449
|
+
|
|
450
|
+
où *n* correspond au nombre de fichiers dans ce répertoire, *1er_groupe* au
|
|
451
|
+
premier groupe de discussion auquel le message était adressé et *++* à un
|
|
452
|
+
suffixe facultatif, indiquant qu’il y a d’autres groupes de discussion dans
|
|
453
|
+
la liste (publication croisée). Le contenu d’un fichier brouillon
|
|
454
|
+
correspond au corps actuel du message, précédé de la liste des groupes de
|
|
455
|
+
discussion.
|
|
456
|
+
|
|
457
|
+
PAR DÉFAUT : vide
|
|
408
458
|
|
|
409
|
-
EXEMPLE:
|
|
459
|
+
EXEMPLE : ~/flnews_brouillons
|
|
410
460
|
|
|
461
|
+
.. _Autres Informations:
|
|
411
462
|
|
|
412
463
|
Autres Informations
|
|
413
464
|
===================
|
|
@@ -485,6 +485,26 @@ comp.*: /home/[user]/.my_sigs</pre>
|
|
|
485
485
|
- 'X-Another-Header: care not!'</pre>
|
|
486
486
|
</blockquote>
|
|
487
487
|
|
|
488
|
+
<p><strong>NAME_POSTPROCESSOR</strong>
|
|
489
|
+
</p>
|
|
490
|
+
|
|
491
|
+
<blockquote>
|
|
492
|
+
<p>Can be used to set a custom header "X-Post-Processor"
|
|
493
|
+
with the name of the program and its current version.
|
|
494
|
+
Leave empty or set to no or false to avoid the creation
|
|
495
|
+
of this header. This setting is independent of the
|
|
496
|
+
presence or absence of other custom headers and cannot be
|
|
497
|
+
manipulated in the Override Dialog, only in the
|
|
498
|
+
configuration file.</p>
|
|
499
|
+
|
|
500
|
+
<p>CONTENT: yes, YES, True, no, NO, empty string, False
|
|
501
|
+
and variations.</p>
|
|
502
|
+
|
|
503
|
+
<p>DEFAULT: Empty</p>
|
|
504
|
+
|
|
505
|
+
<p>EXAMPLE: Yes</p>
|
|
506
|
+
</blockquote>
|
|
507
|
+
|
|
488
508
|
<p><strong>NO_ARCHIVE_GROUPS</strong>
|
|
489
509
|
</p>
|
|
490
510
|
|
|
@@ -866,7 +886,7 @@ comp.*: /home/[user]/.my_sigs</pre>
|
|
|
866
886
|
"https://creativecommons.org/licenses/by-nd/4.0/">CC
|
|
867
887
|
BY-ND 4.0</a></p>
|
|
868
888
|
|
|
869
|
-
<p>Date: 2026-
|
|
889
|
+
<p>Date: 2026-09-18</p>
|
|
870
890
|
</blockquote>
|
|
871
891
|
|
|
872
892
|
<p><strong>Ω</strong>
|
|
@@ -876,7 +896,7 @@ comp.*: /home/[user]/.my_sigs</pre>
|
|
|
876
896
|
</main>
|
|
877
897
|
|
|
878
898
|
<div id='page_dt'>
|
|
879
|
-
2026-
|
|
899
|
+
2026-09-18
|
|
880
900
|
</div>
|
|
881
901
|
</body>
|
|
882
902
|
</html>
|
|
Binary file
|
|
Binary file
|
|
@@ -239,6 +239,21 @@ Configuration Options
|
|
|
239
239
|
- 'X-My-Header: nothing fancy'
|
|
240
240
|
- 'X-Another-Header: care not!'
|
|
241
241
|
|
|
242
|
+
**NAME_POSTPROCESSOR**
|
|
243
|
+
|
|
244
|
+
Can be used to set a custom header "X-Post-Processor" with the name of
|
|
245
|
+
the program and its current version. Leave empty or set to no or false
|
|
246
|
+
to avoid the creation of this header.
|
|
247
|
+
This setting is independent of the presence or absence of other custom
|
|
248
|
+
headers and cannot be manipulated in the Override Dialog, only in the
|
|
249
|
+
configuration file.
|
|
250
|
+
|
|
251
|
+
CONTENT: yes, YES, True, no, NO, empty string, False and variations.
|
|
252
|
+
|
|
253
|
+
DEFAULT: Empty
|
|
254
|
+
|
|
255
|
+
EXAMPLE: Yes
|
|
256
|
+
|
|
242
257
|
**NO_ARCHIVE_GROUPS**
|
|
243
258
|
|
|
244
259
|
Newsgroups where the "Archive: no" and "X-No-Archive: YES" headers should
|
data/lib/basic_logging.rb
CHANGED
|
@@ -26,7 +26,7 @@ module BasicLogging
|
|
|
26
26
|
ERROR = 3
|
|
27
27
|
FATAL = 4
|
|
28
28
|
UNKNOWN = nil
|
|
29
|
-
|
|
29
|
+
|
|
30
30
|
# this is mainly for the translation of method calls into log levels
|
|
31
31
|
Levels = {:debug => DEBUG, :info => INFO, :warn => WARN, :error => ERROR,
|
|
32
32
|
:fatal => FATAL, :unknown => UNKNOWN}
|
|
@@ -34,7 +34,7 @@ module BasicLogging
|
|
|
34
34
|
@@log_level = UNKNOWN
|
|
35
35
|
@@target = STDOUT
|
|
36
36
|
@@muted = []
|
|
37
|
-
|
|
37
|
+
|
|
38
38
|
# do not log, if caller is obj (class or instance)
|
|
39
39
|
def self.mute(obj)
|
|
40
40
|
name = obj.class == Class ? obj.name.dup : obj.class.name
|
|
@@ -72,7 +72,11 @@ module BasicLogging
|
|
|
72
72
|
elsif !tg || tg.respond_to?(:to_str) && tg.strip.empty?
|
|
73
73
|
@@target = nil
|
|
74
74
|
elsif(!File::exist?(tg) || ( File.file?(tg) && File.writable?(tg) ) )
|
|
75
|
-
|
|
75
|
+
begin
|
|
76
|
+
@@target = File.open(tg, 'w+')
|
|
77
|
+
rescue Exception => ex
|
|
78
|
+
$stderr.puts 'Cannot open log target ' << tg << ': ' << ex.message
|
|
79
|
+
end
|
|
76
80
|
else
|
|
77
81
|
STDERR.puts calling_method << ': ERROR : target ' << tg.to_str << ' cannot be set'
|
|
78
82
|
STDERR.puts "Keeping old target " << @@target.inspect
|
|
@@ -157,7 +161,7 @@ module BasicLogging
|
|
|
157
161
|
return 'from main'
|
|
158
162
|
end
|
|
159
163
|
end
|
|
160
|
-
|
|
164
|
+
|
|
161
165
|
# could be useful
|
|
162
166
|
def lock_target(&block)
|
|
163
167
|
begin
|
data/lib/body.rb
CHANGED
|
@@ -209,8 +209,15 @@ class Body
|
|
|
209
209
|
ref_delim = @@config.REFERENCES_DELIMITER
|
|
210
210
|
debug('references delimiter is ' << ref_delim)
|
|
211
211
|
references = Array.new
|
|
212
|
-
# avoids a lot of trouble
|
|
213
|
-
|
|
212
|
+
# avoids a lot of trouble.
|
|
213
|
+
# The encoding must be set before calling join().
|
|
214
|
+
# New in Ruby 4.1.0
|
|
215
|
+
# Should be unneeded, as the encoding is enforced
|
|
216
|
+
# after reading from STDIN.
|
|
217
|
+
@lines.each {|l| l.force_encoding('UTF-8')}
|
|
218
|
+
# ... but still is.
|
|
219
|
+
# -----------------
|
|
220
|
+
body = @lines.join($LN)
|
|
214
221
|
if ref_delim && !ref_delim.strip.empty?
|
|
215
222
|
unless ref_delim == ref_delim.reverse
|
|
216
223
|
ref_delim.strip!
|
data/lib/configuration.rb
CHANGED
|
@@ -28,7 +28,7 @@ class Configuration
|
|
|
28
28
|
|
|
29
29
|
def initialize()
|
|
30
30
|
debug 'Configuration::initialize()'
|
|
31
|
-
confname = PROGNAME << '.conf'
|
|
31
|
+
confname = PROGNAME.dup << '.conf'
|
|
32
32
|
# try to open user-configuration
|
|
33
33
|
@config_file = ENV['HOME'].dup << File::Separator << '.' << confname
|
|
34
34
|
# if user-configuration does not exist, copy installed version.
|
data/lib/flnews_post_proc.conf
CHANGED
|
@@ -82,9 +82,16 @@ GROUP_SIGS:
|
|
|
82
82
|
# DEFAULT: undefined
|
|
83
83
|
# EXAMPLE (two headers):
|
|
84
84
|
# - 'X-My-Header: nothing fancy'
|
|
85
|
-
# - 'X-
|
|
85
|
+
# - 'X-My-Dog: Labcoat Retriever'
|
|
86
86
|
CUSTOM_HEADERS:
|
|
87
|
-
|
|
87
|
+
|
|
88
|
+
# NAME_POSTPROCESSOR
|
|
89
|
+
# If set, creates a custom header with the name of the post processor and its
|
|
90
|
+
# current version. This setting is independent of CUSTOM_HEADERS, above.
|
|
91
|
+
#
|
|
92
|
+
# DEFAULT: no, false or unset
|
|
93
|
+
# EXAMPLE: true
|
|
94
|
+
NAME_POSTPROCESSOR:
|
|
88
95
|
|
|
89
96
|
# NO_ARCHIVE_GROUPS:
|
|
90
97
|
# The newsgroups, where a header X-No-Archive: YES shall be set.
|
data/lib/headers.rb
CHANGED
|
@@ -17,6 +17,7 @@ require 'rfc_2047'
|
|
|
17
17
|
require_relative 'basic_logging'
|
|
18
18
|
require_relative 'configuration'
|
|
19
19
|
require_relative 'newsgroups'
|
|
20
|
+
require_relative 'version'
|
|
20
21
|
|
|
21
22
|
# an object of this class represents the headers of a news-article
|
|
22
23
|
|
|
@@ -139,7 +140,7 @@ class Headers
|
|
|
139
140
|
# Ensure header is ascii only
|
|
140
141
|
if hv.ascii_only? && hn.ascii_only?
|
|
141
142
|
# <---------- special treatment Post-Processor ---------->
|
|
142
|
-
hv << ' ' << PROGVERSION.to_s if hn == 'X-Post-Processor' && hv == 'flnews_post_proc'
|
|
143
|
+
# hv << ' ' << PROGVERSION.to_s if hn == 'X-Post-Processor' && hv == 'flnews_post_proc'
|
|
143
144
|
# >----------<
|
|
144
145
|
@headers[hn.to_sym] = hv
|
|
145
146
|
else
|
|
@@ -149,8 +150,11 @@ class Headers
|
|
|
149
150
|
end
|
|
150
151
|
@headers[hn.to_sym] = hv
|
|
151
152
|
end
|
|
152
|
-
@headers.compact!
|
|
153
153
|
end
|
|
154
|
+
if @config.NAME_POSTPROCESSOR
|
|
155
|
+
@headers["X-Post-Processor".to_sym] = PROGNAME.dup << ' ' << PROGVERSION.to_s
|
|
156
|
+
end
|
|
157
|
+
@headers.compact!
|
|
154
158
|
debug('updated headers are ' << @headers.inspect)
|
|
155
159
|
end
|
|
156
160
|
|
data/lib/newsgroups.rb
CHANGED
|
@@ -120,6 +120,7 @@ class Newsgroups
|
|
|
120
120
|
end # gsigs.each
|
|
121
121
|
end # gsigs for group?
|
|
122
122
|
if tsig && tsig.rstrip.start_with?('/')
|
|
123
|
+
debug 'trying to pick a random signature'
|
|
123
124
|
tsig = pick_sig(tsig.strip)
|
|
124
125
|
end
|
|
125
126
|
@signature = correct_linebreaks(tsig) if tsig
|
|
@@ -147,6 +148,7 @@ class Newsgroups
|
|
|
147
148
|
if(psrc )
|
|
148
149
|
psrc = psrc[1]
|
|
149
150
|
if File.exist?(psrc) && File.readable?(psrc)
|
|
151
|
+
debug 'reading signature file'
|
|
150
152
|
ssigs = File.read(psrc).split(delim)
|
|
151
153
|
else
|
|
152
154
|
warn 'cannot find or read sourced signature file: ' << psrc
|
|
@@ -165,7 +167,10 @@ class Newsgroups
|
|
|
165
167
|
|
|
166
168
|
# srand(Time.now.nsec)
|
|
167
169
|
srand()
|
|
168
|
-
|
|
170
|
+
psig = all_sigs[rand(numSigs)]
|
|
171
|
+
debug "HAVE a signature: \n\t" << (psig ? psig : ' N I L ')
|
|
172
|
+
rearrange_sigs(sigfile, all_sigs)
|
|
173
|
+
return psig
|
|
169
174
|
else
|
|
170
175
|
warn 'cannot find or read signature file: ' << sigfile
|
|
171
176
|
end
|
|
@@ -174,7 +179,6 @@ class Newsgroups
|
|
|
174
179
|
|
|
175
180
|
# write a new rearranged version of the signature file for
|
|
176
181
|
# better hazard.
|
|
177
|
-
# UNUSED
|
|
178
182
|
def rearrange_sigs(sigfile, all_sigs)
|
|
179
183
|
if File.writable?(sigfile)
|
|
180
184
|
new_sigs = Array.new(all_sigs.length)
|
data/lib/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: flnews_post_proc
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: '2.
|
|
4
|
+
version: '2.08'
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Michael Uplawski
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-
|
|
10
|
+
date: 2026-09-20 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: diffy
|
|
@@ -119,6 +119,7 @@ files:
|
|
|
119
119
|
- lib/override.rb
|
|
120
120
|
- lib/ruby_dlg
|
|
121
121
|
- lib/version.rb
|
|
122
|
+
homepage: https://www.uplawski.eu/software/flnews_post_proc/
|
|
122
123
|
licenses:
|
|
123
124
|
- WTFPL
|
|
124
125
|
metadata:
|
|
@@ -139,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
139
140
|
- !ruby/object:Gem::Version
|
|
140
141
|
version: '0'
|
|
141
142
|
requirements: []
|
|
142
|
-
rubygems_version: 4.0.
|
|
143
|
+
rubygems_version: 4.0.20
|
|
143
144
|
specification_version: 4
|
|
144
145
|
summary: Modify news posts, before flnews sends them.
|
|
145
146
|
test_files: []
|