Sha256: 6d0bff330a21e0785b9dfb266b553df1f6cc3aeeb24ab67e75d7575614944198

Contents?: true

Size: 783 Bytes

Versions: 48

Compression:

Stored size: 783 Bytes

Contents

require "jsduck/meta_tag"

module JsDuck::Tag
  # Implementation of @deprecated tag
  class Deprecated < JsDuck::MetaTag
    def initialize
      @name = "deprecated"
      @key = :deprecated
      @signature = {:long => "deprecated", :short => "DEP"}
      @multiline = true
    end

    def to_value(contents)
      text = contents[0]
      if text =~ /\A([0-9.]+)(.*)\Z/
        {:version => $1, :text => $2.strip}
      else
        {:text => text || ""}
      end
    end

    def to_html(depr)
      v = depr[:version] ? "since " + depr[:version] : ""
      <<-EOHTML
        <div class='signature-box deprecated'>
        <p>This #{@context[:tagname]} has been <strong>deprecated</strong> #{v}</p>
        #{format(depr[:text])}
        </div>
      EOHTML
    end
  end
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
jsduck-4.10.4 lib/jsduck/tag/deprecated.rb
jsduck-4.10.3 lib/jsduck/tag/deprecated.rb
jsduck-4.10.2 lib/jsduck/tag/deprecated.rb
jsduck-4.10.1 lib/jsduck/tag/deprecated.rb
jsduck-4.10.0 lib/jsduck/tag/deprecated.rb
jsduck-4.9.0 lib/jsduck/tag/deprecated.rb
jsduck-4.8.0 lib/jsduck/tag/deprecated.rb
jsduck-4.7.1 lib/jsduck/tag/deprecated.rb
jsduck-4.7.0 lib/jsduck/tag/deprecated.rb
jsduck-4.6.2 lib/jsduck/tag/deprecated.rb
jsduck-4.6.1 lib/jsduck/tag/deprecated.rb
jsduck-4.6.0 lib/jsduck/tag/deprecated.rb
jsduck-4.5.1 lib/jsduck/tag/deprecated.rb
jsduck-4.5.0 lib/jsduck/tag/deprecated.rb
jsduck-4.4.1 lib/jsduck/tag/deprecated.rb
jsduck-4.4.0 lib/jsduck/tag/deprecated.rb
jsduck-4.3.2 lib/jsduck/tag/deprecated.rb
jsduck-4.3.1 lib/jsduck/tag/deprecated.rb
jsduck-4.3.0 lib/jsduck/tag/deprecated.rb
jsduck-4.2.1 lib/jsduck/tag/deprecated.rb