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

Let Js::ExtPatterns configure itself.

parent fdf33012
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -36,8 +36,13 @@ module JsDuck
        @patterns[pattern].include?(string)
      end

      # Reconfigures ExtPatterns with different set of namespaces.
      # Called when --ext-namespaces option is passed to JSDuck.
      # Reconfigures ExtPatterns with different set of namespaces from
      # command line options.
      def configure(opts)
        set(opts.ext_namespaces) if opts.ext_namespaces
      end

      # Reconfigures patterns with given set of namespaces.
      def set(namespaces)
        @patterns = {
          "Ext.define" => build_patterns(namespaces, [".define", ".ClassManager.create"]),
+1 −1
Original line number Diff line number Diff line
@@ -26,10 +26,10 @@ module JsDuck
        Logger.configure(@opts)
        Util::Parallel.configure(@opts)
        TagRegistry.configure(@opts)
        Js::ExtPatterns.configure(@opts)

        Util::Json.pretty = true if @opts.pretty_json
        JsDuck::Util::IO.encoding = @opts.encoding if @opts.encoding
        Js::ExtPatterns.set(@opts.ext_namespaces) if @opts.ext_namespaces

        validate