flnews_post_proc 1.60 → 1.62
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/flnews_post_proc +46 -32
- data/lib/version.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 06e2f2f46c1d30f65062366e6b02d4e3b84eb21f6e65d1e746ab54b5d964e13a
|
4
|
+
data.tar.gz: 6ab18c57da83155d698b57f0544063e12d1a218eb4da89ac816cc70dcb980da6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a5e692db21786d8689c8b4f2d90a7f7997acc8b1e0561265d36ff46e69bb0ae38ae63cdea1dafebeb09c881aa760c34cec758af9b243b54f483361236ebcbe6
|
7
|
+
data.tar.gz: 2526a34226e03405cd773599964e762437bbc07210b2aa5cdba760001fa0cccef58f2c16e4e8e9d4c0741d1da290a4416a1850249b0768e4bd6844d62279cbfd
|
data/bin/flnews_post_proc
CHANGED
@@ -64,46 +64,60 @@ if (!STDIN.tty?)
|
|
64
64
|
# read from STDIN
|
65
65
|
artext = ARGF.read
|
66
66
|
|
67
|
-
|
67
|
+
# There is content, create the post-processor.
|
68
68
|
if !artext.strip.empty?
|
69
69
|
# Be sure to know what you are doing.
|
70
70
|
# Ask around in case of doubt.
|
71
71
|
mime = FileMagic.mime.buffer artext
|
72
|
-
debug('mime is ' << mime)
|
73
|
-
if ['news', 'rfc822'].
|
74
|
-
|
75
|
-
#
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
72
|
+
debug('mime is ' << mime.split(';')[0])
|
73
|
+
if (['news', 'rfc822'].none? {|m| mime.start_with?('message/' << m) } )
|
74
|
+
# Not a pure news message
|
75
|
+
# Add more reactions, as you stumble upon them ...
|
76
|
+
warn ("Input is of wrong mime-type " << mime.split(';')[0])
|
77
|
+
|
78
|
+
# Javascript okay
|
79
|
+
if (['javascript'].any? {|m| mime.start_with?('application/' << m)} )
|
80
|
+
warn 'Input contains java-script code!'
|
81
|
+
# C okay
|
82
|
+
elsif(['x-c'].any? {|m| mime.start_with?('text/' << m)} )
|
83
|
+
warn 'Input contains C- or C++ code!'
|
84
|
+
# Ruby okay
|
85
|
+
elsif(['x-ruby'].any? {|m| mime.start_with?('text/' << m) })
|
86
|
+
warn 'Input contains Ruby-code!'
|
87
|
+
else
|
88
|
+
warn 'Input contains other things than plain-text, but I cannot say, what.'
|
89
|
+
end
|
90
|
+
end
|
91
|
+
#----------->
|
92
|
+
# Allow to override the configuration,
|
93
|
+
# if not disabled (default is true)
|
94
|
+
if config.OVERRIDE_CONFIG != false
|
95
|
+
cdlg = OverrideDlg.new
|
96
|
+
discarded = cdlg.show
|
97
|
+
if discarded && !discarded.empty?
|
98
|
+
debug('options overriden ' << discarded)
|
99
|
+
OverrideDlg.cvars.each do |v|
|
100
|
+
if discarded.include?(v.to_s)
|
101
|
+
debug('removing ' << v.to_s)
|
102
|
+
config.set(v, nil)
|
87
103
|
end
|
88
104
|
end
|
89
|
-
debug('new config: ' << config.inspect)
|
90
105
|
end
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
exit false
|
104
|
-
else
|
105
|
-
error ("Input is of wrong mime-type " << mime)
|
106
|
+
debug('new config: ' << config.inspect)
|
107
|
+
end
|
108
|
+
#<--------------
|
109
|
+
# Do it:
|
110
|
+
pp = PostProcessor.new(artext)
|
111
|
+
# and get a result.
|
112
|
+
article = pp.article
|
113
|
+
if article
|
114
|
+
# -------------> The main objective <------
|
115
|
+
puts article
|
116
|
+
# <------------- over and out ------>
|
117
|
+
exit true
|
106
118
|
end
|
119
|
+
# whatever.
|
120
|
+
exit false
|
107
121
|
else
|
108
122
|
error( "Cannot read the article, no content" )
|
109
123
|
end
|
data/lib/version.rb
CHANGED
@@ -14,9 +14,9 @@
|
|
14
14
|
=end
|
15
15
|
|
16
16
|
PROGNAME = 'flnews_post_proc'
|
17
|
-
PROGVERSION = "1.
|
17
|
+
PROGVERSION = "1.62"
|
18
18
|
AUTHORS = "Michael Uplawski"
|
19
19
|
EMAIL = "michael.uplawski@uplawski.eu"
|
20
20
|
YEARS = "2023 - 2024"
|
21
|
-
SUMMARY = "
|
21
|
+
SUMMARY = "Further attenuated reaction to mime-type, accepting all."
|
22
22
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flnews_post_proc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '1.
|
4
|
+
version: '1.62'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Uplawski
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-09-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: diffy
|
@@ -105,5 +105,5 @@ requirements: []
|
|
105
105
|
rubygems_version: 3.5.3
|
106
106
|
signing_key:
|
107
107
|
specification_version: 4
|
108
|
-
summary:
|
108
|
+
summary: Further attenuated reaction to mime-type, accepting all.
|
109
109
|
test_files: []
|