Commit 926ff037 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Let Util::Json configure itself.

parent efd0ca58
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -27,8 +27,8 @@ module JsDuck
        Util::Parallel.configure(@opts)
        TagRegistry.configure(@opts)
        Js::ExtPatterns.configure(@opts)
        Util::Json.configure(@opts)

        Util::Json.pretty = true if @opts.pretty_json
        JsDuck::Util::IO.encoding = @opts.encoding if @opts.encoding

        validate
+3 −3
Original line number Diff line number Diff line
@@ -17,9 +17,9 @@ module JsDuck
        @pretty = false
      end

      # Set to true to turn on pretty-formatting of JSON
      def pretty=(pretty)
        @pretty = pretty
      # Configures the pretty-formatting from command line options.
      def configure(opts)
        @pretty = true if opts.pretty_json
      end

      # Turns object into JSON, places it inside JavaScript that calls the