<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”> <html lang=‘en’ xml:lang=‘en’ xmlns=‘www.w3.org/1999/xhtml’>

<head>
  <title>rcov/ruby/1.8/gems/rspec-core-2.5.1/lib/rspec/core/configuration_options.rb</title>
  <link href="screen.css" media="all" rel="stylesheet" type="text/css" />
  <link href="print.css" media="print" rel="stylesheet" type="text/css" />

  <meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
  <script type="text/javascript" src="rcov.js"></script>
</head>
<body>
  <h1>Rspec Steps C0 Coverage Information - RCov</h1>
  <h2>rcov/ruby/1.8/gems/rspec-core-2.5.1/lib/rspec/core/configuration_options.rb</h2>

  <div class="report_table_wrapper">
    <table class='report' id='report_table'>
      <thead>
        <tr>
          <th class="left_align">Name</th>
          <th class="right_align">Total Lines</th>
          <th class="right_align">Lines of Code</th>
          <th class="left_align">Total Coverage</th>
          <th class="left_align">Code Coverage</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td class="left_align"><a href="rcov-ruby-1_8-gems-rspec-core-2_5_1-lib-rspec-core-configuration_options_rb.html">rcov/ruby/1.8/gems/rspec-core-2.5.1/lib/rspec/core/configuration_options.rb</a></td>
          <td class='right_align'><tt>126</tt></td>
          <td class='right_align'><tt>107</tt></td>
          <td class="left_align"><div class="percent_graph_legend"><tt class=''>74.60%</tt></div>
        <div class="percent_graph">
          <div class="covered" style="width:75px"></div>
          <div class="uncovered" style="width:25px"></div>
        </div></td>
          <td class="left_align"><div class="percent_graph_legend"><tt class=''>70.09%</tt></div>
        <div class="percent_graph">
          <div class="covered" style="width:70px"></div>
          <div class="uncovered" style="width:30px"></div>
        </div></td>
        </tr>
      </tbody>
    </table>
  </div>

  <h3>Key</h3>

  <div class="key"><pre><span class='marked'>Code reported as executed by Ruby looks like this...</span><span class='marked1'>and this: this line is also marked as covered.</span><span class='inferred'>Lines considered as run by rcov, but not reported by Ruby, look like this,</span><span class='inferred1'>and this: these lines were inferred by rcov (using simple heuristics).</span><span class='uncovered'>Finally, here's a line marked as not executed.</span></pre></div>

  <h3>Coverage Details</h3>

  <table class="details">
    <tbody>

        <tr class="inferred">
          <td><pre><a name="line1">1</a> # http://www.ruby-doc.org/stdlib/libdoc/optparse/rdoc/classes/OptionParser.html</pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line2">2</a> require 'optparse'</pre></td>
        </tr>

        <tr class="inferred">
          <td><pre><a name="line3">3</a> </pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line4">4</a> module RSpec</pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line5">5</a>   module Core</pre></td>
        </tr>

        <tr class="inferred">
          <td><pre><a name="line6">6</a> </pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line7">7</a>     class ConfigurationOptions</pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line8">8</a>       LOCAL_OPTIONS_FILE  = &quot;.rspec&quot;</pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line9">9</a>       GLOBAL_OPTIONS_FILE = File.join(File.expand_path(&quot;~&quot;), &quot;.rspec&quot;)</pre></td>
        </tr>

        <tr class="inferred">
          <td><pre><a name="line10">10</a> </pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line11">11</a>       attr_reader :options</pre></td>
        </tr>

        <tr class="inferred">
          <td><pre><a name="line12">12</a> </pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line13">13</a>       def initialize(args)</pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line14">14</a>         @args = args</pre></td>
        </tr>

        <tr class="inferred">
          <td><pre><a name="line15">15</a>       end</pre></td>
        </tr>

        <tr class="inferred">
          <td><pre><a name="line16">16</a> </pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line17">17</a>       def configure(config)</pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line18">18</a>         keys = options.keys</pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line19">19</a>         keys.unshift(:requires) if keys.delete(:requires)</pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line20">20</a>         keys.unshift(:libs)     if keys.delete(:libs)</pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line21">21</a>         formatters = options[:formatters] if keys.delete(:formatters)</pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line22">22</a>         keys.each do |key|</pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line23">23</a>           config.send(&quot;#{key}=&quot;, options[key]) if config.respond_to?(&quot;#{key}=&quot;)</pre></td>
        </tr>

        <tr class="inferred">
          <td><pre><a name="line24">24</a>         end</pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line25">25</a>         if formatters</pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line26">26</a>           formatters.each do |pair|</pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line27">27</a>             config.add_formatter(*pair)</pre></td>
        </tr>

        <tr class="inferred">
          <td><pre><a name="line28">28</a>           end</pre></td>
        </tr>

        <tr class="inferred">
          <td><pre><a name="line29">29</a>         end</pre></td>
        </tr>

        <tr class="inferred">
          <td><pre><a name="line30">30</a>       end</pre></td>
        </tr>

        <tr class="inferred">
          <td><pre><a name="line31">31</a> </pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line32">32</a>       def drb_argv</pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line33">33</a>         argv = []</pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line34">34</a>         argv &lt;&lt; &quot;--color&quot;        if options[:color_enabled]</pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line35">35</a>         argv &lt;&lt; &quot;--profile&quot;      if options[:profile_examples]</pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line36">36</a>         argv &lt;&lt; &quot;--backtrace&quot;    if options[:full_backtrace]</pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line37">37</a>         argv &lt;&lt; &quot;--tty&quot;          if options[:tty]</pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line38">38</a>         argv &lt;&lt; &quot;--fail-fast&quot;    if options[:fail_fast]</pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line39">39</a>         argv &lt;&lt; &quot;--line_number&quot;  &lt;&lt; options[:line_number]             if options[:line_number]</pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line40">40</a>         argv &lt;&lt; &quot;--options&quot;      &lt;&lt; options[:custom_options_file]     if options[:custom_options_file]</pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line41">41</a>         argv &lt;&lt; &quot;--example&quot;      &lt;&lt; options[:full_description].source if options[:full_description]</pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line42">42</a>         if options[:filter]</pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line43">43</a>           options[:filter].each_pair do |k, v|</pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line44">44</a>             argv &lt;&lt; &quot;--tag&quot; &lt;&lt; k.to_s</pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line45">45</a>           end</pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line46">46</a>         end</pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line47">47</a>         if options[:formatters]</pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line48">48</a>           options[:formatters].each do |pair|</pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line49">49</a>             argv &lt;&lt; &quot;--format&quot; &lt;&lt; pair[0]</pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line50">50</a>             argv &lt;&lt; &quot;--out&quot; &lt;&lt; pair[1] if pair[1]</pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line51">51</a>           end</pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line52">52</a>         end</pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line53">53</a>         (options[:libs] || []).each do |path|</pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line54">54</a>           argv &lt;&lt; &quot;-I&quot; &lt;&lt; path</pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line55">55</a>         end</pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line56">56</a>         (options[:requires] || []).each do |path|</pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line57">57</a>           argv &lt;&lt; &quot;--require&quot; &lt;&lt; path</pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line58">58</a>         end</pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line59">59</a>         argv + options[:files_or_directories_to_run]</pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line60">60</a>       end</pre></td>
        </tr>

        <tr class="inferred">
          <td><pre><a name="line61">61</a> </pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line62">62</a>       def parse_options</pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line63">63</a>         @options = begin</pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line64">64</a>                      options_to_merge = []</pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line65">65</a>                      if custom_options_file</pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line66">66</a>                        options_to_merge &lt;&lt; custom_options</pre></td>
        </tr>

        <tr class="inferred">
          <td><pre><a name="line67">67</a>                      else</pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line68">68</a>                        options_to_merge &lt;&lt; global_options</pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line69">69</a>                        options_to_merge &lt;&lt; local_options</pre></td>
        </tr>

        <tr class="inferred">
          <td><pre><a name="line70">70</a>                      end</pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line71">71</a>                      options_to_merge &lt;&lt; command_line_options</pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line72">72</a>                      options_to_merge &lt;&lt; env_options</pre></td>
        </tr>

        <tr class="inferred">
          <td><pre><a name="line73">73</a> </pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line74">74</a>                      options_to_merge.inject do |merged, options|</pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line75">75</a>                        merged.merge(options)</pre></td>
        </tr>

        <tr class="inferred">
          <td><pre><a name="line76">76</a>                      end</pre></td>
        </tr>

        <tr class="inferred">
          <td><pre><a name="line77">77</a>                    end</pre></td>
        </tr>

        <tr class="inferred">
          <td><pre><a name="line78">78</a>       end</pre></td>
        </tr>

        <tr class="inferred">
          <td><pre><a name="line79">79</a> </pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line80">80</a>     private</pre></td>
        </tr>

        <tr class="inferred">
          <td><pre><a name="line81">81</a> </pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line82">82</a>       def env_options</pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line83">83</a>         ENV[&quot;SPEC_OPTS&quot;] ? Parser.parse!(ENV[&quot;SPEC_OPTS&quot;].split) : {}</pre></td>
        </tr>

        <tr class="inferred">
          <td><pre><a name="line84">84</a>       end</pre></td>
        </tr>

        <tr class="inferred">
          <td><pre><a name="line85">85</a> </pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line86">86</a>       def command_line_options</pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line87">87</a>         @command_line_options ||= begin</pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line88">88</a>                                     options = Parser.parse!(@args)</pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line89">89</a>                                     options[:files_or_directories_to_run] = @args</pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line90">90</a>                                     options</pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line91">91</a>                                   end</pre></td>
        </tr>

        <tr class="inferred">
          <td><pre><a name="line92">92</a>       end</pre></td>
        </tr>

        <tr class="inferred">
          <td><pre><a name="line93">93</a> </pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line94">94</a>       def custom_options</pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line95">95</a>         options_from(custom_options_file)</pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line96">96</a>       end</pre></td>
        </tr>

        <tr class="inferred">
          <td><pre><a name="line97">97</a> </pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line98">98</a>       def local_options</pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line99">99</a>         @local_options ||= options_from(LOCAL_OPTIONS_FILE)</pre></td>
        </tr>

        <tr class="inferred">
          <td><pre><a name="line100">100</a>       end</pre></td>
        </tr>

        <tr class="inferred">
          <td><pre><a name="line101">101</a> </pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line102">102</a>       def global_options</pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line103">103</a>         @global_options ||= options_from(GLOBAL_OPTIONS_FILE)</pre></td>
        </tr>

        <tr class="inferred">
          <td><pre><a name="line104">104</a>       end</pre></td>
        </tr>

        <tr class="inferred">
          <td><pre><a name="line105">105</a> </pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line106">106</a>       def options_from(path)</pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line107">107</a>         Parser.parse(args_from_options_file(path))</pre></td>
        </tr>

        <tr class="inferred">
          <td><pre><a name="line108">108</a>       end</pre></td>
        </tr>

        <tr class="inferred">
          <td><pre><a name="line109">109</a> </pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line110">110</a>       def args_from_options_file(path)</pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line111">111</a>         return [] unless File.exist?(path)</pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line112">112</a>         config_string = options_file_as_erb_string(path)</pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line113">113</a>         config_string.split(/\n+/).map {|l| l.split}.flatten</pre></td>
        </tr>

        <tr class="inferred">
          <td><pre><a name="line114">114</a>       end</pre></td>
        </tr>

        <tr class="inferred">
          <td><pre><a name="line115">115</a> </pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line116">116</a>       def options_file_as_erb_string(path)</pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line117">117</a>         require 'erb'</pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line118">118</a>         ERB.new(IO.read(path)).result(binding)</pre></td>
        </tr>

        <tr class="inferred">
          <td><pre><a name="line119">119</a>       end</pre></td>
        </tr>

        <tr class="inferred">
          <td><pre><a name="line120">120</a> </pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line121">121</a>       def custom_options_file</pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line122">122</a>         command_line_options[:custom_options_file]</pre></td>
        </tr>

        <tr class="inferred">
          <td><pre><a name="line123">123</a>       end</pre></td>
        </tr>

        <tr class="inferred">
          <td><pre><a name="line124">124</a>     end</pre></td>
        </tr>

        <tr class="inferred">
          <td><pre><a name="line125">125</a>   end</pre></td>
        </tr>

        <tr class="inferred">
          <td><pre><a name="line126">126</a> end</pre></td>
        </tr>

    </tbody>
  </table>

  <p>Generated on Fri Apr 22 17:22:42 -0700 2011 with <a href="http://github.com/relevance/rcov">rcov 0.9.8</a></p>

</body>

</html>