Skip to content

Commit 238bf8b

Browse files
committed
fix(build): data-update depends on a removed dependency's helper method
1 parent b79341e commit 238bf8b

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

bin/data-update

+12-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ require 'bundler/setup'
77
require 'fileutils'
88
require 'html2rss'
99
require 'html2rss/configs'
10-
require 'html2rss/configs/helper'
1110
require 'uri'
1211
require 'yaml'
1312

@@ -19,6 +18,17 @@ rescue StandardError
1918
false
2019
end
2120

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+
2232
output = file_names.map do |file_name|
2333
config = YAML.safe_load(File.open(file_name), symbolize_names: false)
2434

@@ -28,7 +38,7 @@ output = file_names.map do |file_name|
2838
'domain' => file_name_splits[-2..-2].join,
2939
'name' => File.basename(file_name_splits[-1..].join, '.*'),
3040
'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']),
3242
'channel' => config['channel']
3343
}
3444
end

0 commit comments

Comments
 (0)