sass-site/source/documentation/Sass/Plugin/StalenessChecker.html

1086 lines
31 KiB
HTML
Raw Normal View History

2018-10-22 23:13:05 +02:00
<!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::Plugin::StalenessChecker
&mdash; 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/Plugin/StalenessChecker.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 (S)</a> &raquo;
<span class='title'><span class='object_link'><a href="../../Sass.html" title="Sass (module)">Sass</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Plugin.html" title="Sass::Plugin (module)">Plugin</a></span></span>
&raquo;
<span class="title">StalenessChecker</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::Plugin::StalenessChecker
</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::Plugin::StalenessChecker</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/plugin/staleness_checker.rb</dd>
</dl>
<div class="clear"></div>
<h2>Overview</h2><div class="docstring">
<div class="discussion">
<p>The class handles `.<a href="ca">s</a>ss` file staleness checks via their
mtime timestamps.</p>
<p>To speed things up two level of caches are employed:</p>
<ul><li>
<p>A class-level dependency cache which stores @import paths for each file.
This is a long-lived cache that is reused by every StalenessChecker
instance.</p>
</li><li>
<p>Three short-lived instance-level caches, one for file mtimes, one for
whether a file is stale during this particular run. and one for the parse
tree for a file. These are only used by a single StalenessChecker instance.</p>
</li></ul>
<p>Usage:</p>
<ul><li>
<p>For a one-off staleness check of a single `.<a href="ca">s</a>ss` file, the
class-level <span class='object_link'><a href="#stylesheet_needs_update%3F-class_method" title="Sass::Plugin::StalenessChecker.stylesheet_needs_update? (method)">StalenessChecker.stylesheet_needs_update?</a></span> method should be used.</p>
</li><li>
<p>For a series of staleness checks (e.g. checking all files for staleness) a
StalenessChecker instance should be created, and the instance-level
<span class='object_link'><a href="#stylesheet_needs_update%3F-instance_method" title="Sass::Plugin::StalenessChecker#stylesheet_needs_update? (method)">#stylesheet_needs_update?</a></span> method should be used. the caches should make
the whole process significantly faster. <strong>WARNING</strong>: It is
important not to retain the instance for too long, as its instance-level
caches are never explicitly expired.</p>
</li></ul>
</div>
</div>
<div class="tags">
</div>
<h2>Class Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
<ul class="summary">
<li class="public ">
<span class="summary_signature">
<a href="#dependencies_cache-class_method" title="dependencies_cache (class method)">.<strong>dependencies_cache</strong> &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>TODO: attach this to a compiler instance.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#dependency_cache_mutex-class_method" title="dependency_cache_mutex (class method)">.<strong>dependency_cache_mutex</strong> &#x21d2; Object </a>
</span>
<span class="note title readonly">readonly</span>
<span class="summary_desc"><div class='inline'>
<p>Returns the value of attribute dependency_cache_mutex.</p>
</div></span>
</li>
</ul>
<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="#stylesheet_modified_since%3F-class_method" title="stylesheet_modified_since? (class method)">.<strong>stylesheet_modified_since?</strong>(template_file, mtime, importer = nil) &#x21d2; Boolean </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Returns whether a Sass or SCSS stylesheet has been modified since a given
time.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#stylesheet_needs_update%3F-class_method" title="stylesheet_needs_update? (class method)">.<strong>stylesheet_needs_update?</strong>(css_file, template_file, importer = nil) &#x21d2; Boolean </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Returns whether or not a given CSS file is out of date and needs to be
regenerated.</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>(options) &#x21d2; StalenessChecker </a>
</span>
<span class="note title constructor">constructor</span>
<span class="summary_desc"><div class='inline'>
<p>Creates a new StalenessChecker for checking the staleness of several
stylesheets at once.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#stylesheet_modified_since%3F-instance_method" title="#stylesheet_modified_since? (instance method)">#<strong>stylesheet_modified_since?</strong>(template_file, mtime, importer = nil) &#x21d2; Boolean </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Returns whether a Sass or SCSS stylesheet has been modified since a given
time.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#stylesheet_needs_update%3F-instance_method" title="#stylesheet_needs_update? (instance method)">#<strong>stylesheet_needs_update?</strong>(css_file, template_file, importer = nil) &#x21d2; Boolean </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Returns whether or not a given CSS file is out of date and needs to be
regenerated.</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>(options) &#x21d2; <tt><span class='object_link'><a href="" title="Sass::Plugin::StalenessChecker (class)">StalenessChecker</a></span></tt>
</h3><div class="docstring">
<div class="discussion">
<p>Creates a new StalenessChecker for checking the staleness of several
stylesheets at once.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>options</span>
<span class='type'>(<tt>{Symbol =&gt; Object}</tt>)</span>
&mdash;
<div class='inline'>
<p>See <a href="../../file.SASS_REFERENCE.html#Options" title="the Sass options documentation">the Sass options documentation</a>.</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
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/plugin/staleness_checker.rb', line 43</span>
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
<span class='comment'># URIs that are being actively checked for staleness. Protects against
</span> <span class='comment'># import loops.
</span> <span class='ivar'>@actively_checking</span> <span class='op'>=</span> <span class='const'>Set</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
<span class='comment'># Entries in the following instance-level caches are never explicitly expired.
</span> <span class='comment'># Instead they are supposed to automatically go out of scope when a series of staleness
</span> <span class='comment'># checks (this instance of StalenessChecker was created for) is finished.
</span> <span class='ivar'>@mtimes</span><span class='comma'>,</span> <span class='ivar'>@dependencies_stale</span><span class='comma'>,</span> <span class='ivar'>@parse_trees</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
<span class='ivar'>@options</span> <span class='op'>=</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="../Engine.html" title="Sass::Engine (class)">Engine</a></span></span><span class='period'>.</span><span class='id identifier rubyid_normalize_options'><span class='object_link'><a href="../Engine.html#normalize_options-class_method" title="Sass::Engine.normalize_options (method)">normalize_options</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</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>(options) &#x21d2; <tt><span class='object_link'><a href="" title="Sass::Plugin::StalenessChecker (class)">StalenessChecker</a></span></tt>
</h3><div class="docstring">
<div class="discussion">
<p>Creates a new StalenessChecker for checking the staleness of several
stylesheets at once.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>options</span>
<span class='type'>(<tt>{Symbol =&gt; Object}</tt>)</span>
&mdash;
<div class='inline'>
<p>See <a href="../../file.SASS_REFERENCE.html#Options" title="the Sass options documentation">the Sass options documentation</a>.</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
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/plugin/staleness_checker.rb', line 43</span>
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
<span class='comment'># URIs that are being actively checked for staleness. Protects against
</span> <span class='comment'># import loops.
</span> <span class='ivar'>@actively_checking</span> <span class='op'>=</span> <span class='const'>Set</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
<span class='comment'># Entries in the following instance-level caches are never explicitly expired.
</span> <span class='comment'># Instead they are supposed to automatically go out of scope when a series of staleness
</span> <span class='comment'># checks (this instance of StalenessChecker was created for) is finished.
</span> <span class='ivar'>@mtimes</span><span class='comma'>,</span> <span class='ivar'>@dependencies_stale</span><span class='comma'>,</span> <span class='ivar'>@parse_trees</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
<span class='ivar'>@options</span> <span class='op'>=</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="../Engine.html" title="Sass::Engine (class)">Engine</a></span></span><span class='period'>.</span><span class='id identifier rubyid_normalize_options'><span class='object_link'><a href="../Engine.html#normalize_options-class_method" title="Sass::Engine.normalize_options (method)">normalize_options</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
<div id="class_attr_details" class="attr_details">
<h2>Class Attribute Details</h2>
<span id="dependencies_cache=-class_method"></span>
<div class="method_details first">
<h3 class="signature first" id="dependencies_cache-class_method">
.<strong>dependencies_cache</strong> &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>TODO: attach this to a compiler instance.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
34
35
36</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/plugin/staleness_checker.rb', line 34</span>
<span class='kw'>def</span> <span class='id identifier rubyid_dependencies_cache'>dependencies_cache</span>
<span class='ivar'>@dependencies_cache</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<span id=""></span>
<div class="method_details ">
<h3 class="signature " id="dependency_cache_mutex-class_method">
.<strong>dependency_cache_mutex</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
</h3><div class="docstring">
<div class="discussion">
<p>Returns the value of attribute dependency_cache_mutex</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
35
36
37</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/plugin/staleness_checker.rb', line 35</span>
<span class='kw'>def</span> <span class='id identifier rubyid_dependency_cache_mutex'>dependency_cache_mutex</span>
<span class='ivar'>@dependency_cache_mutex</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="stylesheet_modified_since?-class_method">
.<strong>stylesheet_modified_since?</strong>(template_file, mtime, importer = nil) &#x21d2; <tt>Boolean</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns whether a Sass or SCSS stylesheet has been modified since a given
time.</p>
<p>The distinction between this method and the instance-level
<span class='object_link'><a href="#stylesheet_modified_since%3F-instance_method" title="Sass::Plugin::StalenessChecker#stylesheet_modified_since? (method)">#stylesheet_modified_since?</a></span> is that the instance method preserves mtime
and stale-dependency caches, so it&#39;s better to use when checking
multiple stylesheets at once.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>template_file</span>
<span class='type'>(<tt>String</tt>)</span>
&mdash;
<div class='inline'>
<p>The location of the Sass or SCSS template.</p>
</div>
</li>
<li>
<span class='name'>mtime</span>
<span class='type'>(<tt>Time</tt>)</span>
&mdash;
<div class='inline'>
<p>The modification time to check against.</p>
</div>
</li>
<li>
<span class='name'>importer</span>
<span class='type'>(<tt><span class='object_link'><a href="../Importers/Base.html" title="Sass::Importers::Base (class)">Sass::Importers::Base</a></span></tt>)</span>
<em class="default">(defaults to: <tt>nil</tt>)</em>
&mdash;
<div class='inline'>
<p>The importer used to locate the stylesheet. Defaults to the filesystem
importer.</p>
</div>
</li>
</ul>
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Boolean</tt>)</span>
&mdash;
<div class='inline'>
<p>Whether the stylesheet has been modified.</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
110
111
112</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/plugin/staleness_checker.rb', line 110</span>
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_stylesheet_modified_since?'>stylesheet_modified_since?</span><span class='lparen'>(</span><span class='id identifier rubyid_template_file'>template_file</span><span class='comma'>,</span> <span class='id identifier rubyid_mtime'>mtime</span><span class='comma'>,</span> <span class='id identifier rubyid_importer'>importer</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../Plugin.html" title="Sass::Plugin (module)">Plugin</a></span></span><span class='period'>.</span><span class='id identifier rubyid_engine_options'>engine_options</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_stylesheet_modified_since?'>stylesheet_modified_since?</span><span class='lparen'>(</span><span class='id identifier rubyid_template_file'>template_file</span><span class='comma'>,</span> <span class='id identifier rubyid_mtime'>mtime</span><span class='comma'>,</span> <span class='id identifier rubyid_importer'>importer</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="stylesheet_needs_update?-class_method">
.<strong>stylesheet_needs_update?</strong>(css_file, template_file, importer = nil) &#x21d2; <tt>Boolean</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns whether or not a given CSS file is out of date and needs to be
regenerated.</p>
<p>The distinction between this method and the instance-level
<span class='object_link'><a href="#stylesheet_needs_update%3F-instance_method" title="Sass::Plugin::StalenessChecker#stylesheet_needs_update? (method)">#stylesheet_needs_update?</a></span> is that the instance method preserves mtime and
stale-dependency caches, so it&#39;s better to use when checking multiple
stylesheets at once.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>css_file</span>
<span class='type'>(<tt>String</tt>)</span>
&mdash;
<div class='inline'>
<p>The location of the CSS file to check.</p>
</div>
</li>
<li>
<span class='name'>template_file</span>
<span class='type'>(<tt>String</tt>)</span>
&mdash;
<div class='inline'>
<p>The location of the Sass or SCSS template that is compiled to `css_file`.</p>
</div>
</li>
</ul>
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Boolean</tt>)</span>
&mdash;
<div class='inline'>
<p>Whether the stylesheet needs to be updated.</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
95
96
97</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/plugin/staleness_checker.rb', line 95</span>
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_stylesheet_needs_update?'>stylesheet_needs_update?</span><span class='lparen'>(</span><span class='id identifier rubyid_css_file'>css_file</span><span class='comma'>,</span> <span class='id identifier rubyid_template_file'>template_file</span><span class='comma'>,</span> <span class='id identifier rubyid_importer'>importer</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../Plugin.html" title="Sass::Plugin (module)">Plugin</a></span></span><span class='period'>.</span><span class='id identifier rubyid_engine_options'>engine_options</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_stylesheet_needs_update?'>stylesheet_needs_update?</span><span class='lparen'>(</span><span class='id identifier rubyid_css_file'>css_file</span><span class='comma'>,</span> <span class='id identifier rubyid_template_file'>template_file</span><span class='comma'>,</span> <span class='id identifier rubyid_importer'>importer</span><span class='rparen'>)</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="stylesheet_modified_since?-instance_method">
#<strong>stylesheet_modified_since?</strong>(template_file, mtime, importer = nil) &#x21d2; <tt>Boolean</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns whether a Sass or SCSS stylesheet has been modified since a given
time.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>template_file</span>
<span class='type'>(<tt>String</tt>)</span>
&mdash;
<div class='inline'>
<p>The location of the Sass or SCSS template.</p>
</div>
</li>
<li>
<span class='name'>mtime</span>
<span class='type'>(<tt>Time</tt>)</span>
&mdash;
<div class='inline'>
<p>The modification time to check against.</p>
</div>
</li>
<li>
<span class='name'>importer</span>
<span class='type'>(<tt><span class='object_link'><a href="../Importers/Base.html" title="Sass::Importers::Base (class)">Sass::Importers::Base</a></span></tt>)</span>
<em class="default">(defaults to: <tt>nil</tt>)</em>
&mdash;
<div class='inline'>
<p>The importer used to locate the stylesheet. Defaults to the filesystem
importer.</p>
</div>
</li>
</ul>
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Boolean</tt>)</span>
&mdash;
<div class='inline'>
<p>Whether the stylesheet has been modified.</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
79
80
81
82</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/plugin/staleness_checker.rb', line 79</span>
<span class='kw'>def</span> <span class='id identifier rubyid_stylesheet_modified_since?'>stylesheet_modified_since?</span><span class='lparen'>(</span><span class='id identifier rubyid_template_file'>template_file</span><span class='comma'>,</span> <span class='id identifier rubyid_mtime'>mtime</span><span class='comma'>,</span> <span class='id identifier rubyid_importer'>importer</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='id identifier rubyid_importer'>importer</span> <span class='op'>||=</span> <span class='ivar'>@options</span><span class='lbracket'>[</span><span class='symbol'>:filesystem_importer</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>.</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
<span class='id identifier rubyid_dependency_updated?'>dependency_updated?</span><span class='lparen'>(</span><span class='id identifier rubyid_mtime'>mtime</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_template_file'>template_file</span><span class='comma'>,</span> <span class='id identifier rubyid_importer'>importer</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="stylesheet_needs_update?-instance_method">
#<strong>stylesheet_needs_update?</strong>(css_file, template_file, importer = nil) &#x21d2; <tt>Boolean</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns whether or not a given CSS file is out of date and needs to be
regenerated.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>css_file</span>
<span class='type'>(<tt>String</tt>)</span>
&mdash;
<div class='inline'>
<p>The location of the CSS file to check.</p>
</div>
</li>
<li>
<span class='name'>template_file</span>
<span class='type'>(<tt>String</tt>)</span>
&mdash;
<div class='inline'>
<p>The location of the Sass or SCSS template that is compiled to `css_file`.</p>
</div>
</li>
</ul>
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Boolean</tt>)</span>
&mdash;
<div class='inline'>
<p>Whether the stylesheet needs to be updated.</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
62
63
64
65
66
67
68
69
70</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/plugin/staleness_checker.rb', line 62</span>
<span class='kw'>def</span> <span class='id identifier rubyid_stylesheet_needs_update?'>stylesheet_needs_update?</span><span class='lparen'>(</span><span class='id identifier rubyid_css_file'>css_file</span><span class='comma'>,</span> <span class='id identifier rubyid_template_file'>template_file</span><span class='comma'>,</span> <span class='id identifier rubyid_importer'>importer</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='id identifier rubyid_template_file'>template_file</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_expand_path'>expand_path</span><span class='lparen'>(</span><span class='id identifier rubyid_template_file'>template_file</span><span class='rparen'>)</span>
<span class='kw'>begin</span>
<span class='id identifier rubyid_css_mtime'>css_mtime</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_mtime'>mtime</span><span class='lparen'>(</span><span class='id identifier rubyid_css_file'>css_file</span><span class='rparen'>)</span>
<span class='kw'>rescue</span> <span class='const'>Errno</span><span class='op'>::</span><span class='const'>ENOENT</span>
<span class='kw'>return</span> <span class='kw'>true</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_stylesheet_modified_since?'>stylesheet_modified_since?</span><span class='lparen'>(</span><span class='id identifier rubyid_template_file'>template_file</span><span class='comma'>,</span> <span class='id identifier rubyid_css_mtime'>css_mtime</span><span class='comma'>,</span> <span class='id identifier rubyid_importer'>importer</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:52 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>