flnews_post_proc 1.99 → 2.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4206610148fccb0ab85d83b2bedaff817e605dd49e3663cb0babdf049000540b
4
- data.tar.gz: aaf86ad30791ec939152a97a421e0cf472e8ef5673b8894ef4f3b52f5c851075
3
+ metadata.gz: f9d2ff5d6f33555a5059614972dcd6f01920b1a7274662509154e7092db9ca22
4
+ data.tar.gz: 9a75540a2daf3b02cd91d2a11f8087a8ddeabc1ccea42be76af23127e0bd9d06
5
5
  SHA512:
6
- metadata.gz: 31f0fbb0c85a852e339f65e7103d48a4f031ac08ed5437216c328d3ce488722ca0e501bbbfed52da50e53305940d2260194371c8204427b0ba0de1dafd10ae07
7
- data.tar.gz: 113daca4745e8cbf88fd62f85628e0626d53b0d2b49da5931ee1baf47a4b0e58f467b4b38c7266b372aeda45be76a4445b247fe0d08257762c90209259009ca1
6
+ metadata.gz: 78e67d90fbacd419f0b7d543bb4ea66ea6c06440b6eff215159462f725eef8eb736db604587aa1980929c1f9a65b64fd37ded814735398a84784125acc700da4
7
+ data.tar.gz: 45cec798380b42fd1b795a90c3dfd712a9b5f09da94ef592eb0123f9ec615204849781454ca50c386319edbbe280dab10a613e5c358fe2fb605891400a8c5163
data/changelog.txt CHANGED
@@ -1,10 +1,13 @@
1
+ v.2.0
2
+ *) Supersedes will have a new signature by default
3
+ *) Obsolete code for Yad and Zenity dialogs removed.
1
4
  v 1.99
2
5
  *) Bugfix: The value of a custom header can include a colon.
3
- Example: x-my-header: apples: 2,90€, peers: 3,10
4
- (before, the value would have been clipped after the first ':')
6
+ Example: x-my-header: apples: 2,90, peers: 3,10
7
+ (before, the value would have been clipped after the first ':')
5
8
  v 1.98
6
- *) New change log (this file)
7
- *) In the configuration file, log levels can be in upper case.
9
+ *) New change log (this file)
10
+ *) In the configuration file, log levels can be in upper case.
8
11
  v 1.97
9
- *) Custom headers are RFC 2047 encoded, if need be.
10
- (before, they had to be ASCII only or were discarded).
12
+ *) Custom headers are RFC 2047 encoded, if need be.
13
+ (before, they had to be ASCII only or were discarded).
@@ -366,15 +366,15 @@
366
366
 
367
367
  <ul class="simple">
368
368
  <li>
369
- <p>Variables qui décrivent des valeurs déterminées par
370
- flnews. Elles peuvent être utilisées ou remplacées. Les
371
- composants importants sont normalement spécifiés dans une
372
- « capture group ».</p>
369
+ <p>Deux variables qui décrivent des valeurs déterminées
370
+ par flnews. Elles peuvent être utilisées ou remplacées.
371
+ Les composants importants sont normalement spécifiés dans
372
+ une « capture group ».</p>
373
373
  </li>
374
374
 
375
375
  <li>
376
- <p>Variables qui définissent du nouveau contenu ou des
377
- changements dans le contenu.</p>
376
+ <p>La grande majorité des variables définissent du
377
+ nouveau contenu ou des changements dans le contenu.</p>
378
378
  </li>
379
379
  </ul>
380
380
 
@@ -897,7 +897,7 @@ alt.fr.test: /home/[utilisateur]/.signatures</pre>
897
897
  "https://creativecommons.org/licenses/by-nd/4.0/deed.fr">CC
898
898
  BY-ND 4.0</a></p>
899
899
 
900
- <p>Date: 2026-06-09</p>
900
+ <p>Date: 2026-06-30</p>
901
901
 
902
902
  <p><strong>Ω</strong>
903
903
  </p>
