Loading lib/jsduck/options.rb +3 −0 Original line number Diff line number Diff line Loading @@ -182,6 +182,9 @@ module JsDuck # definitions multiple times. TagRegistry.instance end # The tooltip of @new can now be configured. TagRegistry.get_by_name(:new).init_tooltip!(self) end private Loading lib/jsduck/process/versions.rb +0 −15 Original line number Diff line number Diff line require 'jsduck/process/importer' require 'jsduck/tag_registry' module JsDuck module Process Loading @@ -7,8 +6,6 @@ module JsDuck # Generates @since and @new tags by importing JSDuck exports of # older versions of the same project and looking in which version # a class or method first appeared. # # Additionally here the tooltip text for @new tag gets injected. class Versions def initialize(relations, opts={}, importer=nil) @relations = relations Loading @@ -19,8 +16,6 @@ module JsDuck # Loads in exported docs and generates @since and @new tags. def process_all! init_new_tag_tooltip! if @opts[:imports].length > 0 generate_since_tags(@importer.import(@opts[:imports])) end Loading @@ -28,16 +23,6 @@ module JsDuck private # Initializes the tooltip text for the signature of @new tag. def init_new_tag_tooltip! signature = TagRegistry.get_by_name(:new).signature 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 # Using the imported versions data, adds @since tags to all # classes/members/params. def generate_since_tags(versions) Loading lib/jsduck/tag/new.rb +13 −0 Original line number Diff line number Diff line Loading @@ -15,5 +15,18 @@ module JsDuck::Tag EOCSS super end # Initializes the tooltip text based on the --new-since and # --import options passed from command line. # # NOTE: This method is explicitly called from JsDuck::Options class. def init_tooltip!(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 end end Loading
lib/jsduck/options.rb +3 −0 Original line number Diff line number Diff line Loading @@ -182,6 +182,9 @@ module JsDuck # definitions multiple times. TagRegistry.instance end # The tooltip of @new can now be configured. TagRegistry.get_by_name(:new).init_tooltip!(self) end private Loading
lib/jsduck/process/versions.rb +0 −15 Original line number Diff line number Diff line require 'jsduck/process/importer' require 'jsduck/tag_registry' module JsDuck module Process Loading @@ -7,8 +6,6 @@ module JsDuck # Generates @since and @new tags by importing JSDuck exports of # older versions of the same project and looking in which version # a class or method first appeared. # # Additionally here the tooltip text for @new tag gets injected. class Versions def initialize(relations, opts={}, importer=nil) @relations = relations Loading @@ -19,8 +16,6 @@ module JsDuck # Loads in exported docs and generates @since and @new tags. def process_all! init_new_tag_tooltip! if @opts[:imports].length > 0 generate_since_tags(@importer.import(@opts[:imports])) end Loading @@ -28,16 +23,6 @@ module JsDuck private # Initializes the tooltip text for the signature of @new tag. def init_new_tag_tooltip! signature = TagRegistry.get_by_name(:new).signature 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 # Using the imported versions data, adds @since tags to all # classes/members/params. def generate_since_tags(versions) Loading
lib/jsduck/tag/new.rb +13 −0 Original line number Diff line number Diff line Loading @@ -15,5 +15,18 @@ module JsDuck::Tag EOCSS super end # Initializes the tooltip text based on the --new-since and # --import options passed from command line. # # NOTE: This method is explicitly called from JsDuck::Options class. def init_tooltip!(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 end end