Loading lib/jsduck/logger.rb +8 −1 Original line number Diff line number Diff line require 'singleton' require 'jsduck/os' module JsDuck Loading Loading @@ -28,7 +29,13 @@ module JsDuck # # Optionally filename and line number will be inserted to message. def warn(msg, filename=nil, line=0) msg = filename ? "#{filename}:#{line}:Warning: #{msg}" : "Warning: #{msg}" if filename filename.gsub!('/', '\\') if OS::windows? msg = "#{filename}:#{line}:Warning: #{msg}" else msg = "Warning: #{msg}" end if @warnings && !@shown_warnings[msg] $stderr.puts msg @shown_warnings[msg] = true Loading lib/jsduck/os.rb 0 → 100644 +11 −0 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 Loading
lib/jsduck/logger.rb +8 −1 Original line number Diff line number Diff line require 'singleton' require 'jsduck/os' module JsDuck Loading Loading @@ -28,7 +29,13 @@ module JsDuck # # Optionally filename and line number will be inserted to message. def warn(msg, filename=nil, line=0) msg = filename ? "#{filename}:#{line}:Warning: #{msg}" : "Warning: #{msg}" if filename filename.gsub!('/', '\\') if OS::windows? msg = "#{filename}:#{line}:Warning: #{msg}" else msg = "Warning: #{msg}" end if @warnings && !@shown_warnings[msg] $stderr.puts msg @shown_warnings[msg] = true Loading
lib/jsduck/os.rb 0 → 100644 +11 −0 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