@@ -906,7 +906,7 @@ alt.fr.test: /home/[utilisateur]/.signatures</pre>
906
906
  </main>
907
907
 
908
908
  <div id='page_dt'>
909
- 2026-06-09
909
+ 2026-06-30
910
910
  </div>
911
911
  </body>
912
912
  </html>
Binary file
Binary file
@@ -155,12 +155,12 @@ prochaine occasion, mais vos modifications seront perdues.
155
155
  Le fichier de `configuration`_ est en format YAML et plein d'explications. Les
156
156
  variables définies dans ce fichier peuvent être classées en deux catégories :
157
157
 
158
- * Variables qui décrivent des valeurs déterminées par flnews. Elles peuvent être
159
- utilisées ou remplacées. Les composants importants sont normalement spécifiés
160
- dans une « capture group ».
158
+ * Deux variables qui décrivent des valeurs déterminées par flnews. Elles
159
+ peuvent être utilisées ou remplacées. Les composants importants sont
160
+ normalement spécifiés dans une « capture group ».
161
161
 
162
- * Variables qui définissent du nouveau contenu ou des changements dans le
163
- contenu.
162
+ * La grande majorité des variables définissent du nouveau contenu ou des
163
+ changements dans le contenu.
164
164
 
165
165
  Options de configuration
166
166
  ------------------------
@@ -334,13 +334,14 @@
334
334
 
335
335
  <ol class="arabic simple">
336
336
  <li>
337
- <p>Variables that represent values originally set by
338
- flnews, which can be used or replaced. These elements
339
- are typically captured using regular expressions.</p>
337
+ <p>Two variables that represent values originally set
338
+ by flnews, which can be used or replaced. These
339
+ elements are typically captured using regular
340
+ expressions.</p>
340
341
  </li>
341
342
 
342
343
  <li>
343
- <p>Variables that define new or modified content.</p>
344
+ <p>Most variables define new or modified content.</p>
344
345
  </li>
345
346
  </ol>
346
347
  </blockquote>
@@ -800,7 +801,7 @@ comp.*: /home/[user]/.my_sigs</pre>
800
801
  "https://creativecommons.org/licenses/by-nd/4.0/">CC
801
802
  BY-ND 4.0</a></p>
802
803
 
803
- <p>Date: 2026-06-19</p>
804
+ <p>Date: 2026-07-16</p>
804
805
  </blockquote>
805
806
 
806
807
  <p><strong>Ω</strong>
@@ -810,7 +811,7 @@ comp.*: /home/[user]/.my_sigs</pre>
810
811
  </main>
811
812
 
812
813
  <div id='page_dt'>
813
- 2026-06-19
814
+ 2026-07-16
814
815
  </div>
815
816
  </body>
816
817
  </html>
Binary file
Binary file
@@ -135,11 +135,11 @@ CONFIGURATION
135
135
  The configuration file uses YAML syntax and includes detailed explanations. The
136
136
  variables within it fall into two categories:
137
137
 
138
- 1. Variables that represent values originally set by flnews, which can be used
139
- or replaced. These elements are typically captured using regular
140
- expressions.
138
+ 1. Two variables that represent values originally set by flnews, which can be
139
+ used or replaced. These elements are typically captured using regular
140
+ expressions.
141
141
 
142
- 2. Variables that define new or modified content.
142
+ 2. Most variables define new or modified content.
143
143
 
144
144
  Configuration Options
145
145
  -------------------------------
data/lib/body.rb CHANGED
@@ -151,23 +151,18 @@ class Body
151
151
  end
152
152
 
153
153
  def set_signature(signature)
