<!DOCTYPE html>

<html>
<head>
<meta charset="UTF-8">

<title>Guardfile - RDoc Documentation</title>

<script type="text/javascript">
  var rdoc_rel_prefix = "./";
  var index_rel_prefix = "./";
</script>

<script src="./js/jquery.js"></script>
<script src="./js/darkfish.js"></script>

<link href="./css/fonts.css" rel="stylesheet">
<link href="./css/rdoc.css" rel="stylesheet">



<body id="top" role="document" class="file">
<nav role="navigation">
  <div id="project-navigation">
    <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2>
    <a href="./index.html" rel="home">Home</a>
  </h2>

  <div id="table-of-contents-navigation">
    <a href="./table_of_contents.html#pages">Pages</a>
    <a href="./table_of_contents.html#classes">Classes</a>
    <a href="./table_of_contents.html#methods">Methods</a>
  </div>
</div>

    <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

  </div>

  

  <div id="project-metadata">
    <div id="fileindex-section" class="nav-section">
  <h3>Pages</h3>

  <ul class="link-list">
  
    <li><a href="./Gemfile.html">Gemfile</a>
  
    <li><a href="./Gemfile_lock.html">Gemfile.lock</a>
  
    <li><a href="./Guardfile.html">Guardfile</a>
  
    <li><a href="./LICENSE_txt.html">LICENSE</a>
  
    <li><a href="./README_md.html">README</a>
  
    <li><a href="./Rakefile.html">Rakefile</a>
  
    <li><a href="./alimento_gemspec.html">alimento.gemspec</a>
  
    <li><a href="./bin/setup.html">setup</a>
  
  </ul>
</div>

  </div>
</nav>

<main role="main" aria-label="Page Guardfile">

<p># A sample <a href="Guardfile.html">Guardfile</a> # More info at <a
href="https://github.com/guard/guard#readme">github.com/guard/guard#readme</a></p>

