<!DOCTYPE html>
<html> <head> <meta content=“text/html; charset=UTF-8” http-equiv=“Content-Type”>
<title>module ReVIEW::MakerHelper - review-2.1.0 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=“module”> <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/review/makerhelper.rb </ul>
</nav>
</div> <div id="class-metadata"> <!-- Method Quickref -->
<nav id=“method-list-section” class=“section”>
<h3 class="section-header">Methods</h3> <ul class="link-list"> <li ><a href="#method-c-bindir">::bindir</a> <li ><a href="#method-c-copy_images_to_dir">::copy_images_to_dir</a> <li ><a href="#method-i-bindir">#bindir</a> <li ><a href="#method-i-copy_images_to_dir">#copy_images_to_dir</a> </ul>
</nav>
</div> <div id="project-metadata"> <nav id="fileindex-section" class="section project-section"> <h3 class="section-header">Pages</h3> <ul> <li class="file"><a href="../ChangeLog.html">ChangeLog</a> </ul>
</nav>
<nav id="classindex-section" class="section project-section"> <h3 class="section-header">Class and Module Index</h3> <ul class="link-list"> <li><a href="../EPUBMaker.html">EPUBMaker</a> <li><a href="../EPUBMaker/Content.html">EPUBMaker::Content</a> <li><a href="../EPUBMaker/EPUBCommon.html">EPUBMaker::EPUBCommon</a> <li><a href="../EPUBMaker/EPUBv2.html">EPUBMaker::EPUBv2</a> <li><a href="../EPUBMaker/EPUBv3.html">EPUBMaker::EPUBv3</a> <li><a href="../EPUBMaker/Producer.html">EPUBMaker::Producer</a> <li><a href="../Encoding.html">Encoding</a> <li><a href="../Hash.html">Hash</a> <li><a href="../LineInput.html">LineInput</a> <li><a href="../Object.html">Object</a> <li><a href="../ReVIEW.html">ReVIEW</a> <li><a href="../ReVIEW/ApplicationError.html">ReVIEW::ApplicationError</a> <li><a href="../ReVIEW/Book.html">ReVIEW::Book</a> <li><a href="../ReVIEW/Book/Base.html">ReVIEW::Book::Base</a> <li><a href="../ReVIEW/Book/BibpaperIndex.html">ReVIEW::Book::BibpaperIndex</a> <li><a href="../ReVIEW/Book/Chapter.html">ReVIEW::Book::Chapter</a> <li><a href="../ReVIEW/Book/ChapterIndex.html">ReVIEW::Book::ChapterIndex</a> <li><a href="../ReVIEW/Book/ColumnIndex.html">ReVIEW::Book::ColumnIndex</a> <li><a href="../ReVIEW/Book/Compilable.html">ReVIEW::Book::Compilable</a> <li><a href="../ReVIEW/Book/FootnoteIndex.html">ReVIEW::Book::FootnoteIndex</a> <li><a href="../ReVIEW/Book/HeadlineIndex.html">ReVIEW::Book::HeadlineIndex</a> <li><a href="../ReVIEW/Book/IconIndex.html">ReVIEW::Book::IconIndex</a> <li><a href="../ReVIEW/Book/ImageFinder.html">ReVIEW::Book::ImageFinder</a> <li><a href="../ReVIEW/Book/ImageIndex.html">ReVIEW::Book::ImageIndex</a> <li><a href="../ReVIEW/Book/ImageIndex/Item.html">ReVIEW::Book::ImageIndex::Item</a> <li><a href="../ReVIEW/Book/IndepImageIndex.html">ReVIEW::Book::IndepImageIndex</a> <li><a href="../ReVIEW/Book/IndepImageIndex/Item.html">ReVIEW::Book::IndepImageIndex::Item</a> <li><a href="../ReVIEW/Book/Index.html">ReVIEW::Book::Index</a> <li><a href="../ReVIEW/Book/ListIndex.html">ReVIEW::Book::ListIndex</a> <li><a href="../ReVIEW/Book/NumberlessImageIndex.html">ReVIEW::Book::NumberlessImageIndex</a> <li><a href="../ReVIEW/Book/NumberlessImageIndex/Item.html">ReVIEW::Book::NumberlessImageIndex::Item</a> <li><a href="../ReVIEW/Book/PageMetric.html">ReVIEW::Book::PageMetric</a> <li><a href="../ReVIEW/Book/Part.html">ReVIEW::Book::Part</a> <li><a href="../ReVIEW/Book/TableIndex.html">ReVIEW::Book::TableIndex</a> <li><a href="../ReVIEW/Book/Volume.html">ReVIEW::Book::Volume</a> <li><a href="../ReVIEW/Builder.html">ReVIEW::Builder</a> <li><a href="../ReVIEW/Catalog.html">ReVIEW::Catalog</a> <li><a href="../ReVIEW/CompileError.html">ReVIEW::CompileError</a> <li><a href="../ReVIEW/Compiler.html">ReVIEW::Compiler</a> <li><a href="../ReVIEW/Compiler/InlineSyntaxElement.html">ReVIEW::Compiler::InlineSyntaxElement</a> <li><a href="../ReVIEW/Compiler/SyntaxElement.html">ReVIEW::Compiler::SyntaxElement</a> <li><a href="../ReVIEW/ConfigError.html">ReVIEW::ConfigError</a> <li><a href="../ReVIEW/Configure.html">ReVIEW::Configure</a> <li><a href="../ReVIEW/Converter.html">ReVIEW::Converter</a> <li><a href="../ReVIEW/EPUBBuilder.html">ReVIEW::EPUBBuilder</a> <li><a href="../ReVIEW/EPUBMaker.html">ReVIEW::EPUBMaker</a> <li><a href="../ReVIEW/EPUBMaker/ReVIEWHeaderListener.html">ReVIEW::EPUBMaker::ReVIEWHeaderListener</a> <li><a href="../ReVIEW/EWBBuilder.html">ReVIEW::EWBBuilder</a> <li><a href="../ReVIEW/Error.html">ReVIEW::Error</a> <li><a href="../ReVIEW/ErrorUtils.html">ReVIEW::ErrorUtils</a> <li><a href="../ReVIEW/FileNotFound.html">ReVIEW::FileNotFound</a> <li><a href="../ReVIEW/HTMLBuilder.html">ReVIEW::HTMLBuilder</a> <li><a href="../ReVIEW/HTMLTOCPrinter.html">ReVIEW::HTMLTOCPrinter</a> <li><a href="../ReVIEW/HTMLToc.html">ReVIEW::HTMLToc</a> <li><a href="../ReVIEW/HTMLUtils.html">ReVIEW::HTMLUtils</a> <li><a href="../ReVIEW/I18n.html">ReVIEW::I18n</a> <li><a href="../ReVIEW/IDGXMLBuilder.html">ReVIEW::IDGXMLBuilder</a> <li><a href="../ReVIEW/KeyError.html">ReVIEW::KeyError</a> <li><a href="../ReVIEW/LATEXBuilder.html">ReVIEW::LATEXBuilder</a> <li><a href="../ReVIEW/LaTeXIndex.html">ReVIEW::LaTeXIndex</a> <li><a href="../ReVIEW/LaTeXUtils.html">ReVIEW::LaTeXUtils</a> <li><a href="../ReVIEW/Line.html">ReVIEW::Line</a> <li><a href="../ReVIEW/LineInput.html">ReVIEW::LineInput</a> <li><a href="../ReVIEW/Location.html">ReVIEW::Location</a> <li><a href="../ReVIEW/MARKDOWNBuilder.html">ReVIEW::MARKDOWNBuilder</a> <li><a href="../ReVIEW/MD2INAOBuilder.html">ReVIEW::MD2INAOBuilder</a> <li><a href="../ReVIEW/MakerHelper.html">ReVIEW::MakerHelper</a> <li><a href="../ReVIEW/PDFMaker.html">ReVIEW::PDFMaker</a> <li><a href="../ReVIEW/Preprocessor.html">ReVIEW::Preprocessor</a> <li><a href="../ReVIEW/Preprocessor/Directive.html">ReVIEW::Preprocessor::Directive</a> <li><a href="../ReVIEW/Preprocessor/Strip.html">ReVIEW::Preprocessor::Strip</a> <li><a href="../ReVIEW/Repository.html">ReVIEW::Repository</a> <li><a href="../ReVIEW/SecCounter.html">ReVIEW::SecCounter</a> <li><a href="../ReVIEW/SyntaxError.html">ReVIEW::SyntaxError</a> <li><a href="../ReVIEW/TEXTBuilder.html">ReVIEW::TEXTBuilder</a> <li><a href="../ReVIEW/TOCParser.html">ReVIEW::TOCParser</a> <li><a href="../ReVIEW/TOCParser/Chapter.html">ReVIEW::TOCParser::Chapter</a> <li><a href="../ReVIEW/TOCParser/List.html">ReVIEW::TOCParser::List</a> <li><a href="../ReVIEW/TOCParser/Node.html">ReVIEW::TOCParser::Node</a> <li><a href="../ReVIEW/TOCParser/Paragraph.html">ReVIEW::TOCParser::Paragraph</a> <li><a href="../ReVIEW/TOCParser/Section.html">ReVIEW::TOCParser::Section</a> <li><a href="../ReVIEW/TOCPrinter.html">ReVIEW::TOCPrinter</a> <li><a href="../ReVIEW/TOPBuilder.html">ReVIEW::TOPBuilder</a> <li><a href="../ReVIEW/Template.html">ReVIEW::Template</a> <li><a href="../ReVIEW/TextTOCPrinter.html">ReVIEW::TextTOCPrinter</a> <li><a href="../ReVIEW/TextUtils.html">ReVIEW::TextUtils</a> <li><a href="../ReVIEW/Unfold.html">ReVIEW::Unfold</a> <li><a href="../ReVIEW/WEBMaker.html">ReVIEW::WEBMaker</a> <li><a href="../ReVIEW/WEBTOCPrinter.html">ReVIEW::WEBTOCPrinter</a> <li><a href="../ReVIEW/WrongInput.html">ReVIEW::WrongInput</a> <li><a href="../ReVIEW/YAMLLoader.html">ReVIEW::YAMLLoader</a> <li><a href="../String.html">String</a> </ul>
</nav>
</div>
</nav>
<div id=“documentation”>
<h1 class="module">module ReVIEW::MakerHelper</h1> <div id="description" class="description"> </div><!-- description --> <section id="5Buntitled-5D" class="documentation-section"> <!-- 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-bindir" class="method-detail "> <div class="method-heading"> <span class="method-name">bindir</pan><span class="method-args">()</span> <span class="method-click-advice">click to toggle source</pan> </div> <div class="method-description"> <p>Return review/bin directory</p> <div class="method-source-code" id="bindir-source"> <pre><span class="ruby-comment"># File lib/review/makerhelper.rb, line 16</span>
<span class=“ruby-keyword”>def</span> <span class=“ruby-identifier”>bindir</span>
<span class="ruby-constant">Pathname</span>.<span class="ruby-identifier">new</span>(<span class="ruby-node">"#{Pathname.new(__FILE__).realpath.dirname}/../../bin"</span>).<span class="ruby-identifier">realpath</span>
<span class=“ruby-keyword”>end</span></pre>
</div><!-- bindir-source --> </div> </div><!-- bindir-method --> <div id="method-c-copy_images_to_dir" class="method-detail "> <div class="method-heading"> <span class="method-name">copy_images_to_dir</span><span class="method-args">(from_dir, to_dir, options = {})</span> <span class="method-click-advice">click to toggle source</span> </div> <div class="method-description"> <p>Copy image files under from_dir to to_dir recursively</p>
<h4 id=“method-c-copy_images_to_dir-label-Args”>Args<span><a href=“#method-c-copy_images_to_dir-label-Args”>¶</a> <a href=“#documentation”>↑</a></span></h4> <dl class=“rdoc-list note-list”><dt>from_dir <dd> <p>path to the directory which has image files to be copied</p> </dd><dt>to_dir <dd> <p>path to the directory to which the image files are copied</p> </dd><dt>options <dd> <p>used to specify optional operations during copy</p> </dd></dl>
<h4 id=“method-c-copy_images_to_dir-label-Returns”>Returns<span><a href=“#method-c-copy_images_to_dir-label-Returns”>¶</a> <a href=“#documentation”>↑</a></span></h4>
<p>list of image files</p>
<h4 id=“method-c-copy_images_to_dir-label-Options”>Options<span><a href=“#method-c-copy_images_to_dir-label-Options”>¶</a> <a href=“#documentation”>↑</a></span></h4> <dl class=“rdoc-list note-list”><dt>:convert <dd> <p>Conversion rule</p> </dd></dl>
<h4 id=“method-c-copy_images_to_dir-label-Examples”>Examples<span><a href=“#method-c-copy_images_to_dir-label-Examples”>¶</a> <a href=“#documentation”>↑</a></span></h4>
<pre class=“ruby”><span class=“ruby-identifier”>copy_images_to_dir</span>(<span class=“ruby-string”>"/path/to/foo"</span>, <span class=“ruby-string”>"/path/to/bar"</span>, :<span class=“ruby-identifier”>convert</span> =<span class=“ruby-operator”>></span> {:<span class=“ruby-identifier”>eps</span> =<span class=“ruby-operator”>></span> :<span class=“ruby-identifier”>png</span>}) </pre>
<p>Image files are copied recursively, and each '.eps' file is converted into '.eps.png'</p>
<div class="method-source-code" id="copy_images_to_dir-source"> <pre><span class="ruby-comment"># File lib/review/makerhelper.rb, line 37</span>
<span class=“ruby-keyword”>def</span> <span class=“ruby-identifier”>copy_images_to_dir</span>(<span class=“ruby-identifier”>from_dir</span>, <span class=“ruby-identifier”>to_dir</span>, <span class=“ruby-identifier”>options</span> = {})
<span class="ruby-identifier">image_files</span> = [] <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">from_dir</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">dir</span><span class="ruby-operator">|</span> <span class="ruby-identifier">dir</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">fname</span><span class="ruby-operator">|</span> <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">fname</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/^\./</span> <span class="ruby-keyword">if</span> <span class="ruby-constant">FileTest</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-node">"#{from_dir}/#{fname}"</span>) <span class="ruby-identifier">image_files</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">copy_images_to_dir</span>(<span class="ruby-node">"#{from_dir}/#{fname}"</span>, <span class="ruby-node">"#{to_dir}/#{fname}"</span>, <span class="ruby-identifier">options</span>) <span class="ruby-keyword">else</span> <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir_p</span>(<span class="ruby-identifier">to_dir</span>) <span class="ruby-keyword">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">to_dir</span>) <span class="ruby-identifier">is_converted</span> = <span class="ruby-keyword">false</span> (<span class="ruby-identifier">options</span>[<span class="ruby-value">:convert</span>] <span class="ruby-operator">||</span> {}).<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">orig_type</span>, <span class="ruby-identifier">conv_type</span><span class="ruby-operator">|</span> <span class="ruby-keyword">next</span> <span class="ruby-keyword">unless</span> <span class="ruby-node">/\.#{orig_type}$/</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">fname</span> <span class="ruby-identifier">is_converted</span> = <span class="ruby-identifier">system</span>(<span class="ruby-node">"convert #{from_dir}/#{fname} #{to_dir}/#{fname}.#{conv_type}"</span>) <span class="ruby-identifier">image_files</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"#{from_dir}/#{fname}.#{conv_type}"</span> <span class="ruby-keyword">end</span> <span class="ruby-identifier">exts</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value">:exts</span>] <span class="ruby-operator">||</span> <span class="ruby-node">%w(png gif jpg jpeg svg pdf eps ai tif)</span> <span class="ruby-identifier">exts_str</span> = <span class="ruby-identifier">exts</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">'|'</span>) <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">is_converted</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">fname</span> <span class="ruby-operator">=~</span> <span class="ruby-node">/\.(#{exts_str})$/</span> <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">cp</span> <span class="ruby-node">"#{from_dir}/#{fname}"</span>, <span class="ruby-identifier">to_dir</span> <span class="ruby-identifier">image_files</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"#{from_dir}/#{fname}"</span> <span class="ruby-keyword">end</span> <span class="ruby-keyword">end</span> <span class="ruby-keyword">end</span> <span class="ruby-keyword">end</span> <span class="ruby-identifier">image_files</span>
<span class=“ruby-keyword”>end</span></pre>
</div><!-- copy_images_to_dir-source --> </div> </div><!-- copy_images_to_dir-method --> </section><!-- public-class-method-details --> <section id="private-instance-5Buntitled-5D-method-details" class="method-section section"> <h3 class="section-header">Private Instance Methods</h3> <div id="method-i-bindir" class="method-detail "> <div class="method-heading"> <span class="method-name">bindir</span><span class="method-args">()</span> <span class="method-click-advice">click to toggle source</span> </div> <div class="method-description"> <p>Return review/bin directory</p> <div class="method-source-code" id="bindir-source"> <pre><span class="ruby-comment"># File lib/review/makerhelper.rb, line 16</span>
<span class=“ruby-keyword”>def</span> <span class=“ruby-identifier”>bindir</span>
<span class="ruby-constant">Pathname</span>.<span class="ruby-identifier">new</span>(<span class="ruby-node">"#{Pathname.new(__FILE__).realpath.dirname}/../../bin"</span>).<span class="ruby-identifier">realpath</span>
<span class=“ruby-keyword”>end</span></pre>
</div><!-- bindir-source --> </div> </div><!-- bindir-method --> <div id="method-i-copy_images_to_dir" class="method-detail "> <div class="method-heading"> <span class="method-name">copy_images_to_dir</span><span class="method-args">(from_dir, to_dir, options = {})</span> <span class="method-click-advice">click to toggle source</span> </div> <div class="method-description"> <p>Copy image files under from_dir to to_dir recursively</p>
<h4 id=“method-i-copy_images_to_dir-label-Args”>Args<span><a href=“#method-i-copy_images_to_dir-label-Args”>¶</a> <a href=“#documentation”>↑</a></span></h4> <dl class=“rdoc-list note-list”><dt>from_dir <dd> <p>path to the directory which has image files to be copied</p> </dd><dt>to_dir <dd> <p>path to the directory to which the image files are copied</p> </dd><dt>options <dd> <p>used to specify optional operations during copy</p> </dd></dl>
<h4 id=“method-i-copy_images_to_dir-label-Returns”>Returns<span><a href=“#method-i-copy_images_to_dir-label-Returns”>¶</a> <a href=“#documentation”>↑</a></span></h4>
<p>list of image files</p>
<h4 id=“method-i-copy_images_to_dir-label-Options”>Options<span><a href=“#method-i-copy_images_to_dir-label-Options”>¶</a> <a href=“#documentation”>↑</a></span></h4> <dl class=“rdoc-list note-list”><dt>:convert <dd> <p>Conversion rule</p> </dd></dl>
<h4 id=“method-i-copy_images_to_dir-label-Examples”>Examples<span><a href=“#method-i-copy_images_to_dir-label-Examples”>¶</a> <a href=“#documentation”>↑</a></span></h4>
<pre class=“ruby”><span class=“ruby-identifier”>copy_images_to_dir</span>(<span class=“ruby-string”>"/path/to/foo"</span>, <span class=“ruby-string”>"/path/to/bar"</span>, :<span class=“ruby-identifier”>convert</span> =<span class=“ruby-operator”>></span> {:<span class=“ruby-identifier”>eps</span> =<span class=“ruby-operator”>></span> :<span class=“ruby-identifier”>png</span>}) </pre>
<p>Image files are copied recursively, and each '.eps' file is converted into '.eps.png'</p>
<div class="method-source-code" id="copy_images_to_dir-source"> <pre><span class="ruby-comment"># File lib/review/makerhelper.rb, line 37</span>
<span class=“ruby-keyword”>def</span> <span class=“ruby-identifier”>copy_images_to_dir</span>(<span class=“ruby-identifier”>from_dir</span>, <span class=“ruby-identifier”>to_dir</span>, <span class=“ruby-identifier”>options</span> = {})
<span class="ruby-identifier">image_files</span> = [] <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">from_dir</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">dir</span><span class="ruby-operator">|</span> <span class="ruby-identifier">dir</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">fname</span><span class="ruby-operator">|</span> <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">fname</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/^\./</span> <span class="ruby-keyword">if</span> <span class="ruby-constant">FileTest</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-node">"#{from_dir}/#{fname}"</span>) <span class="ruby-identifier">image_files</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">copy_images_to_dir</span>(<span class="ruby-node">"#{from_dir}/#{fname}"</span>, <span class="ruby-node">"#{to_dir}/#{fname}"</span>, <span class="ruby-identifier">options</span>) <span class="ruby-keyword">else</span> <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir_p</span>(<span class="ruby-identifier">to_dir</span>) <span class="ruby-keyword">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">to_dir</span>) <span class="ruby-identifier">is_converted</span> = <span class="ruby-keyword">false</span> (<span class="ruby-identifier">options</span>[<span class="ruby-value">:convert</span>] <span class="ruby-operator">||</span> {}).<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">orig_type</span>, <span class="ruby-identifier">conv_type</span><span class="ruby-operator">|</span> <span class="ruby-keyword">next</span> <span class="ruby-keyword">unless</span> <span class="ruby-node">/\.#{orig_type}$/</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">fname</span> <span class="ruby-identifier">is_converted</span> = <span class="ruby-identifier">system</span>(<span class="ruby-node">"convert #{from_dir}/#{fname} #{to_dir}/#{fname}.#{conv_type}"</span>) <span class="ruby-identifier">image_files</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"#{from_dir}/#{fname}.#{conv_type}"</span> <span class="ruby-keyword">end</span> <span class="ruby-identifier">exts</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value">:exts</span>] <span class="ruby-operator">||</span> <span class="ruby-node">%w(png gif jpg jpeg svg pdf eps ai tif)</span> <span class="ruby-identifier">exts_str</span> = <span class="ruby-identifier">exts</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">'|'</span>) <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">is_converted</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">fname</span> <span class="ruby-operator">=~</span> <span class="ruby-node">/\.(#{exts_str})$/</span> <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">cp</span> <span class="ruby-node">"#{from_dir}/#{fname}"</span>, <span class="ruby-identifier">to_dir</span> <span class="ruby-identifier">image_files</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"#{from_dir}/#{fname}"</span> <span class="ruby-keyword">end</span> <span class="ruby-keyword">end</span> <span class="ruby-keyword">end</span> <span class="ruby-keyword">end</span> <span class="ruby-identifier">image_files</span>
<span class=“ruby-keyword”>end</span></pre>
</div><!-- copy_images_to_dir-source --> </div> </div><!-- copy_images_to_dir-method --> </section><!-- private-instance-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>