Commit 4e6f45e9 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Add --ext4-events option.

We're still defaulting to auto-detection, but this option can be used to
override the auto-detection.
parent a0eb24fe
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -205,10 +205,7 @@ module JsDuck
    end

    # Appends Ext4 options parameter to each event parameter list.
    # But only when we are dealing with Ext4 codebase.
    def append_ext4_event_options
      return unless ext4?

      options = {
        :tagname => :param,
        :name => "eOpts",
+3 −1
Original line number Diff line number Diff line
@@ -124,7 +124,9 @@ module JsDuck
      agr.create_global_class
      agr.remove_ignored_classes
      agr.create_accessors
      if @opts.ext4_events == true || (@opts.ext4_events == nil && agr.ext4?)
        agr.append_ext4_event_options
      end
      agr.result
    end

+10 −0
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@ module JsDuck
    attr_accessor :output_dir
    attr_accessor :ignore_global
    attr_accessor :external_classes
    attr_accessor :ext4_events

    # Customizing output
    attr_accessor :title
@@ -73,6 +74,7 @@ module JsDuck
        # Special anything-goes type
        "Mixed",
      ]
      @ext4_events = nil
      @meta_tag_paths = []

      @version = "3.11.1"
@@ -157,6 +159,14 @@ module JsDuck
          @external_classes += classes
        end

        opts.on('--[no-]ext4-events',
          "Appends extra options parameter that all Ext events have.",
          "The default is to auto-detect if we're using Ext JS 4",
          "based on whether the code uses Ext.define.",
          "Use this option to override the auto-detection.", " ") do |e|
          @ext4_events = e
        end

        opts.on('--builtin-classes',
          "Includes docs for JavaScript builtin classes.", " ") do
          read_filenames(@root_dir + "/js-classes")