doc/classes/AssetHat/CSS.html in asset_hat-0.2.0 vs doc/classes/AssetHat/CSS.html in asset_hat-0.2.1

- old
+ new

@@ -119,20 +119,20 @@ <tt>config/environments/production.rb</tt>. </li> </ul> <p> - An asset host is added to every asset URL in the <a + An asset host is added to every image URL in the <a href="CSS.html">CSS</a>, e.g., <tt>background: url(http://assets2.example.com/images/foo.png)</tt>; if <tt>%d</tt> in the asset host, it is replaced with an arbitrary number in 0-3, inclusive. </p> </div> <div class='source'> <a class='source-toggle' href='#' onclick="toggleCode('M000015-source'); return false"> [show source] </a> - <pre id='M000015-source'> <span class="ruby-comment cmt"># File lib/asset_hat/css.rb, line 70</span>&#x000A;70: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">add_asset_hosts</span>(<span class="ruby-identifier">css</span>, <span class="ruby-identifier">asset_host</span>)&#x000A;71: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">asset_host</span>.<span class="ruby-identifier">blank?</span>&#x000A;72: <span class="ruby-identifier">css</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/url[\s]*\((\/(images|htc)\/[^)]+)\)/</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">match</span><span class="ruby-operator">|</span>&#x000A;73: <span class="ruby-identifier">src</span> = <span class="ruby-identifier">$1</span>&#x000A;74: <span class="ruby-node">&quot;url(#{(asset_host =~ /%d/) ? asset_host % (src.hash % 4) : asset_host}#{src})&quot;</span>&#x000A;75: <span class="ruby-keyword kw">end</span>&#x000A;76: <span class="ruby-keyword kw">end</span></pre> + <pre id='M000015-source'> <span class="ruby-comment cmt"># File lib/asset_hat/css.rb, line 70</span>&#x000A;70: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">add_asset_hosts</span>(<span class="ruby-identifier">css</span>, <span class="ruby-identifier">asset_host</span>)&#x000A;71: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">asset_host</span>.<span class="ruby-identifier">blank?</span>&#x000A;72: <span class="ruby-identifier">css</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/url[\s]*\((\/images\/[^)]+)\)/</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">match</span><span class="ruby-operator">|</span>&#x000A;73: <span class="ruby-comment cmt"># N.B.: The `/htc/` directory is excluded because IE 6, by default,</span>&#x000A;74: <span class="ruby-comment cmt"># refuses to run .htc files (e.g., TwinHelix's iepngfix.htc) from</span>&#x000A;75: <span class="ruby-comment cmt"># other domains, including CDN subdomains.</span>&#x000A;76: <span class="ruby-identifier">src</span> = <span class="ruby-identifier">$1</span>&#x000A;77: <span class="ruby-node">&quot;url(#{(asset_host =~ /%d/) ? asset_host % (src.hash % 4) : asset_host}#{src})&quot;</span>&#x000A;78: <span class="ruby-keyword kw">end</span>&#x000A;79: <span class="ruby-keyword kw">end</span></pre> </div> </div> <div class='method public-class' id='method-M000012'> <a name='M000012'></a> <div class='synopsis'>