Sha256: 86f5717763cc3f4cbe6c9dba4cd1c279da06b939828bb1f3ec4666d5a06a9611

Contents?: true

Size: 948 Bytes

Versions: 46

Compression:

Stored size: 948 Bytes

Contents

#
# makerss_category.rb: extension for makerss plugin.
#
# Copyright (C) 2007 by SHIBATA Hiroshi <h-sbt@nifty.com>
# Distributed under GPL2.
#
# Usage:
#    @conf['makerss.category'] = ["mixi", "sns"]
#

class MakeRssCategory < MakeRssFull
	def title
		'(category only)'
	end

	def item( seq, body, rdfsec )
		return unless rdfsec.section.respond_to?( :body_to_html )
		return if rdfsec.section.categories.length == 0
		rdfsec.section.categories.each do |category|
			if @conf['makerss.category'].include?(category)
				super
			end
		end
	end

	def file
		f = @conf['makerss.category.file'] || 'category.rdf'
		f = 'category.rdf' if f.length == 0
		f =~ %r|^/| ? f : "#{document_root}/#{f}"
	end

	def write( encoder )
		super( encoder )
	end

	def url
		u = @conf['makerss.category.url'] || "#{@conf.base_url}category.rdf"
		u = "#{@conf.base_url}category.rdf" if u.length == 0
		u
	end
end

@makerss_rsses << MakeRssCategory::new( @conf, @cgi )

Version data entries

46 entries across 40 versions & 2 rubygems

Version Path
tdiary-contrib-5.3.0 plugin/makerss_category.rb
tdiary-contrib-5.2.4 plugin/makerss_category.rb
tdiary-contrib-5.2.3 plugin/makerss_category.rb
tdiary-contrib-5.2.2 plugin/makerss_category.rb
tdiary-contrib-5.2.1 plugin/makerss_category.rb
tdiary-contrib-5.2.0 plugin/makerss_category.rb
tdiary-contrib-5.1.7 plugin/makerss_category.rb
tdiary-contrib-5.1.6 plugin/makerss_category.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/tdiary-contrib-5.1.4/plugin/makerss_category.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/bundler/gems/tdiary-contrib-d1e41204db13/plugin/makerss_category.rb
tdiary-contrib-5.1.5 plugin/makerss_category.rb
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/tdiary-contrib-5.1.4/plugin/makerss_category.rb
tdiary-contrib-5.1.4 plugin/makerss_category.rb
tdiary-contrib-5.1.3 plugin/makerss_category.rb
tdiary-contrib-5.1.2 plugin/makerss_category.rb
tdiary-contrib-5.1.1 plugin/makerss_category.rb
tdiary-contrib-5.1.0 plugin/makerss_category.rb
tdiary-contrib-5.0.13 plugin/makerss_category.rb
tdiary-contrib-5.0.12 plugin/makerss_category.rb
tdiary-contrib-5.0.11 plugin/makerss_category.rb