154
- unless @@config.SUPERSEDES
155
- debug 'is not a supersedes'
156
- # unless no changes requested.
157
- debug 'signature is ' << (signature ? signature.to_s : 'NIL')
158
- if signature && !signature.empty?
159
- # remove any signature(s) from
160
- # the current article
161
- sigpos = @lines.index('-- ')
162
- debug('found signature in line ' << sigpos.to_s) if sigpos
163
- @lines = @lines.slice(0, sigpos ) if sigpos
164
- debug('setting signature ' << signature) if signature
165
- @lines << "-- " << signature if signature
166
- else
167
- debug 'signature is ' << (signature ? signature.to_s : 'not set.' )
168
- end
154
+ # unless no changes requested.
155
+ debug 'signature is ' << (signature ? signature.to_s : 'NIL')
156
+ if signature && !signature.empty?
157
+ # remove any signature(s) from
158
+ # the current article
159
+ sigpos = @lines.index('-- ')
160
+ debug('found signature in line ' << sigpos.to_s) if sigpos
161
+ @lines = @lines.slice(0, sigpos ) if sigpos
162
+ debug('setting signature ' << signature) if signature
163
+ @lines << "-- " << signature if signature
169
164
  else
170
- debug 'ignoring signature in spersedes'
165
+ debug 'signature is ' << (signature ? signature.to_s : 'not set.' )
171
166
  end
172
167
  end
173
168
 
@@ -268,26 +263,11 @@ class Body
268
263
  refs << num << r << $LN
269
264
  end
270
265
 
271
- # a previously set signature must stay intact
272
- # in a supersedes.
273
- # Either insert the references ...
274
- sigpos = body.index('-- ')
275
- if @@config.SUPERSEDES && sigpos
276
- debug 'inserting references'
277
- # a line, separating the footnotes from the body of the article
278
- body.insert(sigpos, $LN.dup << @@config.REFERENCES_SEPARATOR.strip << $LN)
279
- # move the position lower than the separator
280
- sigpos = body.index('-- ')
281
- body.insert(sigpos, refs)
282
- else
283
- # ... or append references.
284
- debug 'appending references'
285
- # a line, separating the footnotes from the body of the article
286
- body << $LN << @@config.REFERENCES_SEPARATOR.strip << $LN
287
- body << refs
288
- end
289
-
290
-
266
+ # append references.
267
+ debug 'appending references'
268
+ # a line, separating the footnotes from the body of the article
269
+ body << $LN << @@config.REFERENCES_SEPARATOR.strip << $LN
270
+ body << refs
291
271
  else
292
272
  debug('no refences found')
293
273
  end
data/lib/newsgroups.rb CHANGED
@@ -29,9 +29,7 @@ class Newsgroups
29
29
 
30
30
  # set details for this post
31
31
  if @groups.size == 1
32
- debug 'supersedes is ' << @config.SUPERSEDES.to_s
33
- debug 'Signature will ' << (@config.SUPERSEDES ? 'NOT ' : '') << 'be set'
34
- set_signature if !@config.SUPERSEDES
32
+ set_signature
35
33
  set_intro
36
34
  set_no_archive
37
35
  end
data/lib/override.rb CHANGED
@@ -30,13 +30,10 @@ class OverrideDlg
30
30
  XTERM = 'xterm'
31
31
  # TERMINAL = 'x-terminal-emulator'
32
32
  WHIPTAIL = 'whiptail'
33
- YAD = 'yad'
34
- ZENITY = 'zenity'
35
33
  # The external programs which are supported for the time. They will be run in
36
34
  # a new process (IO.popen() ). The first program from this array, which is
37
35
  # found in the Path, will be used. Whiptail and a pure ruby dialog
38
36
  # necessitate that xterm be found, too.
39
- # @@Executables = [YAD, ZENITY, WHIPTAIL, XTERM]
40
37
  @@Executables = [WHIPTAIL, XTERM]
41
38
  @@LIBDIR = File::dirname(__FILE__)
42
39
  # The configuration variables that can be unset.
@@ -70,13 +67,6 @@ class OverrideDlg
70
67
  debug('found executables ' << @executables.join(', '))
71
68
  opts = nil
72
69
  begin
73
- =begin unresolved issues with YAD and Zenity
74
- if has?(YAD)
75
- return yad_dlg.split.collect {|o| o.to_s}.join(' ')
76
- elsif has?(ZENITY)
77
- return zenity_dlg.split.collect {|o| o.to_s}.join(' ')
78
- elsif has? XTERM
79
- =end
80
70
  if has? XTERM
