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

Rename JsDuck::OS to JsDuck::Util::OS.

parent 8d2cae1c
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
require 'singleton'
require 'jsduck/os'
require 'jsduck/util/os'

module JsDuck

@@ -110,7 +110,7 @@ module JsDuck
    def format(filename=nil, line=nil)
      out = ""
      if filename
        out = OS::windows? ? filename.gsub('/', '\\') : filename
        out = Util::OS.windows? ? filename.gsub('/', '\\') : filename
        if line
          out += ":#{line}:"
        end
@@ -153,7 +153,7 @@ module JsDuck
    # Only does color output when STDERR is attached to TTY
    # i.e. is not piped/redirected.
    def paint(color_name, msg)
      if OS.windows? || !$stderr.tty?
      if Util::OS.windows? || !$stderr.tty?
        msg
      else
        COLORS[color_name] + msg + CLEAR
+2 −1
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@ require 'jsduck/option_parser'
require 'jsduck/meta_tag_registry'
require 'jsduck/logger'
require 'jsduck/util/json'
require 'jsduck/util/os'

module JsDuck

@@ -106,7 +107,7 @@ module JsDuck

      # Debugging
      # Turn multiprocessing off by default in Windows
      @processes = OS::windows? ? 0 : nil
      @processes = Util::OS::windows? ? 0 : nil
      @root_dir = File.dirname(File.dirname(File.dirname(__FILE__)))
      @template_dir = @root_dir + "/template-min"
      @template_links = false

lib/jsduck/os.rb

deleted100644 → 0
+0 −11
Original line number Diff line number Diff line
require 'rbconfig'

module JsDuck

  # Simple helper class to detect operating system
  class OS
    def self.windows?
      RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/
    end
  end
end

lib/jsduck/util/os.rb

0 → 100644
+14 −0
Original line number Diff line number Diff line
require 'rbconfig'

module JsDuck
  module Util

    # Simple helper class to detect operating system
    class OS
      def self.windows?
        RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/
      end
    end

  end
end