Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
6f41bb3ce1 | ||
|
bfa2cdee78 | ||
|
9176cc2db8 | ||
|
f89aedb272 | ||
|
f65cc3398e | ||
|
1a71b574b6 | ||
|
d2ad7aab89 | ||
|
d4925e9d0d | ||
|
8a18bd7e2d |
436
rdoc/FastImage.html
Normal file
@ -0,0 +1,436 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
||||||
|
|
||||||
|
<title>class FastImage - RDoc Documentation</title>
|
||||||
|
|
||||||
|
<link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet">
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
var rdoc_rel_prefix = "./";
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/javascript" charset="utf-8" src="./js/jquery.js"></script>
|
||||||
|
<script type="text/javascript" charset="utf-8" src="./js/navigation.js"></script>
|
||||||
|
<script type="text/javascript" charset="utf-8" src="./js/search_index.js"></script>
|
||||||
|
<script type="text/javascript" charset="utf-8" src="./js/search.js"></script>
|
||||||
|
<script type="text/javascript" charset="utf-8" src="./js/searcher.js"></script>
|
||||||
|
<script type="text/javascript" charset="utf-8" src="./js/darkfish.js"></script>
|
||||||
|
|
||||||
|
|
||||||
|
<body id="top" class="class">
|
||||||
|
<nav id="metadata">
|
||||||
|
<nav id="home-section" class="section">
|
||||||
|
<h3 class="section-header">
|
||||||
|
<a href="./index.html">Home</a>
|
||||||
|
<a href="./table_of_contents.html#classes">Classes</a>
|
||||||
|
<a href="./table_of_contents.html#methods">Methods</a>
|
||||||
|
</h3>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
|
||||||
|
<nav id="search-section" class="section project-section" class="initially-hidden">
|
||||||
|
<form action="#" method="get" accept-charset="utf-8">
|
||||||
|
<h3 class="section-header">
|
||||||
|
<input type="text" name="search" placeholder="Search" id="search-field"
|
||||||
|
title="Type to search, Up and Down to navigate, Enter to load">
|
||||||
|
</h3>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<ul id="search-results" class="initially-hidden"></ul>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div id="file-metadata">
|
||||||
|
<nav id="file-list-section" class="section">
|
||||||
|
<h3 class="section-header">Defined In</h3>
|
||||||
|
<ul>
|
||||||
|
<li>lib/fastimage.rb
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="class-metadata">
|
||||||
|
|
||||||
|
<nav id="parent-class-section" class="section">
|
||||||
|
<h3 class="section-header">Parent</h3>
|
||||||
|
|
||||||
|
<p class="link">Object
|
||||||
|
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Method Quickref -->
|
||||||
|
<nav id="method-list-section" class="section">
|
||||||
|
<h3 class="section-header">Methods</h3>
|
||||||
|
|
||||||
|
<ul class="link-list">
|
||||||
|
|
||||||
|
<li ><a href="#method-c-new">::new</a>
|
||||||
|
|
||||||
|
<li ><a href="#method-c-size">::size</a>
|
||||||
|
|
||||||
|
<li ><a href="#method-c-type">::type</a>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="project-metadata">
|
||||||
|
|
||||||
|
<nav id="classindex-section" class="section project-section">
|
||||||
|
<h3 class="section-header">Class and Module Index</h3>
|
||||||
|
|
||||||
|
<ul class="link-list">
|
||||||
|
|
||||||
|
<li><a href="./FastImage.html">FastImage</a>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
<div id="documentation">
|
||||||
|
<h1 class="class">class FastImage</h1>
|
||||||
|
|
||||||
|
<div id="description" class="description">
|
||||||
|
|
||||||
|
</div><!-- description -->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<section id="5Buntitled-5D" class="documentation-section">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Constants -->
|
||||||
|
<section id="constants-list" class="section">
|
||||||
|
<h3 class="section-header">Constants</h3>
|
||||||
|
<dl>
|
||||||
|
|
||||||
|
<dt id="DefaultTimeout">DefaultTimeout
|
||||||
|
|
||||||
|
<dd class="description">
|
||||||
|
|
||||||
|
|
||||||
|
<dt id="LocalFileChunkSize">LocalFileChunkSize
|
||||||
|
|
||||||
|
<dd class="description">
|
||||||
|
|
||||||
|
|
||||||
|
</dl>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Attributes -->
|
||||||
|
<section id="attribute-method-details" class="method-section section">
|
||||||
|
<h3 class="section-header">Attributes</h3>
|
||||||
|
|
||||||
|
|
||||||
|
<div id="attribute-i-bytes_read" class="method-detail">
|
||||||
|
<div class="method-heading attribute-method-heading">
|
||||||
|
<span class="method-name">bytes_read</span><span
|
||||||
|
class="attribute-access-type">[R]</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="method-description">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="attribute-i-size" class="method-detail">
|
||||||
|
<div class="method-heading attribute-method-heading">
|
||||||
|
<span class="method-name">size</span><span
|
||||||
|
class="attribute-access-type">[R]</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="method-description">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="attribute-i-type" class="method-detail">
|
||||||
|
<div class="method-heading attribute-method-heading">
|
||||||
|
<span class="method-name">type</span><span
|
||||||
|
class="attribute-access-type">[R]</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="method-description">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</section><!-- attribute-method-details -->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Methods -->
|
||||||
|
|
||||||
|
<section id="public-class-5Buntitled-5D-method-details" class="method-section section">
|
||||||
|
<h3 class="section-header">Public Class Methods</h3>
|
||||||
|
|
||||||
|
|
||||||
|
<div id="method-c-new" class="method-detail ">
|
||||||
|
|
||||||
|
<div class="method-heading">
|
||||||
|
<span class="method-name">new</span><span
|
||||||
|
class="method-args">(uri, options={})</span>
|
||||||
|
|
||||||
|
<span class="method-click-advice">click to toggle source</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="method-description">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="method-source-code" id="new-source">
|
||||||
|
<pre><span class="ruby-comment"># File lib/fastimage.rb, line 157</span>
|
||||||
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">uri</span>, <span class="ruby-identifier">options</span>={})
|
||||||
|
<span class="ruby-ivar">@property</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value">:type_only</span>] <span class="ruby-operator">?</span> <span class="ruby-value">:type</span> <span class="ruby-operator">:</span> <span class="ruby-value">:size</span>
|
||||||
|
<span class="ruby-ivar">@timeout</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value">:timeout</span>] <span class="ruby-operator">||</span> <span class="ruby-constant">DefaultTimeout</span>
|
||||||
|
<span class="ruby-ivar">@uri</span> = <span class="ruby-identifier">uri</span>
|
||||||
|
|
||||||
|
<span class="ruby-keyword">if</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value">:read</span>)
|
||||||
|
<span class="ruby-identifier">fetch_using_read</span>(<span class="ruby-identifier">uri</span>)
|
||||||
|
<span class="ruby-keyword">else</span>
|
||||||
|
<span class="ruby-keyword">begin</span>
|
||||||
|
<span class="ruby-ivar">@parsed_uri</span> = <span class="ruby-constant">Addressable</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">uri</span>)
|
||||||
|
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">Addressable</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span><span class="ruby-operator">::</span><span class="ruby-constant">InvalidURIError</span>
|
||||||
|
<span class="ruby-identifier">fetch_using_open_uri</span>
|
||||||
|
<span class="ruby-keyword">else</span>
|
||||||
|
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@parsed_uri</span>.<span class="ruby-identifier">scheme</span> <span class="ruby-operator">==</span> <span class="ruby-string">"http"</span> <span class="ruby-operator">||</span> <span class="ruby-ivar">@parsed_uri</span>.<span class="ruby-identifier">scheme</span> <span class="ruby-operator">==</span> <span class="ruby-string">"https"</span>
|
||||||
|
<span class="ruby-identifier">fetch_using_http</span>
|
||||||
|
<span class="ruby-keyword">else</span>
|
||||||
|
<span class="ruby-identifier">fetch_using_open_uri</span>
|
||||||
|
<span class="ruby-keyword">end</span>
|
||||||
|
<span class="ruby-keyword">end</span>
|
||||||
|
<span class="ruby-keyword">end</span>
|
||||||
|
|
||||||
|
<span class="ruby-identifier">uri</span>.<span class="ruby-identifier">rewind</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value">:rewind</span>)
|
||||||
|
|
||||||
|
<span class="ruby-identifier">raise</span> <span class="ruby-constant">SizeNotFound</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-value">:raise_on_failure</span>] <span class="ruby-operator">&&</span> <span class="ruby-ivar">@property</span> <span class="ruby-operator">==</span> <span class="ruby-value">:size</span> <span class="ruby-operator">&&</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@size</span>
|
||||||
|
|
||||||
|
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">Timeout</span><span class="ruby-operator">::</span><span class="ruby-constant">Error</span>, <span class="ruby-constant">SocketError</span>, <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">ECONNREFUSED</span>, <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">EHOSTUNREACH</span>, <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">ECONNRESET</span>,
|
||||||
|
<span class="ruby-constant">ImageFetchFailure</span>, <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTPBadResponse</span>, <span class="ruby-constant">EOFError</span>, <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">ENOENT</span>
|
||||||
|
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ImageFetchFailure</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-value">:raise_on_failure</span>]
|
||||||
|
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">NoMethodError</span> <span class="ruby-comment"># 1.8.7p248 can raise this due to a net/http bug</span>
|
||||||
|
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ImageFetchFailure</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-value">:raise_on_failure</span>]
|
||||||
|
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">UnknownImageType</span>
|
||||||
|
<span class="ruby-identifier">raise</span> <span class="ruby-constant">UnknownImageType</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-value">:raise_on_failure</span>]
|
||||||
|
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">CannotParseImage</span>
|
||||||
|
<span class="ruby-keyword">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-value">:raise_on_failure</span>]
|
||||||
|
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@property</span> <span class="ruby-operator">==</span> <span class="ruby-value">:size</span>
|
||||||
|
<span class="ruby-identifier">raise</span> <span class="ruby-constant">SizeNotFound</span>
|
||||||
|
<span class="ruby-keyword">else</span>
|
||||||
|
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ImageFetchFailure</span>
|
||||||
|
<span class="ruby-keyword">end</span>
|
||||||
|
<span class="ruby-keyword">end</span>
|
||||||
|
|
||||||
|
<span class="ruby-keyword">end</span></pre>
|
||||||
|
</div><!-- new-source -->
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div><!-- new-method -->
|
||||||
|
|
||||||
|
|
||||||
|
<div id="method-c-size" class="method-detail ">
|
||||||
|
|
||||||
|
<div class="method-heading">
|
||||||
|
<span class="method-name">size</span><span
|
||||||
|
class="method-args">(uri, options={})</span>
|
||||||
|
|
||||||
|
<span class="method-click-advice">click to toggle source</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="method-description">
|
||||||
|
|
||||||
|
<p>Returns an array containing the width and height of the image. It will
|
||||||
|
return nil if the image could not be fetched, or if the image type was not
|
||||||
|
recognised.</p>
|
||||||
|
|
||||||
|
<p>By default there is a timeout of 2 seconds for opening and reading from a
|
||||||
|
remote server. This can be changed by passing a :timeout =>
|
||||||
|
number_of_seconds in the options.</p>
|
||||||
|
|
||||||
|
<p>If you wish <a href="FastImage.html">FastImage</a> to raise if it cannot
|
||||||
|
size the image for any reason, then pass :raise_on_failure => true in
|
||||||
|
the options.</p>
|
||||||
|
|
||||||
|
<p><a href="FastImage.html">FastImage</a> knows about GIF, JPEG, BMP, TIFF,
|
||||||
|
PNG and PSD files.</p>
|
||||||
|
|
||||||
|
<h3 id="method-c-size-label-Example">Example<span><a href="#method-c-size-label-Example">¶</a> <a href="#documentation">↑</a></span></h3>
|
||||||
|
|
||||||
|
<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">'fastimage'</span>
|
||||||
|
|
||||||
|
<span class="ruby-constant">FastImage</span>.<span class="ruby-identifier">size</span>(<span class="ruby-string">"http://stephensykes.com/images/ss.com_x.gif"</span>)
|
||||||
|
=<span class="ruby-operator">></span> [<span class="ruby-value">266</span>, <span class="ruby-value">56</span>]
|
||||||
|
<span class="ruby-constant">FastImage</span>.<span class="ruby-identifier">size</span>(<span class="ruby-string">"http://stephensykes.com/images/pngimage"</span>)
|
||||||
|
=<span class="ruby-operator">></span> [<span class="ruby-value">16</span>, <span class="ruby-value">16</span>]
|
||||||
|
<span class="ruby-constant">FastImage</span>.<span class="ruby-identifier">size</span>(<span class="ruby-string">"http://farm4.static.flickr.com/3023/3047236863_9dce98b836.jpg"</span>)
|
||||||
|
=<span class="ruby-operator">></span> [<span class="ruby-value">500</span>, <span class="ruby-value">375</span>]
|
||||||
|
<span class="ruby-constant">FastImage</span>.<span class="ruby-identifier">size</span>(<span class="ruby-string">"http://www-ece.rice.edu/~wakin/images/lena512.bmp"</span>)
|
||||||
|
=<span class="ruby-operator">></span> [<span class="ruby-value">512</span>, <span class="ruby-value">512</span>]
|
||||||
|
<span class="ruby-constant">FastImage</span>.<span class="ruby-identifier">size</span>(<span class="ruby-string">"test/fixtures/test.jpg"</span>)
|
||||||
|
=<span class="ruby-operator">></span> [<span class="ruby-value">882</span>, <span class="ruby-value">470</span>]
|
||||||
|
<span class="ruby-constant">FastImage</span>.<span class="ruby-identifier">size</span>(<span class="ruby-string">"http://pennysmalls.com/does_not_exist"</span>)
|
||||||
|
=<span class="ruby-operator">></span> <span class="ruby-keyword">nil</span>
|
||||||
|
<span class="ruby-constant">FastImage</span>.<span class="ruby-identifier">size</span>(<span class="ruby-string">"http://pennysmalls.com/does_not_exist"</span>, :<span class="ruby-identifier">raise_on_failure=</span><span class="ruby-operator">></span><span class="ruby-keyword">true</span>)
|
||||||
|
=<span class="ruby-operator">></span> <span class="ruby-identifier">raises</span> <span class="ruby-constant">FastImage</span><span class="ruby-operator">::</span><span class="ruby-constant">ImageFetchFailure</span>
|
||||||
|
<span class="ruby-constant">FastImage</span>.<span class="ruby-identifier">size</span>(<span class="ruby-string">"http://stephensykes.com/favicon.ico"</span>, :<span class="ruby-identifier">raise_on_failure=</span><span class="ruby-operator">></span><span class="ruby-keyword">true</span>)
|
||||||
|
=<span class="ruby-operator">></span> <span class="ruby-identifier">raises</span> <span class="ruby-constant">FastImage</span><span class="ruby-operator">::</span><span class="ruby-constant">UnknownImageType</span>
|
||||||
|
<span class="ruby-constant">FastImage</span>.<span class="ruby-identifier">size</span>(<span class="ruby-string">"http://stephensykes.com/favicon.ico"</span>, :<span class="ruby-identifier">raise_on_failure=</span><span class="ruby-operator">></span><span class="ruby-keyword">true</span>, :<span class="ruby-identifier">timeout=</span><span class="ruby-operator">></span><span class="ruby-value">0.01</span>)
|
||||||
|
=<span class="ruby-operator">></span> <span class="ruby-identifier">raises</span> <span class="ruby-constant">FastImage</span><span class="ruby-operator">::</span><span class="ruby-constant">ImageFetchFailure</span>
|
||||||
|
<span class="ruby-constant">FastImage</span>.<span class="ruby-identifier">size</span>(<span class="ruby-string">"http://stephensykes.com/images/faulty.jpg"</span>, :<span class="ruby-identifier">raise_on_failure=</span><span class="ruby-operator">></span><span class="ruby-keyword">true</span>)
|
||||||
|
=<span class="ruby-operator">></span> <span class="ruby-identifier">raises</span> <span class="ruby-constant">FastImage</span><span class="ruby-operator">::</span><span class="ruby-constant">SizeNotFound</span>
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
<h3 id="method-c-size-label-Supported+options">Supported options<span><a href="#method-c-size-label-Supported+options">¶</a> <a href="#documentation">↑</a></span></h3>
|
||||||
|
<dl class="rdoc-list label-list"><dt>:timeout
|
||||||
|
<dd>
|
||||||
|
<p>Overrides the default timeout of 2 seconds. Applies both to reading from
|
||||||
|
and opening the http connection.</p>
|
||||||
|
</dd><dt>:raise_on_failure
|
||||||
|
<dd>
|
||||||
|
<p>If set to true causes an exception to be raised if the image size cannot be
|
||||||
|
found for any reason.</p>
|
||||||
|
</dd></dl>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="method-source-code" id="size-source">
|
||||||
|
<pre><span class="ruby-comment"># File lib/fastimage.rb, line 111</span>
|
||||||
|
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">size</span>(<span class="ruby-identifier">uri</span>, <span class="ruby-identifier">options</span>={})
|
||||||
|
<span class="ruby-identifier">new</span>(<span class="ruby-identifier">uri</span>, <span class="ruby-identifier">options</span>).<span class="ruby-identifier">size</span>
|
||||||
|
<span class="ruby-keyword">end</span></pre>
|
||||||
|
</div><!-- size-source -->
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div><!-- size-method -->
|
||||||
|
|
||||||
|
|
||||||
|
<div id="method-c-type" class="method-detail ">
|
||||||
|
|
||||||
|
<div class="method-heading">
|
||||||
|
<span class="method-name">type</span><span
|
||||||
|
class="method-args">(uri, options={})</span>
|
||||||
|
|
||||||
|
<span class="method-click-advice">click to toggle source</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="method-description">
|
||||||
|
|
||||||
|
<p>Returns an symbol indicating the image type fetched from a uri. It will
|
||||||
|
return nil if the image could not be fetched, or if the image type was not
|
||||||
|
recognised.</p>
|
||||||
|
|
||||||
|
<p>By default there is a timeout of 2 seconds for opening and reading from a
|
||||||
|
remote server. This can be changed by passing a :timeout =>
|
||||||
|
number_of_seconds in the options.</p>
|
||||||
|
|
||||||
|
<p>If you wish <a href="FastImage.html">FastImage</a> to raise if it cannot
|
||||||
|
find the type of the image for any reason, then pass :raise_on_failure
|
||||||
|
=> true in the options.</p>
|
||||||
|
|
||||||
|
<h3 id="method-c-type-label-Example">Example<span><a href="#method-c-type-label-Example">¶</a> <a href="#documentation">↑</a></span></h3>
|
||||||
|
|
||||||
|
<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">'fastimage'</span>
|
||||||
|
|
||||||
|
<span class="ruby-constant">FastImage</span>.<span class="ruby-identifier">type</span>(<span class="ruby-string">"http://stephensykes.com/images/ss.com_x.gif"</span>)
|
||||||
|
=<span class="ruby-operator">></span> :<span class="ruby-identifier">gif</span>
|
||||||
|
<span class="ruby-constant">FastImage</span>.<span class="ruby-identifier">type</span>(<span class="ruby-string">"http://stephensykes.com/images/pngimage"</span>)
|
||||||
|
=<span class="ruby-operator">></span> :<span class="ruby-identifier">png</span>
|
||||||
|
<span class="ruby-constant">FastImage</span>.<span class="ruby-identifier">type</span>(<span class="ruby-string">"http://farm4.static.flickr.com/3023/3047236863_9dce98b836.jpg"</span>)
|
||||||
|
=<span class="ruby-operator">></span> :<span class="ruby-identifier">jpeg</span>
|
||||||
|
<span class="ruby-constant">FastImage</span>.<span class="ruby-identifier">type</span>(<span class="ruby-string">"http://www-ece.rice.edu/~wakin/images/lena512.bmp"</span>)
|
||||||
|
=<span class="ruby-operator">></span> :<span class="ruby-identifier">bmp</span>
|
||||||
|
<span class="ruby-constant">FastImage</span>.<span class="ruby-identifier">type</span>(<span class="ruby-string">"test/fixtures/test.jpg"</span>)
|
||||||
|
=<span class="ruby-operator">></span> :<span class="ruby-identifier">jpeg</span>
|
||||||
|
<span class="ruby-constant">FastImage</span>.<span class="ruby-identifier">type</span>(<span class="ruby-string">"http://pennysmalls.com/does_not_exist"</span>)
|
||||||
|
=<span class="ruby-operator">></span> <span class="ruby-keyword">nil</span>
|
||||||
|
<span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-string">"/some/local/file.gif"</span>, <span class="ruby-string">"r"</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">io</span><span class="ruby-operator">|</span> <span class="ruby-constant">FastImage</span>.<span class="ruby-identifier">type</span>(<span class="ruby-identifier">io</span>)}
|
||||||
|
=<span class="ruby-operator">></span> :<span class="ruby-identifier">gif</span>
|
||||||
|
<span class="ruby-constant">FastImage</span>.<span class="ruby-identifier">type</span>(<span class="ruby-string">"test/fixtures/test.tiff"</span>)
|
||||||
|
=<span class="ruby-operator">></span> :<span class="ruby-identifier">tiff</span>
|
||||||
|
<span class="ruby-constant">FastImage</span>.<span class="ruby-identifier">type</span>(<span class="ruby-string">"test/fixtures/test.psd"</span>)
|
||||||
|
=<span class="ruby-operator">></span> :<span class="ruby-identifier">psd</span>
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
<h3 id="method-c-type-label-Supported+options">Supported options<span><a href="#method-c-type-label-Supported+options">¶</a> <a href="#documentation">↑</a></span></h3>
|
||||||
|
<dl class="rdoc-list label-list"><dt>:timeout
|
||||||
|
<dd>
|
||||||
|
<p>Overrides the default timeout of 2 seconds. Applies both to reading from
|
||||||
|
and opening the http connection.</p>
|
||||||
|
</dd><dt>:raise_on_failure
|
||||||
|
<dd>
|
||||||
|
<p>If set to true causes an exception to be raised if the image type cannot be
|
||||||
|
found for any reason.</p>
|
||||||
|
</dd></dl>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="method-source-code" id="type-source">
|
||||||
|
<pre><span class="ruby-comment"># File lib/fastimage.rb, line 153</span>
|
||||||
|
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">type</span>(<span class="ruby-identifier">uri</span>, <span class="ruby-identifier">options</span>={})
|
||||||
|
<span class="ruby-identifier">new</span>(<span class="ruby-identifier">uri</span>, <span class="ruby-identifier">options</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-value">:type_only=</span><span class="ruby-operator">></span><span class="ruby-keyword">true</span>)).<span class="ruby-identifier">type</span>
|
||||||
|
<span class="ruby-keyword">end</span></pre>
|
||||||
|
</div><!-- type-source -->
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div><!-- type-method -->
|
||||||
|
|
||||||
|
|
||||||
|
</section><!-- public-class-method-details -->
|
||||||
|
|
||||||
|
</section><!-- 5Buntitled-5D -->
|
||||||
|
|
||||||
|
</div><!-- documentation -->
|
||||||
|
|
||||||
|
|
||||||
|
<footer id="validator-badges">
|
||||||
|
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
||||||
|
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 4.0.0.
|
||||||
|
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
||||||
|
</footer>
|
||||||
|
|
3
rdoc/created.rid
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
Wed, 29 Jan 2014 22:20:31 +0200
|
||||||
|
lib/fastimage.rb Wed, 29 Jan 2014 22:20:21 +0200
|
||||||
|
lib/fastimage/fbr.rb Wed, 08 May 2013 16:45:51 +0300
|
BIN
rdoc/images/add.png
Executable file
After Width: | Height: | Size: 733 B |
BIN
rdoc/images/arrow_up.png
Executable file
After Width: | Height: | Size: 372 B |
BIN
rdoc/images/brick.png
Normal file
After Width: | Height: | Size: 452 B |
BIN
rdoc/images/brick_link.png
Normal file
After Width: | Height: | Size: 764 B |
BIN
rdoc/images/bug.png
Normal file
After Width: | Height: | Size: 774 B |
BIN
rdoc/images/bullet_black.png
Normal file
After Width: | Height: | Size: 211 B |
BIN
rdoc/images/bullet_toggle_minus.png
Normal file
After Width: | Height: | Size: 207 B |
BIN
rdoc/images/bullet_toggle_plus.png
Normal file
After Width: | Height: | Size: 209 B |
BIN
rdoc/images/date.png
Normal file
After Width: | Height: | Size: 626 B |
BIN
rdoc/images/delete.png
Executable file
After Width: | Height: | Size: 715 B |
BIN
rdoc/images/find.png
Normal file
After Width: | Height: | Size: 659 B |
BIN
rdoc/images/loadingAnimation.gif
Normal file
After Width: | Height: | Size: 5.7 KiB |
BIN
rdoc/images/macFFBgHack.png
Normal file
After Width: | Height: | Size: 207 B |
BIN
rdoc/images/package.png
Normal file
After Width: | Height: | Size: 853 B |
BIN
rdoc/images/page_green.png
Normal file
After Width: | Height: | Size: 621 B |
BIN
rdoc/images/page_white_text.png
Normal file
After Width: | Height: | Size: 342 B |
BIN
rdoc/images/page_white_width.png
Normal file
After Width: | Height: | Size: 309 B |
BIN
rdoc/images/plugin.png
Normal file
After Width: | Height: | Size: 591 B |
BIN
rdoc/images/ruby.png
Normal file
After Width: | Height: | Size: 592 B |
BIN
rdoc/images/tag_blue.png
Executable file
After Width: | Height: | Size: 1.8 KiB |
BIN
rdoc/images/tag_green.png
Normal file
After Width: | Height: | Size: 613 B |
BIN
rdoc/images/transparent.png
Normal file
After Width: | Height: | Size: 97 B |
BIN
rdoc/images/wrench.png
Normal file
After Width: | Height: | Size: 610 B |
BIN
rdoc/images/wrench_orange.png
Normal file
After Width: | Height: | Size: 584 B |
BIN
rdoc/images/zoom.png
Normal file
After Width: | Height: | Size: 692 B |
71
rdoc/index.html
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
||||||
|
|
||||||
|
<title>RDoc Documentation</title>
|
||||||
|
|
||||||
|
<link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet">
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
var rdoc_rel_prefix = "./";
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/javascript" charset="utf-8" src="./js/jquery.js"></script>
|
||||||
|
<script type="text/javascript" charset="utf-8" src="./js/navigation.js"></script>
|
||||||
|
<script type="text/javascript" charset="utf-8" src="./js/search_index.js"></script>
|
||||||
|
<script type="text/javascript" charset="utf-8" src="./js/search.js"></script>
|
||||||
|
<script type="text/javascript" charset="utf-8" src="./js/searcher.js"></script>
|
||||||
|
<script type="text/javascript" charset="utf-8" src="./js/darkfish.js"></script>
|
||||||
|
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<nav id="metadata">
|
||||||
|
<nav id="home-section" class="section">
|
||||||
|
<h3 class="section-header">
|
||||||
|
<a href="./index.html">Home</a>
|
||||||
|
<a href="./table_of_contents.html#classes">Classes</a>
|
||||||
|
<a href="./table_of_contents.html#methods">Methods</a>
|
||||||
|
</h3>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
|
||||||
|
<nav id="search-section" class="section project-section" class="initially-hidden">
|
||||||
|
<form action="#" method="get" accept-charset="utf-8">
|
||||||
|
<h3 class="section-header">
|
||||||
|
<input type="text" name="search" placeholder="Search" id="search-field"
|
||||||
|
title="Type to search, Up and Down to navigate, Enter to load">
|
||||||
|
</h3>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<ul id="search-results" class="initially-hidden"></ul>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
|
||||||
|
<div id="project-metadata">
|
||||||
|
|
||||||
|
<nav id="classindex-section" class="section project-section">
|
||||||
|
<h3 class="section-header">Class and Module Index</h3>
|
||||||
|
|
||||||
|
<ul class="link-list">
|
||||||
|
|
||||||
|
<li><a href="./FastImage.html">FastImage</a>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
<div id="documentation" class="description">
|
||||||
|
<p>This is the API documentation for RDoc Documentation.
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<footer id="validator-badges">
|
||||||
|
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
||||||
|
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 4.0.0.
|
||||||
|
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
||||||
|
</footer>
|
||||||
|
|
155
rdoc/js/darkfish.js
Normal file
@ -0,0 +1,155 @@
|
|||||||
|
/**
|
||||||
|
*
|
||||||
|
* Darkfish Page Functions
|
||||||
|
* $Id: darkfish.js 53 2009-01-07 02:52:03Z deveiant $
|
||||||
|
*
|
||||||
|
* Author: Michael Granger <mgranger@laika.com>
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Provide console simulation for firebug-less environments */
|
||||||
|
if (!("console" in window) || !("firebug" in console)) {
|
||||||
|
var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml",
|
||||||
|
"group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
|
||||||
|
|
||||||
|
window.console = {};
|
||||||
|
for (var i = 0; i < names.length; ++i)
|
||||||
|
window.console[names[i]] = function() {};
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Unwrap the first element that matches the given @expr@ from the targets and return them.
|
||||||
|
*/
|
||||||
|
$.fn.unwrap = function( expr ) {
|
||||||
|
return this.each( function() {
|
||||||
|
$(this).parents( expr ).eq( 0 ).after( this ).remove();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
function showSource( e ) {
|
||||||
|
var target = e.target;
|
||||||
|
var codeSections = $(target).
|
||||||
|
parents('.method-detail').
|
||||||
|
find('.method-source-code');
|
||||||
|
|
||||||
|
$(target).
|
||||||
|
parents('.method-detail').
|
||||||
|
find('.method-source-code').
|
||||||
|
slideToggle();
|
||||||
|
};
|
||||||
|
|
||||||
|
function hookSourceViews() {
|
||||||
|
$('.method-heading').click( showSource );
|
||||||
|
};
|
||||||
|
|
||||||
|
function toggleDebuggingSection() {
|
||||||
|
$('.debugging-section').slideToggle();
|
||||||
|
};
|
||||||
|
|
||||||
|
function hookDebuggingToggle() {
|
||||||
|
$('#debugging-toggle img').click( toggleDebuggingSection );
|
||||||
|
};
|
||||||
|
|
||||||
|
function hookTableOfContentsToggle() {
|
||||||
|
$('.indexpage li .toc-toggle').each( function() {
|
||||||
|
$(this).click( function() {
|
||||||
|
$(this).toggleClass('open');
|
||||||
|
});
|
||||||
|
|
||||||
|
var section = $(this).next();
|
||||||
|
|
||||||
|
$(this).click( function() {
|
||||||
|
section.slideToggle();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function hookSearch() {
|
||||||
|
var input = $('#search-field').eq(0);
|
||||||
|
var result = $('#search-results').eq(0);
|
||||||
|
$(result).show();
|
||||||
|
|
||||||
|
var search_section = $('#search-section').get(0);
|
||||||
|
$(search_section).show();
|
||||||
|
|
||||||
|
var search = new Search(search_data, input, result);
|
||||||
|
|
||||||
|
search.renderItem = function(result) {
|
||||||
|
var li = document.createElement('li');
|
||||||
|
var html = '';
|
||||||
|
|
||||||
|
// TODO add relative path to <script> per-page
|
||||||
|
html += '<p class="search-match"><a href="' + rdoc_rel_prefix + result.path + '">' + this.hlt(result.title);
|
||||||
|
if (result.params)
|
||||||
|
html += '<span class="params">' + result.params + '</span>';
|
||||||
|
html += '</a>';
|
||||||
|
|
||||||
|
|
||||||
|
if (result.namespace)
|
||||||
|
html += '<p class="search-namespace">' + this.hlt(result.namespace);
|
||||||
|
|
||||||
|
if (result.snippet)
|
||||||
|
html += '<div class="search-snippet">' + result.snippet + '</div>';
|
||||||
|
|
||||||
|
li.innerHTML = html;
|
||||||
|
|
||||||
|
return li;
|
||||||
|
}
|
||||||
|
|
||||||
|
search.select = function(result) {
|
||||||
|
var result_element = result.get(0);
|
||||||
|
window.location.href = result_element.firstChild.firstChild.href;
|
||||||
|
}
|
||||||
|
|
||||||
|
search.scrollIntoView = search.scrollInWindow;
|
||||||
|
};
|
||||||
|
|
||||||
|
function highlightTarget( anchor ) {
|
||||||
|
console.debug( "Highlighting target '%s'.", anchor );
|
||||||
|
|
||||||
|
$("a[name]").each( function() {
|
||||||
|
if ( $(this).attr("name") == anchor ) {
|
||||||
|
if ( !$(this).parent().parent().hasClass('target-section') ) {
|
||||||
|
console.debug( "Wrapping the target-section" );
|
||||||
|
$('div.method-detail').unwrap( 'div.target-section' );
|
||||||
|
$(this).parent().wrap( '<div class="target-section"></div>' );
|
||||||
|
} else {
|
||||||
|
console.debug( "Already wrapped." );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
function highlightLocationTarget() {
|
||||||
|
console.debug( "Location hash: %s", window.location.hash );
|
||||||
|
if ( ! window.location.hash || window.location.hash.length == 0 ) return;
|
||||||
|
|
||||||
|
var anchor = window.location.hash.substring(1);
|
||||||
|
console.debug( "Found anchor: %s; matching %s", anchor, "a[name=" + anchor + "]" );
|
||||||
|
|
||||||
|
highlightTarget( anchor );
|
||||||
|
};
|
||||||
|
|
||||||
|
function highlightClickTarget( event ) {
|
||||||
|
console.debug( "Highlighting click target for event %o", event.target );
|
||||||
|
try {
|
||||||
|
var anchor = $(event.target).attr( 'href' ).substring(1);
|
||||||
|
console.debug( "Found target anchor: %s", anchor );
|
||||||
|
highlightTarget( anchor );
|
||||||
|
} catch ( err ) {
|
||||||
|
console.error( "Exception while highlighting: %o", err );
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
$(document).ready( function() {
|
||||||
|
hookSourceViews();
|
||||||
|
hookDebuggingToggle();
|
||||||
|
hookSearch();
|
||||||
|
highlightLocationTarget();
|
||||||
|
hookTableOfContentsToggle();
|
||||||
|
|
||||||
|
$('ul.link-list a').bind( "click", highlightClickTarget );
|
||||||
|
});
|
18
rdoc/js/jquery.js
vendored
Normal file
142
rdoc/js/navigation.js
Normal file
@ -0,0 +1,142 @@
|
|||||||
|
/*
|
||||||
|
* Navigation allows movement using the arrow keys through the search results.
|
||||||
|
*
|
||||||
|
* When using this library you will need to set scrollIntoView to the
|
||||||
|
* appropriate function for your layout. Use scrollInWindow if the container
|
||||||
|
* is not scrollable and scrollInElement if the container is a separate
|
||||||
|
* scrolling region.
|
||||||
|
*/
|
||||||
|
Navigation = new function() {
|
||||||
|
this.initNavigation = function() {
|
||||||
|
var _this = this;
|
||||||
|
|
||||||
|
$(document).keydown(function(e) {
|
||||||
|
_this.onkeydown(e);
|
||||||
|
}).keyup(function(e) {
|
||||||
|
_this.onkeyup(e);
|
||||||
|
});
|
||||||
|
|
||||||
|
this.navigationActive = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.setNavigationActive = function(state) {
|
||||||
|
this.navigationActive = state;
|
||||||
|
this.clearMoveTimeout();
|
||||||
|
}
|
||||||
|
|
||||||
|
this.onkeyup = function(e) {
|
||||||
|
if (!this.navigationActive) return;
|
||||||
|
|
||||||
|
switch(e.keyCode) {
|
||||||
|
case 37: //Event.KEY_LEFT:
|
||||||
|
case 38: //Event.KEY_UP:
|
||||||
|
case 39: //Event.KEY_RIGHT:
|
||||||
|
case 40: //Event.KEY_DOWN:
|
||||||
|
this.clearMoveTimeout();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.onkeydown = function(e) {
|
||||||
|
if (!this.navigationActive) return;
|
||||||
|
switch(e.keyCode) {
|
||||||
|
case 37: //Event.KEY_LEFT:
|
||||||
|
if (this.moveLeft()) e.preventDefault();
|
||||||
|
break;
|
||||||
|
case 38: //Event.KEY_UP:
|
||||||
|
if (e.keyCode == 38 || e.ctrlKey) {
|
||||||
|
if (this.moveUp()) e.preventDefault();
|
||||||
|
this.startMoveTimeout(false);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 39: //Event.KEY_RIGHT:
|
||||||
|
if (this.moveRight()) e.preventDefault();
|
||||||
|
break;
|
||||||
|
case 40: //Event.KEY_DOWN:
|
||||||
|
if (e.keyCode == 40 || e.ctrlKey) {
|
||||||
|
if (this.moveDown()) e.preventDefault();
|
||||||
|
this.startMoveTimeout(true);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 13: //Event.KEY_RETURN:
|
||||||
|
if (this.$current)
|
||||||
|
e.preventDefault();
|
||||||
|
this.select(this.$current);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (e.ctrlKey && e.shiftKey) this.select(this.$current);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.clearMoveTimeout = function() {
|
||||||
|
clearTimeout(this.moveTimeout);
|
||||||
|
this.moveTimeout = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.startMoveTimeout = function(isDown) {
|
||||||
|
if (!$.browser.mozilla && !$.browser.opera) return;
|
||||||
|
if (this.moveTimeout) this.clearMoveTimeout();
|
||||||
|
var _this = this;
|
||||||
|
|
||||||
|
var go = function() {
|
||||||
|
if (!_this.moveTimeout) return;
|
||||||
|
_this[isDown ? 'moveDown' : 'moveUp']();
|
||||||
|
_this.moveTimout = setTimeout(go, 100);
|
||||||
|
}
|
||||||
|
this.moveTimeout = setTimeout(go, 200);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.moveRight = function() {
|
||||||
|
}
|
||||||
|
|
||||||
|
this.moveLeft = function() {
|
||||||
|
}
|
||||||
|
|
||||||
|
this.move = function(isDown) {
|
||||||
|
}
|
||||||
|
|
||||||
|
this.moveUp = function() {
|
||||||
|
return this.move(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.moveDown = function() {
|
||||||
|
return this.move(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Scrolls to the given element in the scrollable element view.
|
||||||
|
*/
|
||||||
|
this.scrollInElement = function(element, view) {
|
||||||
|
var offset, viewHeight, viewScroll, height;
|
||||||
|
offset = element.offsetTop;
|
||||||
|
height = element.offsetHeight;
|
||||||
|
viewHeight = view.offsetHeight;
|
||||||
|
viewScroll = view.scrollTop;
|
||||||
|
|
||||||
|
if (offset - viewScroll + height > viewHeight) {
|
||||||
|
view.scrollTop = offset - viewHeight + height;
|
||||||
|
}
|
||||||
|
if (offset < viewScroll) {
|
||||||
|
view.scrollTop = offset;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Scrolls to the given element in the window. The second argument is
|
||||||
|
* ignored
|
||||||
|
*/
|
||||||
|
this.scrollInWindow = function(element, ignored) {
|
||||||
|
var offset, viewHeight, viewScroll, height;
|
||||||
|
offset = element.offsetTop;
|
||||||
|
height = element.offsetHeight;
|
||||||
|
viewHeight = window.innerHeight;
|
||||||
|
viewScroll = window.scrollY;
|
||||||
|
|
||||||
|
if (offset - viewScroll + height > viewHeight) {
|
||||||
|
window.scrollTo(window.scrollX, offset - viewHeight + height);
|
||||||
|
}
|
||||||
|
if (offset < viewScroll) {
|
||||||
|
window.scrollTo(window.scrollX, offset);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
94
rdoc/js/search.js
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
Search = function(data, input, result) {
|
||||||
|
this.data = data;
|
||||||
|
this.$input = $(input);
|
||||||
|
this.$result = $(result);
|
||||||
|
|
||||||
|
this.$current = null;
|
||||||
|
this.$view = this.$result.parent();
|
||||||
|
this.searcher = new Searcher(data.index);
|
||||||
|
this.init();
|
||||||
|
}
|
||||||
|
|
||||||
|
Search.prototype = $.extend({}, Navigation, new function() {
|
||||||
|
var suid = 1;
|
||||||
|
|
||||||
|
this.init = function() {
|
||||||
|
var _this = this;
|
||||||
|
var observer = function() {
|
||||||
|
_this.search(_this.$input[0].value);
|
||||||
|
};
|
||||||
|
this.$input.keyup(observer);
|
||||||
|
this.$input.click(observer); // mac's clear field
|
||||||
|
|
||||||
|
this.searcher.ready(function(results, isLast) {
|
||||||
|
_this.addResults(results, isLast);
|
||||||
|
})
|
||||||
|
|
||||||
|
this.initNavigation();
|
||||||
|
this.setNavigationActive(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.search = function(value, selectFirstMatch) {
|
||||||
|
value = jQuery.trim(value).toLowerCase();
|
||||||
|
if (value) {
|
||||||
|
this.setNavigationActive(true);
|
||||||
|
} else {
|
||||||
|
this.setNavigationActive(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (value == '') {
|
||||||
|
this.lastQuery = value;
|
||||||
|
this.$result.empty();
|
||||||
|
this.setNavigationActive(false);
|
||||||
|
} else if (value != this.lastQuery) {
|
||||||
|
this.lastQuery = value;
|
||||||
|
this.firstRun = true;
|
||||||
|
this.searcher.find(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.addResults = function(results, isLast) {
|
||||||
|
var target = this.$result.get(0);
|
||||||
|
if (this.firstRun && (results.length > 0 || isLast)) {
|
||||||
|
this.$current = null;
|
||||||
|
this.$result.empty();
|
||||||
|
}
|
||||||
|
|
||||||
|
for (var i=0, l = results.length; i < l; i++) {
|
||||||
|
target.appendChild(this.renderItem.call(this, results[i]));
|
||||||
|
};
|
||||||
|
|
||||||
|
if (this.firstRun && results.length > 0) {
|
||||||
|
this.firstRun = false;
|
||||||
|
this.$current = $(target.firstChild);
|
||||||
|
this.$current.addClass('current');
|
||||||
|
}
|
||||||
|
if (jQuery.browser.msie) this.$element[0].className += '';
|
||||||
|
}
|
||||||
|
|
||||||
|
this.move = function(isDown) {
|
||||||
|
if (!this.$current) return;
|
||||||
|
var $next = this.$current[isDown ? 'next' : 'prev']();
|
||||||
|
if ($next.length) {
|
||||||
|
this.$current.removeClass('current');
|
||||||
|
$next.addClass('current');
|
||||||
|
this.scrollIntoView($next[0], this.$view[0]);
|
||||||
|
this.$current = $next;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.hlt = function(html) {
|
||||||
|
return this.escapeHTML(html).
|
||||||
|
replace(/\u0001/g, '<em>').
|
||||||
|
replace(/\u0002/g, '</em>');
|
||||||
|
}
|
||||||
|
|
||||||
|
this.escapeHTML = function(html) {
|
||||||
|
return html.replace(/[&<>]/g, function(c) {
|
||||||
|
return '&#' + c.charCodeAt(0) + ';';
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
1
rdoc/js/search_index.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
var search_data = {"index":{"searchIndex":["fastimage","new()","size()","type()"],"longSearchIndex":["fastimage","fastimage::new()","fastimage::size()","fastimage::type()"],"info":[["FastImage","","FastImage.html","",""],["new","FastImage","FastImage.html#method-c-new","(uri, options={})",""],["size","FastImage","FastImage.html#method-c-size","(uri, options={})","<p>Returns an array containing the width and height of the image. It will\nreturn nil if the image could …\n"],["type","FastImage","FastImage.html#method-c-type","(uri, options={})","<p>Returns an symbol indicating the image type fetched from a uri. It will\nreturn nil if the image could …\n"]]}}
|
228
rdoc/js/searcher.js
Normal file
@ -0,0 +1,228 @@
|
|||||||
|
Searcher = function(data) {
|
||||||
|
this.data = data;
|
||||||
|
this.handlers = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
Searcher.prototype = new function() {
|
||||||
|
// search is performed in chunks of 1000 for non-blocking user input
|
||||||
|
var CHUNK_SIZE = 1000;
|
||||||
|
// do not try to find more than 100 results
|
||||||
|
var MAX_RESULTS = 100;
|
||||||
|
var huid = 1;
|
||||||
|
var suid = 1;
|
||||||
|
var runs = 0;
|
||||||
|
|
||||||
|
this.find = function(query) {
|
||||||
|
var queries = splitQuery(query);
|
||||||
|
var regexps = buildRegexps(queries);
|
||||||
|
var highlighters = buildHilighters(queries);
|
||||||
|
var state = { from: 0, pass: 0, limit: MAX_RESULTS, n: suid++};
|
||||||
|
var _this = this;
|
||||||
|
|
||||||
|
this.currentSuid = state.n;
|
||||||
|
|
||||||
|
if (!query) return;
|
||||||
|
|
||||||
|
var run = function() {
|
||||||
|
// stop current search thread if new search started
|
||||||
|
if (state.n != _this.currentSuid) return;
|
||||||
|
|
||||||
|
var results =
|
||||||
|
performSearch(_this.data, regexps, queries, highlighters, state);
|
||||||
|
var hasMore = (state.limit > 0 && state.pass < 4);
|
||||||
|
|
||||||
|
triggerResults.call(_this, results, !hasMore);
|
||||||
|
if (hasMore) {
|
||||||
|
setTimeout(run, 2);
|
||||||
|
}
|
||||||
|
runs++;
|
||||||
|
};
|
||||||
|
runs = 0;
|
||||||
|
|
||||||
|
// start search thread
|
||||||
|
run();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ----- Events ------ */
|
||||||
|
this.ready = function(fn) {
|
||||||
|
fn.huid = huid;
|
||||||
|
this.handlers.push(fn);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ----- Utilities ------ */
|
||||||
|
function splitQuery(query) {
|
||||||
|
return jQuery.grep(query.split(/(\s+|::?|\(\)?)/), function(string) {
|
||||||
|
return string.match(/\S/)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function buildRegexps(queries) {
|
||||||
|
return jQuery.map(queries, function(query) {
|
||||||
|
return new RegExp(query.replace(/(.)/g, '([$1])([^$1]*?)'), 'i')
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function buildHilighters(queries) {
|
||||||
|
return jQuery.map(queries, function(query) {
|
||||||
|
return jQuery.map(query.split(''), function(l, i) {
|
||||||
|
return '\u0001$' + (i*2+1) + '\u0002$' + (i*2+2);
|
||||||
|
}).join('');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// function longMatchRegexp(index, longIndex, regexps) {
|
||||||
|
// for (var i = regexps.length - 1; i >= 0; i--){
|
||||||
|
// if (!index.match(regexps[i]) && !longIndex.match(regexps[i])) return false;
|
||||||
|
// };
|
||||||
|
// return true;
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
/* ----- Mathchers ------ */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This record matches if the index starts with queries[0] and the record
|
||||||
|
* matches all of the regexps
|
||||||
|
*/
|
||||||
|
function matchPassBeginning(index, longIndex, queries, regexps) {
|
||||||
|
if (index.indexOf(queries[0]) != 0) return false;
|
||||||
|
for (var i=1, l = regexps.length; i < l; i++) {
|
||||||
|
if (!index.match(regexps[i]) && !longIndex.match(regexps[i]))
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This record matches if the longIndex starts with queries[0] and the
|
||||||
|
* longIndex matches all of the regexps
|
||||||
|
*/
|
||||||
|
function matchPassLongIndex(index, longIndex, queries, regexps) {
|
||||||
|
if (longIndex.indexOf(queries[0]) != 0) return false;
|
||||||
|
for (var i=1, l = regexps.length; i < l; i++) {
|
||||||
|
if (!longIndex.match(regexps[i]))
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This record matches if the index contains queries[0] and the record
|
||||||
|
* matches all of the regexps
|
||||||
|
*/
|
||||||
|
function matchPassContains(index, longIndex, queries, regexps) {
|
||||||
|
if (index.indexOf(queries[0]) == -1) return false;
|
||||||
|
for (var i=1, l = regexps.length; i < l; i++) {
|
||||||
|
if (!index.match(regexps[i]) && !longIndex.match(regexps[i]))
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This record matches if regexps[0] matches the index and the record
|
||||||
|
* matches all of the regexps
|
||||||
|
*/
|
||||||
|
function matchPassRegexp(index, longIndex, queries, regexps) {
|
||||||
|
if (!index.match(regexps[0])) return false;
|
||||||
|
for (var i=1, l = regexps.length; i < l; i++) {
|
||||||
|
if (!index.match(regexps[i]) && !longIndex.match(regexps[i]))
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* ----- Highlighters ------ */
|
||||||
|
function highlightRegexp(info, queries, regexps, highlighters) {
|
||||||
|
var result = createResult(info);
|
||||||
|
for (var i=0, l = regexps.length; i < l; i++) {
|
||||||
|
result.title = result.title.replace(regexps[i], highlighters[i]);
|
||||||
|
result.namespace = result.namespace.replace(regexps[i], highlighters[i]);
|
||||||
|
};
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
function hltSubstring(string, pos, length) {
|
||||||
|
return string.substring(0, pos) + '\u0001' + string.substring(pos, pos + length) + '\u0002' + string.substring(pos + length);
|
||||||
|
}
|
||||||
|
|
||||||
|
function highlightQuery(info, queries, regexps, highlighters) {
|
||||||
|
var result = createResult(info);
|
||||||
|
var pos = 0;
|
||||||
|
var lcTitle = result.title.toLowerCase();
|
||||||
|
|
||||||
|
pos = lcTitle.indexOf(queries[0]);
|
||||||
|
if (pos != -1) {
|
||||||
|
result.title = hltSubstring(result.title, pos, queries[0].length);
|
||||||
|
}
|
||||||
|
|
||||||
|
result.namespace = result.namespace.replace(regexps[0], highlighters[0]);
|
||||||
|
for (var i=1, l = regexps.length; i < l; i++) {
|
||||||
|
result.title = result.title.replace(regexps[i], highlighters[i]);
|
||||||
|
result.namespace = result.namespace.replace(regexps[i], highlighters[i]);
|
||||||
|
};
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
function createResult(info) {
|
||||||
|
var result = {};
|
||||||
|
result.title = info[0];
|
||||||
|
result.namespace = info[1];
|
||||||
|
result.path = info[2];
|
||||||
|
result.params = info[3];
|
||||||
|
result.snippet = info[4];
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ----- Searching ------ */
|
||||||
|
function performSearch(data, regexps, queries, highlighters, state) {
|
||||||
|
var searchIndex = data.searchIndex;
|
||||||
|
var longSearchIndex = data.longSearchIndex;
|
||||||
|
var info = data.info;
|
||||||
|
var result = [];
|
||||||
|
var i = state.from;
|
||||||
|
var l = searchIndex.length;
|
||||||
|
var togo = CHUNK_SIZE;
|
||||||
|
var matchFunc, hltFunc;
|
||||||
|
|
||||||
|
while (state.pass < 4 && state.limit > 0 && togo > 0) {
|
||||||
|
if (state.pass == 0) {
|
||||||
|
matchFunc = matchPassBeginning;
|
||||||
|
hltFunc = highlightQuery;
|
||||||
|
} else if (state.pass == 1) {
|
||||||
|
matchFunc = matchPassLongIndex;
|
||||||
|
hltFunc = highlightQuery;
|
||||||
|
} else if (state.pass == 2) {
|
||||||
|
matchFunc = matchPassContains;
|
||||||
|
hltFunc = highlightQuery;
|
||||||
|
} else if (state.pass == 3) {
|
||||||
|
matchFunc = matchPassRegexp;
|
||||||
|
hltFunc = highlightRegexp;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (; togo > 0 && i < l && state.limit > 0; i++, togo--) {
|
||||||
|
if (info[i].n == state.n) continue;
|
||||||
|
if (matchFunc(searchIndex[i], longSearchIndex[i], queries, regexps)) {
|
||||||
|
info[i].n = state.n;
|
||||||
|
result.push(hltFunc(info[i], queries, regexps, highlighters));
|
||||||
|
state.limit--;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
if (searchIndex.length <= i) {
|
||||||
|
state.pass++;
|
||||||
|
i = state.from = 0;
|
||||||
|
} else {
|
||||||
|
state.from = i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
function triggerResults(results, isLast) {
|
||||||
|
jQuery.each(this.handlers, function(i, fn) {
|
||||||
|
fn.call(this, results, isLast)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
595
rdoc/rdoc.css
Normal file
@ -0,0 +1,595 @@
|
|||||||
|
/*
|
||||||
|
* "Darkfish" Rdoc CSS
|
||||||
|
* $Id: rdoc.css 54 2009-01-27 01:09:48Z deveiant $
|
||||||
|
*
|
||||||
|
* Author: Michael Granger <ged@FaerieMUD.org>
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* vim: ft=css et sw=2 ts=2 sts=2 */
|
||||||
|
/* Base Green is: #6C8C22 */
|
||||||
|
|
||||||
|
* { padding: 0; margin: 0; }
|
||||||
|
|
||||||
|
body {
|
||||||
|
background: #efefef;
|
||||||
|
font: 14px "Helvetica Neue", Helvetica, Tahoma, sans-serif;
|
||||||
|
margin-left: 40px;
|
||||||
|
}
|
||||||
|
body.file-popup {
|
||||||
|
font-size: 90%;
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
font-size: 300%;
|
||||||
|
text-shadow: rgba(135,145,135,0.65) 2px 2px 3px;
|
||||||
|
color: #6C8C22;
|
||||||
|
}
|
||||||
|
h2,h3,h4 { margin-top: 1.5em; }
|
||||||
|
|
||||||
|
h1 span,
|
||||||
|
h2 span,
|
||||||
|
h3 span,
|
||||||
|
h4 span,
|
||||||
|
h5 span,
|
||||||
|
h6 span {
|
||||||
|
display: none;
|
||||||
|
padding-left: 1em;
|
||||||
|
font-size: 50%;
|
||||||
|
vertical-align: super;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1:hover span,
|
||||||
|
h2:hover span,
|
||||||
|
h3:hover span,
|
||||||
|
h4:hover span,
|
||||||
|
h5:hover span,
|
||||||
|
h6:hover span {
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
|
|
||||||
|
:link,
|
||||||
|
:visited {
|
||||||
|
color: #6C8C22;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
:link:hover,
|
||||||
|
:visited:hover {
|
||||||
|
border-bottom: 1px dotted #6C8C22;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre {
|
||||||
|
background: #ddd;
|
||||||
|
padding: 0.5em 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
blockquote {
|
||||||
|
background: #ddd;
|
||||||
|
margin: 1em;
|
||||||
|
padding: 0.25em;
|
||||||
|
}
|
||||||
|
|
||||||
|
blockquote > :first-child {
|
||||||
|
margin-top: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* @group Generic Classes */
|
||||||
|
|
||||||
|
.initially-hidden {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#search-field {
|
||||||
|
width: 98%;
|
||||||
|
background: #eee;
|
||||||
|
border: none;
|
||||||
|
height: 1.5em;
|
||||||
|
-webkit-border-radius: 4px;
|
||||||
|
}
|
||||||
|
#search-field:focus {
|
||||||
|
background: #f1edba;
|
||||||
|
}
|
||||||
|
#search-field:-moz-placeholder,
|
||||||
|
#search-field::-webkit-input-placeholder {
|
||||||
|
font-weight: bold;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
|
||||||
|
.missing-docs {
|
||||||
|
font-size: 120%;
|
||||||
|
background: white url(images/wrench_orange.png) no-repeat 4px center;
|
||||||
|
color: #ccc;
|
||||||
|
line-height: 2em;
|
||||||
|
border: 1px solid #d00;
|
||||||
|
opacity: 1;
|
||||||
|
padding-left: 20px;
|
||||||
|
text-indent: 24px;
|
||||||
|
letter-spacing: 3px;
|
||||||
|
font-weight: bold;
|
||||||
|
-webkit-border-radius: 5px;
|
||||||
|
-moz-border-radius: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.target-section {
|
||||||
|
border: 2px solid #dcce90;
|
||||||
|
border-left-width: 8px;
|
||||||
|
padding: 0 1em;
|
||||||
|
background: #fff3c2;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* @end */
|
||||||
|
|
||||||
|
/* @group Index Page, Standalone file pages */
|
||||||
|
.indexpage ul {
|
||||||
|
line-height: 160%;
|
||||||
|
list-style: none;
|
||||||
|
}
|
||||||
|
.indexpage ul :link,
|
||||||
|
.indexpage ul :visited {
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.indexpage li {
|
||||||
|
padding-left: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.indexpage ul > li {
|
||||||
|
background: url(images/bullet_black.png) no-repeat left 4px;
|
||||||
|
}
|
||||||
|
.indexpage li.method {
|
||||||
|
background: url(images/plugin.png) no-repeat left 4px;
|
||||||
|
}
|
||||||
|
.indexpage li.module {
|
||||||
|
background: url(images/package.png) no-repeat left 4px;
|
||||||
|
}
|
||||||
|
.indexpage li.class {
|
||||||
|
background: url(images/ruby.png) no-repeat left 4px;
|
||||||
|
}
|
||||||
|
.indexpage li.file {
|
||||||
|
background: url(images/page_white_text.png) no-repeat left 4px;
|
||||||
|
}
|
||||||
|
.indexpage li li {
|
||||||
|
background: url(images/tag_blue.png) no-repeat left 4px;
|
||||||
|
}
|
||||||
|
.indexpage li .toc-toggle {
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
background: url(images/add.png) no-repeat;
|
||||||
|
}
|
||||||
|
|
||||||
|
.indexpage li .toc-toggle.open {
|
||||||
|
background: url(images/delete.png) no-repeat;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* @end */
|
||||||
|
|
||||||
|
/* @group Top-Level Structure */
|
||||||
|
|
||||||
|
#metadata {
|
||||||
|
float: left;
|
||||||
|
width: 260px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#documentation {
|
||||||
|
margin: 2em 1em 5em 300px;
|
||||||
|
min-width: 340px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#validator-badges {
|
||||||
|
clear: both;
|
||||||
|
margin: 1em 1em 2em;
|
||||||
|
font-size: smaller;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* @end */
|
||||||
|
|
||||||
|
/* @group Metadata Section */
|
||||||
|
#metadata .section {
|
||||||
|
background-color: #dedede;
|
||||||
|
-moz-border-radius: 5px;
|
||||||
|
-webkit-border-radius: 5px;
|
||||||
|
border: 1px solid #aaa;
|
||||||
|
margin: 0 8px 8px;
|
||||||
|
font-size: 90%;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
#metadata h3.section-header {
|
||||||
|
margin: 0;
|
||||||
|
padding: 2px 8px;
|
||||||
|
background: #ccc;
|
||||||
|
color: #666;
|
||||||
|
-moz-border-radius-topleft: 4px;
|
||||||
|
-moz-border-radius-topright: 4px;
|
||||||
|
-webkit-border-top-left-radius: 4px;
|
||||||
|
-webkit-border-top-right-radius: 4px;
|
||||||
|
border-bottom: 1px solid #aaa;
|
||||||
|
}
|
||||||
|
#metadata #home-section h3.section-header {
|
||||||
|
border-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#metadata ul,
|
||||||
|
#metadata dl,
|
||||||
|
#metadata p {
|
||||||
|
padding: 8px;
|
||||||
|
list-style: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#file-metadata {
|
||||||
|
margin-top: 2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
#file-metadata ul {
|
||||||
|
padding-left: 28px;
|
||||||
|
list-style-image: url(images/page_green.png);
|
||||||
|
}
|
||||||
|
|
||||||
|
#table-of-contents {
|
||||||
|
margin-top: 2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
#table-of-contents ul {
|
||||||
|
padding-left: 28px;
|
||||||
|
list-style-image: url(images/tag_blue.png);
|
||||||
|
}
|
||||||
|
|
||||||
|
dl.svninfo {
|
||||||
|
color: #666;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
dl.svninfo dt {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.link-list li {
|
||||||
|
white-space: nowrap;
|
||||||
|
line-height: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.link-list .type {
|
||||||
|
font-size: 8px;
|
||||||
|
text-transform: uppercase;
|
||||||
|
color: white;
|
||||||
|
background: #969696;
|
||||||
|
padding: 2px 4px;
|
||||||
|
-webkit-border-radius: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.calls-super {
|
||||||
|
background: url(images/arrow_up.png) no-repeat right center;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* @end */
|
||||||
|
|
||||||
|
/* @group Class Metadata Section */
|
||||||
|
#class-metadata {
|
||||||
|
margin-top: 2em;
|
||||||
|
}
|
||||||
|
/* @end */
|
||||||
|
|
||||||
|
/* @group Project Metadata Section */
|
||||||
|
#project-metadata {
|
||||||
|
margin-top: 2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
#project-metadata .section {
|
||||||
|
border: 1px solid #aaa;
|
||||||
|
}
|
||||||
|
#project-metadata h3.section-header {
|
||||||
|
border-bottom: 1px solid #aaa;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
#project-metadata form {
|
||||||
|
color: #777;
|
||||||
|
background: #ccc;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* @end */
|
||||||
|
|
||||||
|
/* @group Documentation Section */
|
||||||
|
.description {
|
||||||
|
font-size: 100%;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.description p {
|
||||||
|
margin: 1em 0.4em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.description li p {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.description ol,
|
||||||
|
.description ul {
|
||||||
|
margin-left: 1.5em;
|
||||||
|
}
|
||||||
|
.description ol li,
|
||||||
|
.description ul li {
|
||||||
|
line-height: 1.4em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.note-list {
|
||||||
|
margin: 8px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.label-list {
|
||||||
|
margin: 8px 1.5em;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
}
|
||||||
|
.description .label-list {
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.note-list dt {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.note-list dd {
|
||||||
|
padding: 0 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.label-list dt {
|
||||||
|
padding: 2px 4px;
|
||||||
|
font-weight: bold;
|
||||||
|
background: #ddd;
|
||||||
|
}
|
||||||
|
.label-list dd {
|
||||||
|
padding: 2px 12px;
|
||||||
|
}
|
||||||
|
.label-list dd + dt,
|
||||||
|
.note-list dd + dt {
|
||||||
|
margin-top: 0.7em;
|
||||||
|
}
|
||||||
|
|
||||||
|
#documentation .section {
|
||||||
|
font-size: 90%;
|
||||||
|
}
|
||||||
|
|
||||||
|
#documentation h2.section-header {
|
||||||
|
margin-top: 1em;
|
||||||
|
padding: 0.25em 0.5em;
|
||||||
|
background: #ccc;
|
||||||
|
color: #333;
|
||||||
|
font-size: 175%;
|
||||||
|
border: 1px solid #bbb;
|
||||||
|
-moz-border-radius: 3px;
|
||||||
|
-webkit-border-radius: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.documentation-section-title {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.documentation-section-title .section-click-top {
|
||||||
|
position: absolute;
|
||||||
|
top: 6px;
|
||||||
|
right: 12px;
|
||||||
|
font-size: 10px;
|
||||||
|
color: #9b9877;
|
||||||
|
visibility: hidden;
|
||||||
|
padding-right: 0.5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.documentation-section-title:hover .section-click-top {
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
#documentation h3.section-header {
|
||||||
|
margin-top: 1em;
|
||||||
|
padding: 0.25em 0.5em;
|
||||||
|
background-color: #dedede;
|
||||||
|
color: #333;
|
||||||
|
font-size: 150%;
|
||||||
|
border: 1px solid #bbb;
|
||||||
|
-moz-border-radius: 3px;
|
||||||
|
-webkit-border-radius: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#constants-list > dl,
|
||||||
|
#attributes-list > dl {
|
||||||
|
margin: 1em 0 2em;
|
||||||
|
border: 0;
|
||||||
|
}
|
||||||
|
#constants-list > dl dt,
|
||||||
|
#attributes-list > dl dt {
|
||||||
|
padding-left: 0;
|
||||||
|
font-weight: bold;
|
||||||
|
font-family: Monaco, "Andale Mono";
|
||||||
|
background: inherit;
|
||||||
|
}
|
||||||
|
#constants-list > dl dt a,
|
||||||
|
#attributes-list > dl dt a {
|
||||||
|
color: inherit;
|
||||||
|
}
|
||||||
|
#constants-list > dl dd,
|
||||||
|
#attributes-list > dl dd {
|
||||||
|
margin: 0 0 1em 0;
|
||||||
|
padding: 0;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
|
||||||
|
.documentation-section h2 {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.documentation-section h2 a {
|
||||||
|
position: absolute;
|
||||||
|
top: 8px;
|
||||||
|
right: 10px;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #9b9877;
|
||||||
|
visibility: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.documentation-section h2:hover a {
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* @group Method Details */
|
||||||
|
|
||||||
|
#documentation .method-source-code {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#documentation .method-description .method-calls-super {
|
||||||
|
color: #333;
|
||||||
|
font-weight: bolder;
|
||||||
|
}
|
||||||
|
|
||||||
|
#documentation .method-detail {
|
||||||
|
margin: 0.5em 0;
|
||||||
|
padding: 0.5em 0;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
#documentation .method-detail:hover {
|
||||||
|
background-color: #f1edba;
|
||||||
|
}
|
||||||
|
#documentation .method-heading {
|
||||||
|
position: relative;
|
||||||
|
padding: 2px 4px 0 20px;
|
||||||
|
font-size: 125%;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #333;
|
||||||
|
background: url(images/brick.png) no-repeat left bottom;
|
||||||
|
}
|
||||||
|
#documentation .method-heading :link,
|
||||||
|
#documentation .method-heading :visited {
|
||||||
|
color: inherit;
|
||||||
|
}
|
||||||
|
#documentation .method-click-advice {
|
||||||
|
position: absolute;
|
||||||
|
top: 2px;
|
||||||
|
right: 5px;
|
||||||
|
font-size: 10px;
|
||||||
|
color: #9b9877;
|
||||||
|
visibility: hidden;
|
||||||
|
padding-right: 20px;
|
||||||
|
line-height: 20px;
|
||||||
|
background: url(images/zoom.png) no-repeat right top;
|
||||||
|
}
|
||||||
|
#documentation .method-heading:hover .method-click-advice {
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
#documentation .method-alias .method-heading {
|
||||||
|
color: #666;
|
||||||
|
background: url(images/brick_link.png) no-repeat left bottom;
|
||||||
|
}
|
||||||
|
|
||||||
|
#documentation .method-description,
|
||||||
|
#documentation .aliases {
|
||||||
|
margin: 0 20px;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
|
||||||
|
#documentation .method-description p,
|
||||||
|
#documentation .aliases p {
|
||||||
|
line-height: 1.2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
#documentation .aliases {
|
||||||
|
padding-top: 4px;
|
||||||
|
font-style: italic;
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
|
#documentation .method-description p {
|
||||||
|
margin-bottom: 0.5em;
|
||||||
|
}
|
||||||
|
#documentation .method-description ul {
|
||||||
|
margin-left: 1.5em;
|
||||||
|
}
|
||||||
|
pre {
|
||||||
|
margin: 0.5em 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#documentation .attribute-method-heading {
|
||||||
|
background: url(images/tag_green.png) no-repeat left bottom;
|
||||||
|
}
|
||||||
|
#documentation #attribute-method-details .method-detail:hover {
|
||||||
|
background-color: transparent;
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
|
#documentation .attribute-access-type {
|
||||||
|
font-size: 60%;
|
||||||
|
text-transform: uppercase;
|
||||||
|
vertical-align: super;
|
||||||
|
padding: 0 2px;
|
||||||
|
}
|
||||||
|
/* @end */
|
||||||
|
|
||||||
|
/* @end */
|
||||||
|
|
||||||
|
/* @group Source Code */
|
||||||
|
|
||||||
|
pre {
|
||||||
|
overflow: auto;
|
||||||
|
background: #262626;
|
||||||
|
color: white;
|
||||||
|
border: 1px dashed #999;
|
||||||
|
padding: 0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.description pre {
|
||||||
|
margin: 0 0.4em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ruby-constant { color: #7fffd4; background: transparent; }
|
||||||
|
.ruby-keyword { color: #00ffff; background: transparent; }
|
||||||
|
.ruby-ivar { color: #eedd82; background: transparent; }
|
||||||
|
.ruby-operator { color: #00ffee; background: transparent; }
|
||||||
|
.ruby-identifier { color: #ffdead; background: transparent; }
|
||||||
|
.ruby-node { color: #ffa07a; background: transparent; }
|
||||||
|
.ruby-comment { color: #dc0000; font-weight: bold; background: transparent; }
|
||||||
|
.ruby-regexp { color: #ffa07a; background: transparent; }
|
||||||
|
.ruby-value { color: #7fffd4; background: transparent; }
|
||||||
|
|
||||||
|
/* @end */
|
||||||
|
|
||||||
|
|
||||||
|
/* @group search results */
|
||||||
|
#search-results h1 {
|
||||||
|
font-size: 1em;
|
||||||
|
font-weight: normal;
|
||||||
|
text-shadow: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#search-results .current {
|
||||||
|
background: #ccc;
|
||||||
|
border-bottom: 1px solid transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
#search-results li {
|
||||||
|
list-style: none;
|
||||||
|
border-bottom: 1px solid #aaa;
|
||||||
|
-moz-border-radius: 4px;
|
||||||
|
-webkit-border-radius: 4px;
|
||||||
|
border-radius: 4px;
|
||||||
|
margin-bottom: 0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
#search-results li:last-child {
|
||||||
|
border-bottom: none;
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#search-results li p {
|
||||||
|
padding: 0;
|
||||||
|
margin: 0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
#search-results .search-namespace {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
#search-results li em {
|
||||||
|
background: yellow;
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
#search-results pre {
|
||||||
|
margin: 0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* @end */
|
||||||
|
|
52
rdoc/table_of_contents.html
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
||||||
|
|
||||||
|
<title>Table of Contents - RDoc Documentation</title>
|
||||||
|
|
||||||
|
<link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet">
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
var rdoc_rel_prefix = "./";
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/javascript" charset="utf-8" src="./js/jquery.js"></script>
|
||||||
|
<script type="text/javascript" charset="utf-8" src="./js/navigation.js"></script>
|
||||||
|
<script type="text/javascript" charset="utf-8" src="./js/search_index.js"></script>
|
||||||
|
<script type="text/javascript" charset="utf-8" src="./js/search.js"></script>
|
||||||
|
<script type="text/javascript" charset="utf-8" src="./js/searcher.js"></script>
|
||||||
|
<script type="text/javascript" charset="utf-8" src="./js/darkfish.js"></script>
|
||||||
|
|
||||||
|
|
||||||
|
<body class="indexpage">
|
||||||
|
<h1>Table of Contents - RDoc Documentation</h1>
|
||||||
|
|
||||||
|
|
||||||
|
<h2 id="classes">Classes/Modules</h2>
|
||||||
|
<ul>
|
||||||
|
<li class="class">
|
||||||
|
<a href="FastImage.html">FastImage</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<h2 id="methods">Methods</h2>
|
||||||
|
<ul>
|
||||||
|
|
||||||
|
<li class="method"><a href="FastImage.html#method-c-new">::new — FastImage</a>
|
||||||
|
|
||||||
|
<li class="method"><a href="FastImage.html#method-c-size">::size — FastImage</a>
|
||||||
|
|
||||||
|
<li class="method"><a href="FastImage.html#method-c-type">::type — FastImage</a>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
|
<footer id="validator-badges">
|
||||||
|
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
||||||
|
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 4.0.0.
|
||||||
|
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
||||||
|
</footer>
|
||||||
|
|