sass-site/source/documentation/Sass/Plugin/Configuration.html
2018-10-22 14:13:05 -07:00

723 lines
20 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>
Module: Sass::Plugin::Configuration
&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/Configuration.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 (C)</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">Configuration</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>Module: Sass::Plugin::Configuration
</h1>
<dl class="box">
<dt class="r1">Included in:</dt>
<dd class="r1"><span class='object_link'><a href="Compiler.html" title="Sass::Plugin::Compiler (class)">Compiler</a></span></dd>
<dt class="r2 last">Defined in:</dt>
<dd class="r2 last">.ruby-sass/lib/sass/plugin/configuration.rb</dd>
</dl>
<div class="clear"></div>
<h2>Overview</h2><div class="docstring">
<div class="discussion">
<p>We keep configuration in its own self-contained file so that we can load it
independently in Rails 3, where the full plugin stuff is lazy-loaded.</p>
<p>Note that this is not guaranteed to be thread-safe. For guaranteed thread
safety, use a separate <span class='object_link'><a href="../Plugin.html" title="Sass::Plugin (module)">Sass::Plugin</a></span> for each thread.</p>
</div>
</div>
<div class="tags">
</div>
<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="#add_template_location-instance_method" title="#add_template_location (instance method)">#<strong>add_template_location</strong>(template_location, css_location = options[:css_location]) &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Adds a new template-location/css-location mapping.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#default_options-instance_method" title="#default_options (instance method)">#<strong>default_options</strong> &#x21d2; {Symbol =&gt; Object} </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Returns the default options for a <span class='object_link'><a href="Compiler.html" title="Sass::Plugin::Compiler (class)">Compiler</a></span>.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#options-instance_method" title="#options (instance method)">#<strong>options</strong> &#x21d2; {Symbol =&gt; Object} </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>An options hash.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#remove_template_location-instance_method" title="#remove_template_location (instance method)">#<strong>remove_template_location</strong>(template_location, css_location = options[:css_location]) &#x21d2; Boolean </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Removes a template-location/css-location mapping.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#reset!-instance_method" title="#reset! (instance method)">#<strong>reset!</strong> &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Resets the options and <span class='object_link'><a href="../Callbacks/InstanceMethods.html#clear_callbacks!-instance_method" title="Sass::Callbacks::InstanceMethods#clear_callbacks! (method)">clears all callbacks</a></span>.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#template_location_array-instance_method" title="#template_location_array (instance method)">#<strong>template_location_array</strong> &#x21d2; Array&lt;(String, String)&gt; </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Returns the template locations configured for Sass as an array of
`[template_location, css_location]` pairs.</p>
</div></span>
</li>
</ul>
<div id="instance_method_details" class="method_details_list">
<h2>Instance Method Details</h2>
<div class="method_details first">
<h3 class="signature first" id="add_template_location-instance_method">
#<strong>add_template_location</strong>(template_location, css_location = options[:css_location]) &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Adds a new template-location/css-location mapping. This means that
Sass/SCSS files in `template_location` will be compiled to CSS files in
`css_location`.</p>
<p>This is preferred over manually manipulating the
<a href="../../file.SASS_REFERENCE.html#template_location-option" title="`:template_location` option">`:template_location` option</a> since the option can be in multiple formats.</p>
<p>Note that this method will change `<a
href=":template_location">options</a>` to be in the Array format. This
means that even if `<a href=":template_location">options</a>` had
previously been a Hash or a String, it will now be an Array.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>template_location</span>
<span class='type'>(<tt>String</tt>)</span>
&mdash;
<div class='inline'>
<p>The location where Sass/SCSS files will be.</p>
</div>
</li>
<li>
<span class='name'>css_location</span>
<span class='type'>(<tt>String</tt>)</span>
<em class="default">(defaults to: <tt>options[:css_location]</tt>)</em>
&mdash;
<div class='inline'>
<p>The location where compiled CSS files will go.</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
53
54
55
56</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/plugin/configuration.rb', line 53</span>
<span class='kw'>def</span> <span class='id identifier rubyid_add_template_location'>add_template_location</span><span class='lparen'>(</span><span class='id identifier rubyid_template_location'>template_location</span><span class='comma'>,</span> <span class='id identifier rubyid_css_location'>css_location</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:css_location</span><span class='rbracket'>]</span><span class='rparen'>)</span>
<span class='id identifier rubyid_normalize_template_location!'>normalize_template_location!</span>
<span class='id identifier rubyid_template_location_array'>template_location_array</span> <span class='op'>&lt;&lt;</span> <span class='lbracket'>[</span><span class='id identifier rubyid_template_location'>template_location</span><span class='comma'>,</span> <span class='id identifier rubyid_css_location'>css_location</span><span class='rbracket'>]</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="default_options-instance_method">
#<strong>default_options</strong> &#x21d2; <tt>{Symbol =&gt; Object}</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns the default options for a <span class='object_link'><a href="Compiler.html" title="Sass::Plugin::Compiler (class)">Sass::Plugin::Compiler</a></span>.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>{Symbol =&gt; Object}</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
12
13
14
15
16
17
18
19
20</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/plugin/configuration.rb', line 12</span>
<span class='kw'>def</span> <span class='id identifier rubyid_default_options'>default_options</span>
<span class='ivar'>@default_options</span> <span class='op'>||=</span> <span class='lbrace'>{</span>
<span class='symbol'>:css_location</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>./public/stylesheets</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='symbol'>:always_update</span> <span class='op'>=&gt;</span> <span class='kw'>false</span><span class='comma'>,</span>
<span class='symbol'>:always_check</span> <span class='op'>=&gt;</span> <span class='kw'>true</span><span class='comma'>,</span>
<span class='symbol'>:full_exception</span> <span class='op'>=&gt;</span> <span class='kw'>true</span><span class='comma'>,</span>
<span class='symbol'>:cache_location</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>.sass-cache</span><span class='tstring_end'>&quot;</span></span>
<span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="options-instance_method">
#<strong>options</strong> &#x21d2; <tt>{Symbol =&gt; Object}</tt>
</h3><div class="docstring">
<div class="discussion">
<p>An options hash. See <a href="../../file.SASS_REFERENCE.html#Options" title="the Sass options documentation">the Sass options documentation</a>.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>{Symbol =&gt; Object}</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
33
34
35</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/plugin/configuration.rb', line 33</span>
<span class='kw'>def</span> <span class='id identifier rubyid_options'>options</span>
<span class='ivar'>@options</span> <span class='op'>||=</span> <span class='id identifier rubyid_default_options'>default_options</span><span class='period'>.</span><span class='id identifier rubyid_dup'>dup</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="remove_template_location-instance_method">
#<strong>remove_template_location</strong>(template_location, css_location = options[:css_location]) &#x21d2; <tt>Boolean</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Removes a template-location/css-location mapping. This means that Sass/SCSS
files in `template_location` will no longer be compiled to CSS files in
`css_location`.</p>
<p>This is preferred over manually manipulating the
<a href="../../file.SASS_REFERENCE.html#template_location-option" title="`:template_location` option">`:template_location` option</a> since the option can be in multiple formats.</p>
<p>Note that this method will change `<a
href=":template_location">options</a>` to be in the Array format. This
means that even if `<a href=":template_location">options</a>` had
previously been a Hash or a String, it will now be an Array.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>template_location</span>
<span class='type'>(<tt>String</tt>)</span>
&mdash;
<div class='inline'>
<p>The location where Sass/SCSS files were, which is now going to be ignored.</p>
</div>
</li>
<li>
<span class='name'>css_location</span>
<span class='type'>(<tt>String</tt>)</span>
<em class="default">(defaults to: <tt>options[:css_location]</tt>)</em>
&mdash;
<div class='inline'>
<p>The location where compiled CSS files went, but will no longer go.</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>Non-`nil` if the given mapping already existed and was removed, or `nil` if
nothing was changed.</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
80
81
82
83</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/plugin/configuration.rb', line 80</span>
<span class='kw'>def</span> <span class='id identifier rubyid_remove_template_location'>remove_template_location</span><span class='lparen'>(</span><span class='id identifier rubyid_template_location'>template_location</span><span class='comma'>,</span> <span class='id identifier rubyid_css_location'>css_location</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:css_location</span><span class='rbracket'>]</span><span class='rparen'>)</span>
<span class='id identifier rubyid_normalize_template_location!'>normalize_template_location!</span>
<span class='id identifier rubyid_template_location_array'>template_location_array</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='id identifier rubyid_template_location'>template_location</span><span class='comma'>,</span> <span class='id identifier rubyid_css_location'>css_location</span><span class='rbracket'>]</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="reset!-instance_method">
#<strong>reset!</strong> &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Resets the options and <span class='object_link'><a href="../Callbacks/InstanceMethods.html#clear_callbacks!-instance_method" title="Sass::Callbacks::InstanceMethods#clear_callbacks! (method)">clears all callbacks</a></span>.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
24
25
26
27</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/plugin/configuration.rb', line 24</span>
<span class='kw'>def</span> <span class='id identifier rubyid_reset!'>reset!</span>
<span class='ivar'>@options</span> <span class='op'>=</span> <span class='kw'>nil</span>
<span class='id identifier rubyid_clear_callbacks!'>clear_callbacks!</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="template_location_array-instance_method">
#<strong>template_location_array</strong> &#x21d2; <tt>Array&lt;(String, String)&gt;</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns the template locations configured for Sass as an array of
`[template_location, css_location]` pairs. See the
<a href="../../file.SASS_REFERENCE.html#template_location-option" title="`:template_location` option">`:template_location` option</a> for details.</p>
<p>Modifications to the returned array may not be persistent. Use
<span class='object_link'><a href="#add_template_location-instance_method" title="Sass::Plugin::Configuration#add_template_location (method)">#add_template_location</a></span> and <span class='object_link'><a href="#remove_template_location-instance_method" title="Sass::Plugin::Configuration#remove_template_location (method)">#remove_template_location</a></span> instead.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Array&lt;(String, String)&gt;</tt>)</span>
&mdash;
<div class='inline'>
<p>An array of `[template_location, css_location]` pairs.</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/configuration.rb', line 95</span>
<span class='kw'>def</span> <span class='id identifier rubyid_template_location_array'>template_location_array</span>
<span class='id identifier rubyid_convert_template_location'>convert_template_location</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:template_location</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:css_location</span><span class='rbracket'>]</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:49 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>