<p>## Uncomment and set this to only include directories you want to watch #
directories %w(app lib config test spec features) \ #  .select{|d|
Dir.exists?(d) ? d : UI.warning(“Directory #{d} does not exist”)}</p>

<p>## Note: if you are using the `directories` clause above and you are not ##
watching the project directory (&#39;.&#39;), then you will want to move ##
the <a href="Guardfile.html">Guardfile</a> to a watched dir and symlink it
back, e.g. # #  $ mkdir config #  $ mv <a
href="Guardfile.html">Guardfile</a> config/ #  $ ln -s config/Guardfile . #
# and, you&#39;ll have to watch “config/Guardfile” instead of “Guardfile”</p>

<p>guard :bundler do</p>

<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">&#39;guard/bundler&#39;</span>
<span class="ruby-identifier">require</span> <span class="ruby-string">&#39;guard/bundler/verify&#39;</span>
<span class="ruby-identifier">helper</span> = <span class="ruby-constant">Guard</span><span class="ruby-operator">::</span><span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">Verify</span>.<span class="ruby-identifier">new</span>

<span class="ruby-identifier">files</span> = [<span class="ruby-string">&#39;Gemfile&#39;</span>]
<span class="ruby-identifier">files</span> <span class="ruby-operator">+=</span> <span class="ruby-constant">Dir</span>[<span class="ruby-string">&#39;*.gemspec&#39;</span>] <span class="ruby-keyword">if</span> <span class="ruby-identifier">files</span>.<span class="ruby-identifier">any?</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">helper</span>.<span class="ruby-identifier">uses_gemspec?</span>(<span class="ruby-identifier">f</span>) }

<span class="ruby-comment"># Assume files are symlinked from somewhere</span>
<span class="ruby-identifier">files</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span> <span class="ruby-identifier">watch</span>(<span class="ruby-identifier">helper</span>.<span class="ruby-identifier">real_path</span>(<span class="ruby-identifier">file</span>)) }
</pre>

<p>end</p>

<p># Note: The cmd option is now required due to the increasing number of ways
#       rspec may be run, below are examples of the most common uses. #  *
bundler: &#39;bundle exec rspec&#39; #  * bundler binstubs:
&#39;bin/rspec&#39; #  * spring: &#39;bin/rspec&#39; (This will use spring
if running and you have #                          installed the spring
binstubs per the docs) #  * zeus: &#39;zeus rspec&#39; (requires the server
to be started separately) #  * &#39;just&#39; rspec: &#39;rspec&#39;</p>

<p>guard :rspec, cmd: “bundle exec rspec” do</p>

<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">&quot;guard/rspec/dsl&quot;</span>
<span class="ruby-identifier">dsl</span> = <span class="ruby-constant">Guard</span><span class="ruby-operator">::</span><span class="ruby-constant">RSpec</span><span class="ruby-operator">::</span><span class="ruby-constant">Dsl</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword">self</span>)

<span class="ruby-comment"># Feel free to open issues for suggestions and improvements</span>

<span class="ruby-comment"># RSpec files</span>
<span class="ruby-identifier">rspec</span> = <span class="ruby-identifier">dsl</span>.<span class="ruby-identifier">rspec</span>
<span class="ruby-identifier">watch</span>(<span class="ruby-identifier">rspec</span>.<span class="ruby-identifier">spec_helper</span>) { <span class="ruby-identifier">rspec</span>.<span class="ruby-identifier">spec_dir</span> }
<span class="ruby-identifier">watch</span>(<span class="ruby-identifier">rspec</span>.<span class="ruby-identifier">spec_support</span>) { <span class="ruby-identifier">rspec</span>.<span class="ruby-identifier">spec_dir</span> }
<span class="ruby-identifier">watch</span>(<span class="ruby-identifier">rspec</span>.<span class="ruby-identifier">spec_files</span>)

<span class="ruby-comment"># Ruby files</span>
<span class="ruby-identifier">ruby</span> = <span class="ruby-identifier">dsl</span>.<span class="ruby-identifier">ruby</span>
<span class="ruby-identifier">dsl</span>.<span class="ruby-identifier">watch_spec_files_for</span>(<span class="ruby-identifier">ruby</span>.<span class="ruby-identifier">lib_files</span>)

<span class="ruby-comment"># Rails files</span>
<span class="ruby-identifier">rails</span> = <span class="ruby-identifier">dsl</span>.<span class="ruby-identifier">rails</span>(<span class="ruby-identifier">view_extensions</span><span class="ruby-operator">:</span> <span class="ruby-node">%w(erb haml slim)</span>)
<span class="ruby-identifier">dsl</span>.<span class="ruby-identifier">watch_spec_files_for</span>(<span class="ruby-identifier">rails</span>.<span class="ruby-identifier">app_files</span>)
<span class="ruby-identifier">dsl</span>.<span class="ruby-identifier">watch_spec_files_for</span>(<span class="ruby-identifier">rails</span>.<span class="ruby-identifier">views</span>)

<span class="ruby-identifier">watch</span>(<span class="ruby-identifier">rails</span>.<span class="ruby-identifier">controllers</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">m</span><span class="ruby-operator">|</span>
  [
    <span class="ruby-identifier">rspec</span>.<span class="ruby-identifier">spec</span>.<span class="ruby-identifier">call</span>(<span class="ruby-node">&quot;routing/#{m[1]}_routing&quot;</span>),
    <span class="ruby-identifier">rspec</span>.<span class="ruby-identifier">spec</span>.<span class="ruby-identifier">call</span>(<span class="ruby-node">&quot;controllers/#{m[1]}_controller&quot;</span>),
    <span class="ruby-identifier">rspec</span>.<span class="ruby-identifier">spec</span>.<span class="ruby-identifier">call</span>(<span class="ruby-node">&quot;acceptance/#{m[1]}&quot;</span>)
  ]
<span class="ruby-keyword">end</span>

<span class="ruby-comment"># Rails config changes</span>
<span class="ruby-identifier">watch</span>(<span class="ruby-identifier">rails</span>.<span class="ruby-identifier">spec_helper</span>)     { <span class="ruby-identifier">rspec</span>.<span class="ruby-identifier">spec_dir</span> }
<span class="ruby-identifier">watch</span>(<span class="ruby-identifier">rails</span>.<span class="ruby-identifier">routes</span>)          { <span class="ruby-node">&quot;#{rspec.spec_dir}/routing&quot;</span> }
<span class="ruby-identifier">watch</span>(<span class="ruby-identifier">rails</span>.<span class="ruby-identifier">app_controller</span>)  { <span class="ruby-node">&quot;#{rspec.spec_dir}/controllers&quot;</span> }

<span class="ruby-comment"># Capybara features specs</span>
<span class="ruby-identifier">watch</span>(<span class="ruby-identifier">rails</span>.<span class="ruby-identifier">view_dirs</span>)     { <span class="ruby-operator">|</span><span class="ruby-identifier">m</span><span class="ruby-operator">|</span> <span class="ruby-identifier">rspec</span>.<span class="ruby-identifier">spec</span>.<span class="ruby-identifier">call</span>(<span class="ruby-node">&quot;features/#{m[1]}&quot;</span>) }
<span class="ruby-identifier">watch</span>(<span class="ruby-identifier">rails</span>.<span class="ruby-identifier">layouts</span>)       { <span class="ruby-operator">|</span><span class="ruby-identifier">m</span><span class="ruby-operator">|</span> <span class="ruby-identifier">rspec</span>.<span class="ruby-identifier">spec</span>.<span class="ruby-identifier">call</span>(<span class="ruby-node">&quot;features/#{m[1]}&quot;</span>) }

<span class="ruby-comment"># Turnip features and steps</span>
<span class="ruby-identifier">watch</span>(<span class="ruby-regexp">%r{^spec/acceptance/(.+)\.feature$}</span>)
<span class="ruby-identifier">watch</span>(<span class="ruby-regexp">%r{^spec/acceptance/steps/(.+)_steps\.rb$}</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">m</span><span class="ruby-operator">|</span>
  <span class="ruby-constant">Dir</span>[<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-node">&quot;**/#{m[1]}.feature&quot;</span>)][<span class="ruby-value">0</span>] <span class="ruby-operator">||</span> <span class="ruby-string">&quot;spec/acceptance&quot;</span>
<span class="ruby-keyword">end</span>
</pre>

<p>end</p>
</main>



<footer id="validator-badges" role="contentinfo">
  <p><a href="http://validator.w3.org/check/referer">Validate</a>
  <p>Generated by <a href="https://rdoc.github.io/rdoc">RDoc</a> 5.1.0.
  <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
</footer>