module TrustyCms::Taggable::ClassMethods
def deprecated_tag(name, options={}, &dblock)
end
raise TagError "..."
deprecated_tag 'busted' do |tag|
}
Refer to the documentation for more about the new r:hotness tags.
Please note that the old r:busted namespace is no longer supported.
desc %{
same way as tags are normally defined:
In less standard situations you can use deprecated_tag in exactly the
If a deadline version is provided then it will be mentioned in the deprecation warnings.
If no substitute is given then a warning will be issued but nothing rendered.
deprecated_tag 'old:way', :substitute => 'new:way', :deadline => '1.1.1'
Define a tag while also deprecating it. Normal usage:
def deprecated_tag(name, options={}, &dblock) TrustyCms::Taggable.tag_deprecations[name] = options.dup if dblock tag(name) do |tag| warn_of_tag_deprecation(name, options) dblock.call(tag) end else tag(name) do |tag| warn_of_tag_deprecation(name, options) tag.render(options[:substitute], tag.attr.dup, &tag.block) if options[:substitute] end end end
def desc(text)
def desc(text) TrustyCms::Taggable.last_description = text # TrustyCms::Taggable.last_description = RedCloth.new(Util.strip_leading_whitespace(text)).to_html end
def inherited(subclass)
def inherited(subclass) subclass.tag_descriptions.reverse_merge! self.tag_descriptions super end
def tag(name, &block)
def tag(name, &block) self.tag_descriptions[name] = TrustyCms::Taggable.last_description if TrustyCms::Taggable.last_description TrustyCms::Taggable.last_description = nil define_method("tag:#{name}", &block) end
def tag_descriptions(hash = nil)
def tag_descriptions(hash = nil) TrustyCms::Taggable.tag_descriptions[self.name] ||= (hash ||{}) end
def tags
def tags Util.tags_in_array(self.instance_methods) end