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

Let Util::IO configure itself.

parent 926ff037
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -28,8 +28,7 @@ module JsDuck
        TagRegistry.configure(@opts)
        Js::ExtPatterns.configure(@opts)
        Util::Json.configure(@opts)

        JsDuck::Util::IO.encoding = @opts.encoding if @opts.encoding
        JsDuck::Util::IO.configure(@opts)

        validate

+5 −0
Original line number Diff line number Diff line
@@ -13,6 +13,11 @@ module JsDuck
    class IO
      @@encoding = "BOM|UTF-8"

      # Configures the encoding from command line options.
      def self.configure(opts)
        encoding = opts.encoding if opts.encoding
      end

      # Sets the external encoding to be used for reading files.
      # When it's different from UTF-8, the input will be converted to UTF-8.
      def self.encoding=(e)