flnews_post_proc 1.60 → 1.61
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 +38 -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: 6c60c975baf641f5c274cff05a5ecdff1094e998f4eb2d0c7bfe63eceeac557a
|
|
4
|
+
data.tar.gz: 6067e8967e3a53695042fb02d734a48caed986051d4018b130309b1fd118bad3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 45e83b86f0a72db2207b32039eabfedc188fff497be932f61dd2a48c9e8a3014e7da176ba0f08fb1705ae40a9aeb2263bd91ebbf2958c142501ede3545a06786
|
|
7
|
+
data.tar.gz: 9dd48b6f5cbd5f940c39a537a00dc7576f85702fefce4859ac6e4020f8e7e7db9856b371db54174f20455c6f68798d8950d9d4b36a8e1530efc5786de2d68817
|
data/bin/flnews_post_proc
CHANGED
|
@@ -64,46 +64,52 @@ 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
|
+
warn ("Input is of wrong mime-type " << mime.split(';')[0])
|
|
76
|
+
if (['javascript'].any? {|m| mime.start_with?('application/' << m)} )
|
|
77
|
+
warn 'Input contains java-script code! Continuing anyway'
|
|
78
|
+
else
|
|
79
|
+
warn 'Cannot continue, aporting!'
|
|
80
|
+
exit false;
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
#----------->
|
|
84
|
+
# Allow to override the configuration,
|
|
85
|
+
# if not disabled (default is true)
|
|
86
|
+
if config.OVERRIDE_CONFIG != false
|
|
87
|
+
cdlg = OverrideDlg.new
|
|
88
|
+
discarded = cdlg.show
|
|
89
|
+
if discarded && !discarded.empty?
|
|
90
|
+
debug('options overriden ' << discarded)
|
|
91
|
+
OverrideDlg.cvars.each do |v|
|
|
92
|
+
if discarded.include?(v.to_s)
|
|
93
|
+
debug('removing ' << v.to_s)
|
|
94
|
+
config.set(v, nil)
|
|
87
95
|
end
|
|
88
96
|
end
|
|
89
|
-
debug('new config: ' << config.inspect)
|
|
90
97
|
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)
|
|
98
|
+
debug('new config: ' << config.inspect)
|
|
99
|
+
end
|
|
100
|
+
#<--------------
|
|
101
|
+
# Do it:
|
|
102
|
+
pp = PostProcessor.new(artext)
|
|
103
|
+
# and get a result.
|
|
104
|
+
article = pp.article
|
|
105
|
+
if article
|
|
106
|
+
# -------------> The main objective <------
|
|
107
|
+
puts article
|
|
108
|
+
# <------------- over and out ------>
|
|
109
|
+
exit true
|
|
106
110
|
end
|
|
111
|
+
# whatever.
|
|
112
|
+
exit false
|
|
107
113
|
else
|
|
108
114
|
error( "Cannot read the article, no content" )
|
|
109
115
|
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.61"
|
|
18
18
|
AUTHORS = "Michael Uplawski"
|
|
19
19
|
EMAIL = "michael.uplawski@uplawski.eu"
|
|
20
20
|
YEARS = "2023 - 2024"
|
|
21
|
-
SUMMARY = "
|
|
21
|
+
SUMMARY = "attenuated reaction to mime-type check: Accept JavaScript code"
|
|
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.61'
|
|
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-05 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: 'attenuated reaction to mime-type check: Accept JavaScript code'
|
|
109
109
|
test_files: []
|