class Sass::Deprecation
warning, and ‘warn` should be called each time a warning is needed.
A global Deprecation instance should be created for each type of deprecation
given file.
A deprecation warning that should only be printed once for a given line in a
def self.allow_double_warnings
Runs a block in which double deprecation warnings for the same location
def self.allow_double_warnings old_allow_double_warnings = @@allow_double_warnings @@allow_double_warnings = true yield ensure @@allow_double_warnings = old_allow_double_warnings end
def initialize
def initialize # A set of filename, line pairs for which warnings have been emitted. @seen = Set.new end
def warn(filename, line, column_or_message, message = nil)
-
message
(String
) -- -
column
(Number
) -- -
line
(Number
) -- -
filename
(String, nil
) -- -
message
(String
) -- -
line
(Number
) -- -
filename
(String, nil
) --
Overloads:
-
warn(filename, line, column, message)
-
warn(filename, line, message)
def warn(filename, line, column_or_message, message = nil) return if !@@allow_double_warnings && @seen.add?([filename, line]).nil? if message column = column_or_message else message = column_or_message end location = "line #{line}" location << ", column #{column}" if column location << " of #{filename}" if filename Sass::Util.sass_warn("DEPRECATION WARNING on #{location}:\n#{message}") end