Commit d564d3bf authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Reintroduce title for @new tag.

parent ced00d34
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -149,6 +149,7 @@ module JsDuck
      validate

      @custom_tag_paths.each {|path| TagRegistry.load_from(path) }
      TagRegistry.options = self
    end

    def create_option_parser
+9 −7
Original line number Diff line number Diff line
@@ -9,13 +9,15 @@ module JsDuck::Tag

    # Initializes the tooltip text.
    #
    # FIXME: Copy-pasted code from old Boolean tag class, doesn't
    # currently work as it's never called.
    def create_tooltip!(imports, new_since)
      if new_since
        @signature[:tooltip] = "New since #{new_since}"
      elsif imports.length > 0
        @signature[:tooltip] = "New since #{imports.last[:version]}"
    # Gets passed the options object containing command line parameters.
    #
    # FIXME: This method is exclusively called only for this New tag
    # class.  Figure out some way to generalize this.
    def options=(opts)
      if opts.new_since
        @signature[:tooltip] = "New since #{opts.new_since}"
      elsif opts.imports.length > 0
        @signature[:tooltip] = "New since #{opts.imports.last[:version]}"
      end
    end

+5 −0
Original line number Diff line number Diff line
@@ -103,6 +103,11 @@ module JsDuck
    def assets=(assets)
      @keys[:aside].assets = assets
    end

    # Passes command line options to @new tag
    def options=(opts)
      @keys[:new].options = opts
    end
  end

end