File tree 1 file changed +12
-2
lines changed
1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ require 'bundler/setup'
7
7
require 'fileutils'
8
8
require 'html2rss'
9
9
require 'html2rss/configs'
10
- require 'html2rss/configs/helper'
11
10
require 'uri'
12
11
require 'yaml'
13
12
@@ -19,6 +18,17 @@ rescue StandardError
19
18
false
20
19
end
21
20
21
+ def string_formatting_references ( string )
22
+ string . to_s . scan ( /%[{<](\w +)[>}](\w )?/ ) . to_h . transform_values do |value |
23
+ case value
24
+ when 'i' , 'd' , 'u'
25
+ Numeric
26
+ else
27
+ String
28
+ end
29
+ end
30
+ end
31
+
22
32
output = file_names . map do |file_name |
23
33
config = YAML . safe_load ( File . open ( file_name ) , symbolize_names : false )
24
34
@@ -28,7 +38,7 @@ output = file_names.map do |file_name|
28
38
'domain' => file_name_splits [ -2 ..-2 ] . join ,
29
39
'name' => File . basename ( file_name_splits [ -1 ..] . join , '.*' ) ,
30
40
'valid_channel_url' => valid_url ( config [ 'channel' ] [ 'url' ] ) ,
31
- 'url_parameters' => Html2rss :: Configs :: Helper . string_formatting_references ( config [ 'channel' ] [ 'url' ] ) ,
41
+ 'url_parameters' => string_formatting_references ( config [ 'channel' ] [ 'url' ] ) ,
32
42
'channel' => config [ 'channel' ]
33
43
}
34
44
end
You can’t perform that action at this time.
0 commit comments