Commit 2defe51d authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Added --ignore-global command line option.

Using this, suppresses the creation of global class and also
suppresses the error messages related to that.
parent 2601896f
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -63,6 +63,10 @@ opts = OptionParser.new do | opts |
    app.processes = count.to_i
  end

  opts.on('--ignore-global', "Turns off the creation of global class.") do
    app.ignore_global = true
  end

  opts.on('-v', '--verbose', "This will fill up your console.") do
    app.verbose = true
  end
+3 −1
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ module JsDuck
    attr_accessor :export
    attr_accessor :link_tpl
    attr_accessor :img_tpl
    attr_accessor :ignore_global

    def initialize
      @output_dir = nil
@@ -35,6 +36,7 @@ module JsDuck
      @export = nil
      @link_tpl = nil
      @img_tpl = nil
      @ignore_global = false
      @timer = Timer.new
      @parallel = ParallelWrap.new
    end
@@ -86,7 +88,7 @@ module JsDuck
        agr.aggregate(file)
      end
      agr.classify_orphans
      agr.create_global_class
      agr.create_global_class unless @ignore_global
      agr.result
    end

+3 −1
Original line number Diff line number Diff line
@@ -64,7 +64,9 @@ module JsDuck
      if doc[:tagname] == :class
        doc[:name].gsub(/\./, '-')
      else
        doc[:member].gsub(/\./, '-') + "-" + doc[:tagname].to_s + "-" + doc[:name]
        # when creation of global class is skipped,
        # this member property can be nil.
        (doc[:member] || "global").gsub(/\./, '-') + "-" + doc[:tagname].to_s + "-" + doc[:name]
      end
    end