spec/support/fixtures/app-deeper.html in sinatra-exstatic-assets-3.0.0 vs spec/support/fixtures/app-deeper.html in sinatra-exstatic-assets-3.1.0

- old
+ new

@@ -48,17 +48,36 @@ <p>Use these helpers in your views.<p> <section id='stylesheet_tag'> <header> <h3>stylesheet_tag</h3> </header> - <p>The code: - </p> - <code>stylesheet_tag "/css/screen.css"</code> - <p>Output:</p> - <samp> - &lt;link charset=&quot;utf-8&quot; href=&quot;&#x2F;css&#x2F;screen.css?ts=1367612251&quot; media=&quot;screen&quot; rel=&quot;stylesheet&quot; &#x2F;&gt; - </samp> + <section> + <h3>Default use:</h3> + <p>By default, the querystring is appended with parameter of "ts" (for <strong>t</strong>ime<strong>s</strong>tamp) and the mtime of the file. + <p>The code: + </p> + <code>stylesheet_tag "/css/screen.css"</code> + <p>Output:</p> + <samp> + &lt;link charset=&quot;utf-8&quot; href=&quot;&#x2F;css&#x2F;screen.css?ts=1367612251&quot; media=&quot;screen&quot; rel=&quot;stylesheet&quot; &#x2F;&gt; + </samp> + </section> + <section> + <h3>Alternative timestamp format</h3> + <p>You can choose to take an SHA1 of the file instead:</p> + <code>stylesheet_tag "/css/screen.css", timestamp_format: :sha1</code> + <p>Output:</p> + <samp> + &lt;link charset=&quot;utf-8&quot; href=&quot;&#x2F;css&#x2F;screen.css?ts=702cc1975cea5e2e6558680532502615c01e762a&quot; media=&quot;screen&quot; rel=&quot;stylesheet&quot; &#x2F;&gt; + </samp> + <p>To set the timestamp for all calls, use the settings object:</p> + <code>set :timestamp_format, :sha1</code> + <p>It's set to :mtime_int by default. The timestamp formatting applies to all method calls (except for favicon, because favicons aren't cached in the same manner) but can be overridden by including the option in the method call e.g.</p> + <code>set :timestamp_format, :sha1</code> + <code>stylesheet_tag "/css/screen.css", timestamp_format: :mtime_int</code> + <p>Would mean that the resultant stylesheet would have an SHA1 string appended, but other method calls without the "timestamp_format: :mtime_int" would have an mtime appended.</p> + </section> <footer><p>Also known as: <ul> <li><code>css_tag</code></li> <li><code>stylesheet</code></li> </ul> @@ -66,16 +85,20 @@ </section> <section id='javascript_tag'> <header> <h3>javascript_tag</h3> </header> - <p>The code: - </p> - <code>javascript_tag "http://code.jquery.com/jquery-1.9.1.min.js"</code> - <p>Output:</p> - <samp> - &lt;script charset=&quot;utf-8&quot; src=&quot;http:&#x2F;&#x2F;code.jquery.com&#x2F;jquery-1.9.1.min.js&quot;&gt;&lt;&#x2F;script&gt; - </samp> + <section> + <h3>Using a URL</h3> + <p>The code: + </p> + <code>javascript_tag "http://code.jquery.com/jquery-1.9.1.min.js"</code> + <p>Output:</p> + <samp> + &lt;script charset=&quot;utf-8&quot; src=&quot;http:&#x2F;&#x2F;code.jquery.com&#x2F;jquery-1.9.1.min.js&quot;&gt;&lt;&#x2F;script&gt; + </samp> + <p>When a URL is given, no timestamp is appended. If the javascript was a file, then like stylesheet_tag above, it would have a timestamp appended.</p> + </section> <footer><p>Also known as: <ul> <li><code>javascript_include_tag</code></li> <li><code>js_tag</code></li> <li><code>script_tag</code></li>