Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/AnonR/anonr.TX.../opt/alt/ruby27/share/ruby/rss
File: maker.rb
# frozen_string_literal: false
[0] Fix | Delete
require_relative "rss"
[1] Fix | Delete
[2] Fix | Delete
module RSS
[3] Fix | Delete
##
[4] Fix | Delete
#
[5] Fix | Delete
# Provides a set of builders for various RSS objects
[6] Fix | Delete
#
[7] Fix | Delete
# * Feeds
[8] Fix | Delete
# * RSS 0.91
[9] Fix | Delete
# * RSS 1.0
[10] Fix | Delete
# * RSS 2.0
[11] Fix | Delete
# * Atom 1.0
[12] Fix | Delete
#
[13] Fix | Delete
# * Elements
[14] Fix | Delete
# * Atom::Entry
[15] Fix | Delete
[16] Fix | Delete
module Maker
[17] Fix | Delete
[18] Fix | Delete
# Collection of supported makers
[19] Fix | Delete
MAKERS = {}
[20] Fix | Delete
[21] Fix | Delete
class << self
[22] Fix | Delete
# Builder for an RSS object
[23] Fix | Delete
# Creates an object of the type passed in +args+
[24] Fix | Delete
#
[25] Fix | Delete
# Executes the +block+ to populate elements of the created RSS object
[26] Fix | Delete
def make(version, &block)
[27] Fix | Delete
self[version].make(&block)
[28] Fix | Delete
end
[29] Fix | Delete
[30] Fix | Delete
# Returns the maker for the +version+
[31] Fix | Delete
def [](version)
[32] Fix | Delete
maker_info = maker(version)
[33] Fix | Delete
raise UnsupportedMakerVersionError.new(version) if maker_info.nil?
[34] Fix | Delete
maker_info[:maker]
[35] Fix | Delete
end
[36] Fix | Delete
[37] Fix | Delete
# Adds a maker to the set of supported makers
[38] Fix | Delete
def add_maker(version, normalized_version, maker)
[39] Fix | Delete
MAKERS[version] = {:maker => maker, :version => normalized_version}
[40] Fix | Delete
end
[41] Fix | Delete
[42] Fix | Delete
# Returns collection of supported maker versions
[43] Fix | Delete
def versions
[44] Fix | Delete
MAKERS.keys.uniq.sort
[45] Fix | Delete
end
[46] Fix | Delete
[47] Fix | Delete
# Returns collection of supported makers
[48] Fix | Delete
def makers
[49] Fix | Delete
MAKERS.values.collect { |info| info[:maker] }.uniq
[50] Fix | Delete
end
[51] Fix | Delete
[52] Fix | Delete
# Returns true if the version is supported
[53] Fix | Delete
def supported?(version)
[54] Fix | Delete
versions.include?(version)
[55] Fix | Delete
end
[56] Fix | Delete
[57] Fix | Delete
private
[58] Fix | Delete
# Can I remove this method?
[59] Fix | Delete
def maker(version)
[60] Fix | Delete
MAKERS[version]
[61] Fix | Delete
end
[62] Fix | Delete
end
[63] Fix | Delete
end
[64] Fix | Delete
end
[65] Fix | Delete
[66] Fix | Delete
require_relative "maker/1.0"
[67] Fix | Delete
require_relative "maker/2.0"
[68] Fix | Delete
require_relative "maker/feed"
[69] Fix | Delete
require_relative "maker/entry"
[70] Fix | Delete
require_relative "maker/content"
[71] Fix | Delete
require_relative "maker/dublincore"
[72] Fix | Delete
require_relative "maker/slash"
[73] Fix | Delete
require_relative "maker/syndication"
[74] Fix | Delete
require_relative "maker/taxonomy"
[75] Fix | Delete
require_relative "maker/trackback"
[76] Fix | Delete
require_relative "maker/image"
[77] Fix | Delete
require_relative "maker/itunes"
[78] Fix | Delete
[79] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function