mirror of
https://github.com/danog/sass-site.git
synced 2025-01-08 14:08:45 +01:00
600 lines
16 KiB
HTML
600 lines
16 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<title>
|
|
Class: Sass::Deprecation
|
|
|
|
— Documentation by YARD 0.9.12
|
|
|
|
</title>
|
|
|
|
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
|
|
|
<link rel="stylesheet" href="../../assets/css/docs.css" type="text/css" charset="utf-8" />
|
|
|
|
<script type="text/javascript" charset="utf-8">
|
|
hasFrames = window.top.frames.main ? true : false;
|
|
relpath = '../';
|
|
framesUrl = "../frames.html#!Sass/Deprecation.html";
|
|
</script>
|
|
|
|
|
|
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
|
|
|
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
|
|
|
|
|
</head>
|
|
<body>
|
|
<div id="header">
|
|
<div id="menu">
|
|
|
|
<a href="../_index.html">Index (D)</a> »
|
|
<span class='title'><span class='object_link'><a href="../Sass.html" title="Sass (module)">Sass</a></span></span>
|
|
»
|
|
<span class="title">Deprecation</span>
|
|
|
|
|
|
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
|
</div>
|
|
|
|
<div id="search">
|
|
|
|
<a class="full_list_link" id="class_list_link"
|
|
href="../class_list.html">
|
|
Class List
|
|
</a>
|
|
|
|
<a class="full_list_link" id="method_list_link"
|
|
href="../method_list.html">
|
|
Method List
|
|
</a>
|
|
|
|
<a class="full_list_link" id="file_list_link"
|
|
href="../file_list.html">
|
|
File List
|
|
</a>
|
|
|
|
</div>
|
|
<div class="clear"></div>
|
|
</div>
|
|
|
|
<iframe id="search_frame"></iframe>
|
|
|
|
<div id="content"><h1>Class: Sass::Deprecation
|
|
|
|
|
|
|
|
</h1>
|
|
|
|
<dl class="box">
|
|
|
|
<dt class="r1">Inherits:</dt>
|
|
<dd class="r1">
|
|
<span class="inheritName">Object</span>
|
|
|
|
<ul class="fullTree">
|
|
<li>Object</li>
|
|
|
|
<li class="next">Sass::Deprecation</li>
|
|
|
|
</ul>
|
|
<a href="#" class="inheritanceTree">show all</a>
|
|
|
|
</dd>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<dt class="r2 last">Defined in:</dt>
|
|
<dd class="r2 last">.ruby-sass/lib/sass/deprecation.rb</dd>
|
|
|
|
</dl>
|
|
<div class="clear"></div>
|
|
|
|
<h2>Overview</h2><div class="docstring">
|
|
<div class="discussion">
|
|
|
|
<p>A deprecation warning that should only be printed once for a given line in
|
|
a given file.</p>
|
|
|
|
<p>A global Deprecation instance should be created for each type of
|
|
deprecation warning, and `warn` should be called each time a warning is
|
|
needed.</p>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div class="tags">
|
|
|
|
|
|
</div>
|
|
<h2>Constant Summary</h2>
|
|
|
|
<dl class="constants">
|
|
|
|
<dt id="allow_double_warnings-classvariable" class="">@@allow_double_warnings =
|
|
|
|
</dt>
|
|
<dd><pre class="code"><span class='kw'>false</span></pre></dd>
|
|
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h2>
|
|
Class Method Summary
|
|
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
|
</h2>
|
|
|
|
<ul class="summary">
|
|
|
|
<li class="public ">
|
|
<span class="summary_signature">
|
|
|
|
<a href="#allow_double_warnings-class_method" title="allow_double_warnings (class method)">.<strong>allow_double_warnings</strong> ⇒ Object </a>
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="summary_desc"><div class='inline'>
|
|
<p>Runs a block in which double deprecation warnings for the same location are
|
|
allowed.</p>
|
|
</div></span>
|
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
<h2>
|
|
Instance Method Summary
|
|
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
|
</h2>
|
|
|
|
<ul class="summary">
|
|
|
|
<li class="public ">
|
|
<span class="summary_signature">
|
|
|
|
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong> ⇒ Deprecation </a>
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
<span class="note title constructor">constructor</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="summary_desc"><div class='inline'>
|
|
<p>A new instance of Deprecation.</p>
|
|
</div></span>
|
|
|
|
</li>
|
|
|
|
|
|
<li class="public ">
|
|
<span class="summary_signature">
|
|
|
|
<a href="#warn-instance_method" title="#warn (instance method)">#<strong>warn</strong>(filename, line, column_or_message, message = nil) ⇒ Object </a>
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="summary_desc"><div class='inline'>
|
|
<p>Prints `message` as a deprecation warning associated with `filename`,
|
|
`line`, and optionally `column`.</p>
|
|
</div></span>
|
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
|
|
<div id="constructor_details" class="method_details_list">
|
|
<h2>Constructor Details</h2>
|
|
|
|
<div class="method_details first">
|
|
<h3 class="signature first" id="initialize-instance_method">
|
|
|
|
#<strong>initialize</strong> ⇒ <tt><span class='object_link'><a href="" title="Sass::Deprecation (class)">Deprecation</a></span></tt>
|
|
|
|
|
|
|
|
|
|
|
|
</h3><div class="docstring">
|
|
<div class="discussion">
|
|
|
|
<p>Returns a new instance of Deprecation</p>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div class="tags">
|
|
|
|
|
|
</div><table class="source_code">
|
|
<tr>
|
|
<td>
|
|
<pre class="lines">
|
|
|
|
|
|
20
|
|
21
|
|
22
|
|
23</pre>
|
|
</td>
|
|
<td>
|
|
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/deprecation.rb', line 20</span>
|
|
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
|
|
<span class='comment'># A set of filename, line pairs for which warnings have been emitted.
|
|
</span> <span class='ivar'>@seen</span> <span class='op'>=</span> <span class='const'>Set</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
|
<span class='kw'>end</span></pre>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
</div>
|
|
<div id="constructor_details" class="method_details_list">
|
|
<h2>Constructor Details</h2>
|
|
|
|
<div class="method_details first">
|
|
<h3 class="signature first" id="initialize-instance_method">
|
|
|
|
#<strong>initialize</strong> ⇒ <tt><span class='object_link'><a href="" title="Sass::Deprecation (class)">Deprecation</a></span></tt>
|
|
|
|
|
|
|
|
|
|
|
|
</h3><div class="docstring">
|
|
<div class="discussion">
|
|
|
|
<p>Returns a new instance of Deprecation</p>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div class="tags">
|
|
|
|
|
|
</div><table class="source_code">
|
|
<tr>
|
|
<td>
|
|
<pre class="lines">
|
|
|
|
|
|
20
|
|
21
|
|
22
|
|
23</pre>
|
|
</td>
|
|
<td>
|
|
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/deprecation.rb', line 20</span>
|
|
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
|
|
<span class='comment'># A set of filename, line pairs for which warnings have been emitted.
|
|
</span> <span class='ivar'>@seen</span> <span class='op'>=</span> <span class='const'>Set</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
|
<span class='kw'>end</span></pre>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
<div id="class_method_details" class="method_details_list">
|
|
<h2>Class Method Details</h2>
|
|
|
|
|
|
<div class="method_details first">
|
|
<h3 class="signature first" id="allow_double_warnings-class_method">
|
|
|
|
.<strong>allow_double_warnings</strong> ⇒ <tt>Object</tt>
|
|
|
|
|
|
|
|
|
|
|
|
</h3><div class="docstring">
|
|
<div class="discussion">
|
|
|
|
<p>Runs a block in which double deprecation warnings for the same location are
|
|
allowed.</p>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div class="tags">
|
|
|
|
|
|
</div><table class="source_code">
|
|
<tr>
|
|
<td>
|
|
<pre class="lines">
|
|
|
|
|
|
12
|
|
13
|
|
14
|
|
15
|
|
16
|
|
17
|
|
18</pre>
|
|
</td>
|
|
<td>
|
|
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/deprecation.rb', line 12</span>
|
|
|
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_allow_double_warnings'>allow_double_warnings</span>
|
|
<span class='id identifier rubyid_old_allow_double_warnings'>old_allow_double_warnings</span> <span class='op'>=</span> <span class='cvar'>@@allow_double_warnings</span>
|
|
<span class='cvar'>@@allow_double_warnings</span> <span class='op'>=</span> <span class='kw'>true</span>
|
|
<span class='kw'>yield</span>
|
|
<span class='kw'>ensure</span>
|
|
<span class='cvar'>@@allow_double_warnings</span> <span class='op'>=</span> <span class='id identifier rubyid_old_allow_double_warnings'>old_allow_double_warnings</span>
|
|
<span class='kw'>end</span></pre>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div id="instance_method_details" class="method_details_list">
|
|
<h2>Instance Method Details</h2>
|
|
|
|
|
|
<div class="method_details first">
|
|
<h3 class="signature first" id="warn-instance_method">
|
|
|
|
|
|
<span class="overload">#<strong>warn</strong>(filename, line, message) ⇒ <tt>Object</tt> </span>
|
|
|
|
<span class="overload">#<strong>warn</strong>(filename, line, column, message) ⇒ <tt>Object</tt> </span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</h3><div class="docstring">
|
|
<div class="discussion">
|
|
|
|
<p>Prints `message` as a deprecation warning associated with `filename`,
|
|
`line`, and optionally `column`.</p>
|
|
|
|
<p>This ensures that only one message will be printed for each line of a given
|
|
file.</p>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div class="tags">
|
|
|
|
<p class="tag_title">Overloads:</p>
|
|
<ul class="overload">
|
|
|
|
|
|
<li class="overload_item">
|
|
<span class="signature">#<strong>warn</strong>(filename, line, message) ⇒ <tt>Object</tt> </span>
|
|
<div class="docstring">
|
|
<div class="discussion">
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div class="tags">
|
|
<p class="tag_title">Parameters:</p>
|
|
<ul class="param">
|
|
|
|
<li>
|
|
|
|
<span class='name'>filename</span>
|
|
|
|
|
|
<span class='type'>(<tt>String</tt>, <tt>nil</tt>)</span>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<span class='name'>line</span>
|
|
|
|
|
|
<span class='type'>(<tt>Number</tt>)</span>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<span class='name'>message</span>
|
|
|
|
|
|
<span class='type'>(<tt>String</tt>)</span>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
</div>
|
|
</li>
|
|
|
|
|
|
<li class="overload_item">
|
|
<span class="signature">#<strong>warn</strong>(filename, line, column, message) ⇒ <tt>Object</tt> </span>
|
|
<div class="docstring">
|
|
<div class="discussion">
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div class="tags">
|
|
<p class="tag_title">Parameters:</p>
|
|
<ul class="param">
|
|
|
|
<li>
|
|
|
|
<span class='name'>filename</span>
|
|
|
|
|
|
<span class='type'>(<tt>String</tt>, <tt>nil</tt>)</span>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<span class='name'>line</span>
|
|
|
|
|
|
<span class='type'>(<tt>Number</tt>)</span>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<span class='name'>column</span>
|
|
|
|
|
|
<span class='type'>(<tt>Number</tt>)</span>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<span class='name'>message</span>
|
|
|
|
|
|
<span class='type'>(<tt>String</tt>)</span>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
</div>
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
</div><table class="source_code">
|
|
<tr>
|
|
<td>
|
|
<pre class="lines">
|
|
|
|
|
|
40
|
|
41
|
|
42
|
|
43
|
|
44
|
|
45
|
|
46
|
|
47
|
|
48
|
|
49
|
|
50
|
|
51
|
|
52
|
|
53</pre>
|
|
</td>
|
|
<td>
|
|
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/deprecation.rb', line 40</span>
|
|
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_warn'>warn</span><span class='lparen'>(</span><span class='id identifier rubyid_filename'>filename</span><span class='comma'>,</span> <span class='id identifier rubyid_line'>line</span><span class='comma'>,</span> <span class='id identifier rubyid_column_or_message'>column_or_message</span><span class='comma'>,</span> <span class='id identifier rubyid_message'>message</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
|
<span class='kw'>return</span> <span class='kw'>if</span> <span class='op'>!</span><span class='cvar'>@@allow_double_warnings</span> <span class='op'>&&</span> <span class='ivar'>@seen</span><span class='period'>.</span><span class='id identifier rubyid_add?'>add?</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='id identifier rubyid_filename'>filename</span><span class='comma'>,</span> <span class='id identifier rubyid_line'>line</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
|
<span class='kw'>if</span> <span class='id identifier rubyid_message'>message</span>
|
|
<span class='id identifier rubyid_column'>column</span> <span class='op'>=</span> <span class='id identifier rubyid_column_or_message'>column_or_message</span>
|
|
<span class='kw'>else</span>
|
|
<span class='id identifier rubyid_message'>message</span> <span class='op'>=</span> <span class='id identifier rubyid_column_or_message'>column_or_message</span>
|
|
<span class='kw'>end</span>
|
|
|
|
<span class='id identifier rubyid_location'>location</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>line </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_line'>line</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
|
<span class='id identifier rubyid_location'>location</span> <span class='op'><<</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>, column </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_column'>column</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_column'>column</span>
|
|
<span class='id identifier rubyid_location'>location</span> <span class='op'><<</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'> of </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_filename'>filename</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_filename'>filename</span>
|
|
|
|
<span class='const'><span class='object_link'><a href="../Sass.html" title="Sass (module)">Sass</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Util.html" title="Sass::Util (module)">Util</a></span></span><span class='period'>.</span><span class='id identifier rubyid_sass_warn'><span class='object_link'><a href="Util.html#sass_warn-instance_method" title="Sass::Util#sass_warn (method)">sass_warn</a></span></span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>DEPRECATION WARNING on </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_location'>location</span><span class='embexpr_end'>}</span><span class='tstring_content'>:\n</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_message'>message</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
|
<span class='kw'>end</span></pre>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div id="footer">
|
|
Generated on Mon Oct 22 13:20:51 2018 by
|
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
0.9.12 (ruby-2.5.3).
|
|
</div>
|
|
<script>
|
|
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
|
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
|
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
|
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
|
|
|
ga('create', 'UA-535380-14', 'sass-lang.com');
|
|
ga('send', 'pageview');
|
|
</script>
|
|
|
|
</body>
|
|
</html> |