Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/AnonR/anonr.TX.../opt/alt/ruby27/share/ruby/rss
File: syndication.rb
# frozen_string_literal: false
[0] Fix | Delete
require "rss/1.0"
[1] Fix | Delete
[2] Fix | Delete
module RSS
[3] Fix | Delete
# The prefix for the Syndication XML namespace.
[4] Fix | Delete
SY_PREFIX = 'sy'
[5] Fix | Delete
# The URI of the Syndication specification.
[6] Fix | Delete
SY_URI = "http://purl.org/rss/1.0/modules/syndication/"
[7] Fix | Delete
[8] Fix | Delete
RDF.install_ns(SY_PREFIX, SY_URI)
[9] Fix | Delete
[10] Fix | Delete
module SyndicationModel
[11] Fix | Delete
[12] Fix | Delete
extend BaseModel
[13] Fix | Delete
[14] Fix | Delete
ELEMENTS = []
[15] Fix | Delete
[16] Fix | Delete
def self.append_features(klass)
[17] Fix | Delete
super
[18] Fix | Delete
[19] Fix | Delete
klass.install_must_call_validator(SY_PREFIX, SY_URI)
[20] Fix | Delete
klass.module_eval do
[21] Fix | Delete
[
[22] Fix | Delete
["updatePeriod"],
[23] Fix | Delete
["updateFrequency", :positive_integer]
[24] Fix | Delete
].each do |name, type|
[25] Fix | Delete
install_text_element(name, SY_URI, "?",
[26] Fix | Delete
"#{SY_PREFIX}_#{name}", type,
[27] Fix | Delete
"#{SY_PREFIX}:#{name}")
[28] Fix | Delete
end
[29] Fix | Delete
[30] Fix | Delete
%w(updateBase).each do |name|
[31] Fix | Delete
install_date_element(name, SY_URI, "?",
[32] Fix | Delete
"#{SY_PREFIX}_#{name}", 'w3cdtf',
[33] Fix | Delete
"#{SY_PREFIX}:#{name}")
[34] Fix | Delete
end
[35] Fix | Delete
end
[36] Fix | Delete
[37] Fix | Delete
klass.module_eval(<<-EOC, __FILE__, __LINE__ + 1)
[38] Fix | Delete
alias_method(:_sy_updatePeriod=, :sy_updatePeriod=)
[39] Fix | Delete
def sy_updatePeriod=(new_value)
[40] Fix | Delete
new_value = new_value.strip
[41] Fix | Delete
validate_sy_updatePeriod(new_value) if @do_validate
[42] Fix | Delete
self._sy_updatePeriod = new_value
[43] Fix | Delete
end
[44] Fix | Delete
EOC
[45] Fix | Delete
end
[46] Fix | Delete
[47] Fix | Delete
private
[48] Fix | Delete
SY_UPDATEPERIOD_AVAILABLE_VALUES = %w(hourly daily weekly monthly yearly)
[49] Fix | Delete
def validate_sy_updatePeriod(value) # :nodoc:
[50] Fix | Delete
unless SY_UPDATEPERIOD_AVAILABLE_VALUES.include?(value)
[51] Fix | Delete
raise NotAvailableValueError.new("updatePeriod", value)
[52] Fix | Delete
end
[53] Fix | Delete
end
[54] Fix | Delete
end
[55] Fix | Delete
[56] Fix | Delete
class RDF
[57] Fix | Delete
class Channel; include SyndicationModel; end
[58] Fix | Delete
end
[59] Fix | Delete
[60] Fix | Delete
prefix_size = SY_PREFIX.size + 1
[61] Fix | Delete
SyndicationModel::ELEMENTS.uniq!
[62] Fix | Delete
SyndicationModel::ELEMENTS.each do |full_name|
[63] Fix | Delete
name = full_name[prefix_size..-1]
[64] Fix | Delete
BaseListener.install_get_text_element(SY_URI, name, full_name)
[65] Fix | Delete
end
[66] Fix | Delete
[67] Fix | Delete
end
[68] Fix | Delete
[69] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function