Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/AnonR/anonr.TX.../opt/alt/ruby27/share/ruby/rss
File: taxonomy.rb
# frozen_string_literal: false
[0] Fix | Delete
require "rss/1.0"
[1] Fix | Delete
require_relative "dublincore"
[2] Fix | Delete
[3] Fix | Delete
module RSS
[4] Fix | Delete
# The prefix for the Taxonomy XML namespace.
[5] Fix | Delete
TAXO_PREFIX = "taxo"
[6] Fix | Delete
# The URI for the specification of the Taxonomy XML namespace.
[7] Fix | Delete
TAXO_URI = "http://purl.org/rss/1.0/modules/taxonomy/"
[8] Fix | Delete
[9] Fix | Delete
RDF.install_ns(TAXO_PREFIX, TAXO_URI)
[10] Fix | Delete
[11] Fix | Delete
# The listing of all the taxonomy elements, with the appropriate namespace.
[12] Fix | Delete
TAXO_ELEMENTS = []
[13] Fix | Delete
[14] Fix | Delete
%w(link).each do |name|
[15] Fix | Delete
full_name = "#{TAXO_PREFIX}_#{name}"
[16] Fix | Delete
BaseListener.install_get_text_element(TAXO_URI, name, full_name)
[17] Fix | Delete
TAXO_ELEMENTS << "#{TAXO_PREFIX}_#{name}"
[18] Fix | Delete
end
[19] Fix | Delete
[20] Fix | Delete
%w(topic topics).each do |name|
[21] Fix | Delete
class_name = Utils.to_class_name(name)
[22] Fix | Delete
BaseListener.install_class_name(TAXO_URI, name, "Taxonomy#{class_name}")
[23] Fix | Delete
TAXO_ELEMENTS << "#{TAXO_PREFIX}_#{name}"
[24] Fix | Delete
end
[25] Fix | Delete
[26] Fix | Delete
module TaxonomyTopicsModel
[27] Fix | Delete
extend BaseModel
[28] Fix | Delete
[29] Fix | Delete
def self.append_features(klass)
[30] Fix | Delete
super
[31] Fix | Delete
[32] Fix | Delete
klass.install_must_call_validator(TAXO_PREFIX, TAXO_URI)
[33] Fix | Delete
%w(topics).each do |name|
[34] Fix | Delete
klass.install_have_child_element(name, TAXO_URI, "?",
[35] Fix | Delete
"#{TAXO_PREFIX}_#{name}")
[36] Fix | Delete
end
[37] Fix | Delete
end
[38] Fix | Delete
[39] Fix | Delete
class TaxonomyTopics < Element
[40] Fix | Delete
include RSS10
[41] Fix | Delete
[42] Fix | Delete
Bag = ::RSS::RDF::Bag
[43] Fix | Delete
[44] Fix | Delete
class << self
[45] Fix | Delete
def required_prefix
[46] Fix | Delete
TAXO_PREFIX
[47] Fix | Delete
end
[48] Fix | Delete
[49] Fix | Delete
def required_uri
[50] Fix | Delete
TAXO_URI
[51] Fix | Delete
end
[52] Fix | Delete
end
[53] Fix | Delete
[54] Fix | Delete
@tag_name = "topics"
[55] Fix | Delete
[56] Fix | Delete
install_have_child_element("Bag", RDF::URI, nil)
[57] Fix | Delete
install_must_call_validator('rdf', RDF::URI)
[58] Fix | Delete
[59] Fix | Delete
def initialize(*args)
[60] Fix | Delete
if Utils.element_initialize_arguments?(args)
[61] Fix | Delete
super
[62] Fix | Delete
else
[63] Fix | Delete
super()
[64] Fix | Delete
self.Bag = args[0]
[65] Fix | Delete
end
[66] Fix | Delete
self.Bag ||= Bag.new
[67] Fix | Delete
end
[68] Fix | Delete
[69] Fix | Delete
def full_name
[70] Fix | Delete
tag_name_with_prefix(TAXO_PREFIX)
[71] Fix | Delete
end
[72] Fix | Delete
[73] Fix | Delete
def maker_target(target)
[74] Fix | Delete
target.taxo_topics
[75] Fix | Delete
end
[76] Fix | Delete
[77] Fix | Delete
def resources
[78] Fix | Delete
if @Bag
[79] Fix | Delete
@Bag.lis.collect do |li|
[80] Fix | Delete
li.resource
[81] Fix | Delete
end
[82] Fix | Delete
else
[83] Fix | Delete
[]
[84] Fix | Delete
end
[85] Fix | Delete
end
[86] Fix | Delete
end
[87] Fix | Delete
end
[88] Fix | Delete
[89] Fix | Delete
module TaxonomyTopicModel
[90] Fix | Delete
extend BaseModel
[91] Fix | Delete
[92] Fix | Delete
def self.append_features(klass)
[93] Fix | Delete
super
[94] Fix | Delete
var_name = "#{TAXO_PREFIX}_topic"
[95] Fix | Delete
klass.install_have_children_element("topic", TAXO_URI, "*", var_name)
[96] Fix | Delete
end
[97] Fix | Delete
[98] Fix | Delete
class TaxonomyTopic < Element
[99] Fix | Delete
include RSS10
[100] Fix | Delete
[101] Fix | Delete
include DublinCoreModel
[102] Fix | Delete
include TaxonomyTopicsModel
[103] Fix | Delete
[104] Fix | Delete
class << self
[105] Fix | Delete
def required_prefix
[106] Fix | Delete
TAXO_PREFIX
[107] Fix | Delete
end
[108] Fix | Delete
[109] Fix | Delete
def required_uri
[110] Fix | Delete
TAXO_URI
[111] Fix | Delete
end
[112] Fix | Delete
end
[113] Fix | Delete
[114] Fix | Delete
@tag_name = "topic"
[115] Fix | Delete
[116] Fix | Delete
install_get_attribute("about", ::RSS::RDF::URI, true, nil, nil,
[117] Fix | Delete
"#{RDF::PREFIX}:about")
[118] Fix | Delete
install_text_element("link", TAXO_URI, "?", "#{TAXO_PREFIX}_link")
[119] Fix | Delete
[120] Fix | Delete
def initialize(*args)
[121] Fix | Delete
if Utils.element_initialize_arguments?(args)
[122] Fix | Delete
super
[123] Fix | Delete
else
[124] Fix | Delete
super()
[125] Fix | Delete
self.about = args[0]
[126] Fix | Delete
end
[127] Fix | Delete
end
[128] Fix | Delete
[129] Fix | Delete
def full_name
[130] Fix | Delete
tag_name_with_prefix(TAXO_PREFIX)
[131] Fix | Delete
end
[132] Fix | Delete
[133] Fix | Delete
def maker_target(target)
[134] Fix | Delete
target.new_taxo_topic
[135] Fix | Delete
end
[136] Fix | Delete
end
[137] Fix | Delete
end
[138] Fix | Delete
[139] Fix | Delete
class RDF
[140] Fix | Delete
include TaxonomyTopicModel
[141] Fix | Delete
class Channel
[142] Fix | Delete
include TaxonomyTopicsModel
[143] Fix | Delete
end
[144] Fix | Delete
class Item; include TaxonomyTopicsModel; end
[145] Fix | Delete
end
[146] Fix | Delete
end
[147] Fix | Delete
[148] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function