81
71
  if has?(WHIPTAIL)
82
72
  return whiptail_dlg.split.collect {|o| o.to_s}.join(' ')
@@ -172,36 +162,6 @@ class OverrideDlg
172
162
  tf.unlink
173
163
  return nopts
174
164
  end
175
-
176
- # creates a Zenity dialog.
177
- def zenity_dlg
178
- debug('Zenity dialog')
179
- # dialog = @config.BINDIR << File::Separator << 'zenity_dlg'
180
- dialog = @@LIBDIR << File::Separator << 'zenity_dlg'
181
- io = IO.popen(dialog)
182
- Process::wait(io.pid)
183
- rc = $?.exitstatus
184
-
185
- exit true if rc != 0
186
-
187
- nopts = io.read
188
- return nopts
189
- end
190
-
191
- # creates a YAD dialog.
192
- def yad_dlg
193
- debug('yad dialog')
194
- # dialog = @config.BINDIR << File::Separator << 'yad_dlg'
195
- dialog = @@LIBDIR << File::Separator << 'yad_dlg'
196
- debug('dialog will be ' << dialog)
197
- io = IO::popen(dialog)
198
- Process::wait(io.pid)
199
- exit true if $?.exitstatus != 0
200
-
201
- nopts = io.read
202
- return nopts
203
- end
204
-
205
165
  end
206
166
 
207
167
  # EOF
data/lib/version.rb CHANGED
@@ -14,7 +14,7 @@
14
14
  =end
15
15
 
16
16
  PROGNAME = 'flnews_post_proc'
17
- PROGVERSION = "1.99"
17
+ PROGVERSION = "2.0"
18
18
  AUTHORS = "Michael Uplawski"
19
19
  EMAIL = "michael.uplawski@uplawski.eu"
20
20
  YEARS = "2023 - 2026"
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: '1.99'
4
+ version: '2.0'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Uplawski
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2026-06-30 00:00:00.000000000 Z
10
+ date: 2026-07-28 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: diffy
@@ -68,7 +68,6 @@ files:
68
68
  - doc/man/flnews_post_proc.1.gz
69
69
  - doc/pdf/flnews_post_proc.pdf
70
70
  - doc/rst/flnews_post_proc.rst
71
- - lib/_quoting_style_regexp
72
71
  - lib/basic_logging.rb
73
72
  - lib/body.rb
74
73
  - lib/color_output.rb
@@ -81,8 +80,6 @@ files:
81
80
  - lib/ruby_dlg
82
81
  - lib/version.rb
83
82
  - lib/whiptail_dlg
84
- - lib/yad_dlg
85
- - lib/zenity_dlg
86
83
  licenses:
87
84
  - WTFPL
88
85
  metadata:
@@ -103,7 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
100
  - !ruby/object:Gem::Version
104
101
  version: '0'
105
102
  requirements: []
106
- rubygems_version: 4.0.14
103
+ rubygems_version: 4.0.16
107
104
  specification_version: 4
108
105
  summary: Modify news posts, before flnews sends them.
109
106
  test_files: []
@@ -1,2 +0,0 @@
1
- # UNUSED
2
- " > >> > testerei ei ei".strip.gsub( /^>+(\s+>+)*/) {|m| m.to_s.delete(" ")}
data/lib/yad_dlg DELETED
@@ -1,57 +0,0 @@
1
- #!/bin/bash
2
-
3
- #/**************************************************************************
4
- #* This program is free software; you can redistribute it and/or modify *
5
- #* it under the terms of the WTFPL 2.0 or later, see *
6
- #* http://www.wtfpl.net/about/ *
7
- #* *
8
- #* This program is distributed in the hope that it will be useful, *
9
- #* but WITHOUT ANY WARRANTY; without even the implied warranty of *
10
- #* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
11
- #* *
12
- #***************************************************************************/
13
-
14
- # A dialog to override configuration options
15
-
16
- TITLE="Override post-processor configuration"
17
- # These are the configuration variables which can be
18
- # unset.
19
- GROUP_SIGS=1
20
- CUSTOM_HEADERS=2
21
- NO_ARCHIVE_GROUPS=3
22
- #VFY_URLS=4
23
- DEBUG_LOG=4
24
-
25
- CONF=$(yad --item-separator=" " --title "$TITLE" --image="" --window-icon="" --form \
26
- --field="Uncheck to disable options\n<b>Esc and Cancel</b> terminate the post-processor.":LBL ""\
27
- --field="Signature":CHK 'true' \
28
- --field="Custom-headers":CHK 'true' \
29
- --field="No Archive":CHK 'true' \
30
- --field="URL Correction":CHK 'true' \
31
- --field="Log":CHK 'true' )
32
-
33
-
34
- if [ $? == 0 ]
35
- then
36
- IFS="|"
37
- read -ra C_ARR <<< $CONF
38
- echo "$C_ARR"
39
- CONF=''
40
- # ------------->
41
- # echo ${C_ARR[@]}
42
- # <-------------
43
-
44
- for i in GROUP_SIGS CUSTOM_HEADERS NO_ARCHIVE_GROUPS VFY_URLS DEBUG_LOG
45
- do
46
- echo -e "$i: ${C_ARR[$i]}"
47
- echo -e "\n"
48
- if [ 'FALSE' == "${C_ARR[$i]}" ]
49
- then
50
- CONF="$i $CONF"
51
- fi
52
- done
53
- # signal the fields to disable (others will be ignored)
54
- echo $CONF
55
- else
56
- exit 1
57
- fi
data/lib/zenity_dlg DELETED
@@ -1,60 +0,0 @@
1
- #!/bin/bash
2
-
3
- #/**************************************************************************
4
- #* This program is free software; you can redistribute it and/or modify *
5
- #* it under the terms of the WTFPL 2.0 or later, see *
6
- #* http://www.wtfpl.net/about/ *
7
- #* *
8
- #* This program is distributed in the hope that it will be useful, *
9
- #* but WITHOUT ANY WARRANTY; without even the implied warranty of *
10
- #* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
11
- #* *
12
- #***************************************************************************/
13
-
14
- # A dialog to override configuration options
15
-
16
- TITLE="Override post-processor configuration"
17
- # The options are the configuration variables which can be unset.
18
-
19
- CONF=$(zenity --title "$TITLE" --text "Deselect options to disable.\n<b>Esc and Cancel</b> terminate the post-processor."\
20
- --height 450 --list --checklist --column 'set' --column 'Option' --column '' \
21
- TRUE GROUP_SIGS Signature\
22
- TRUE CUSTOM_HEADERS "Custom Headers"\
23
- TRUE NO_ARCHIVE_GROUPS "No Archive"\
24
- TRUE VFY_URLS "Correct URLs"\
25
- TRUE DEBUG_LOG Log)
26
-
27
- if [ $? == 0 ]
28
- then
29
- IFS="|"
30
- read -ra C_ARR <<< $CONF
31
- CONF=''
32
- # ------------->
33
- # echo ${C_ARR[@]}
34
- # <-------------
35
-
36
- # for c in GROUP_SIGS CUSTOM_HEADERS NO_ARCHIVE_GROUPS VFY_URLS DEBUG_LOG
37
- for c in GROUP_SIGS CUSTOM_HEADERS NO_ARCHIVE_GROUPS DEBUG_LOG
38
- do
39
- # disable only the options which are missing in
40
- # the Zenity return value
41
- disable=1
42
-
43
- for o in "${C_ARR[@]}"
44
- do
45
- if [ "$o" == "$c" ]
46
- then
47
- disable=
48
- fi
49
- done
50
-
51
- if [ $disable ]
52
- then
53
- CONF="$CONF $c"
54
- fi
55
- done
56
- # signal the fields to disable (others will be ignored)
57
- echo $CONF
58
- else
59
- exit 1
60
- fi