doc/StandupMD/File.html in standup_md-0.3.1 vs doc/StandupMD/File.html in standup_md-0.3.2
- old
+ new
@@ -79,10 +79,12 @@
<li ><a href="#method-c-find">::find</a>
<li ><a href="#method-c-find_by_date">::find_by_date</a>
+ <li ><a href="#method-c-load">::load</a>
+
<li ><a href="#method-c-new">::new</a>
<li ><a href="#method-i-exist-3F">#exist?</a>
<li ><a href="#method-i-load">#load</a>
@@ -219,11 +221,11 @@
<div class="method-source-code" id="find-source">
- <pre><span class="ruby-comment"># File lib/standup_md/file.rb, line 26</span>
+ <pre><span class="ruby-comment"># File lib/standup_md/file.rb, line 36</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">find</span>(<span class="ruby-identifier">file_name</span>)
<span class="ruby-identifier">file</span> = <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">entries</span>(<span class="ruby-identifier">config</span>.<span class="ruby-identifier">directory</span>).<span class="ruby-identifier">bsearch</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">f</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">file_name</span> }
<span class="ruby-keyword">if</span> <span class="ruby-identifier">file</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&&</span> <span class="ruby-operator">!</span><span class="ruby-identifier">config</span>.<span class="ruby-identifier">create</span>
<span class="ruby-identifier">raise</span> <span class="ruby-node">"File #{file_name} not found."</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">config</span>.<span class="ruby-identifier">create</span>
<span class="ruby-keyword">end</span>
@@ -258,11 +260,11 @@
<div class="method-source-code" id="find_by_date-source">
- <pre><span class="ruby-comment"># File lib/standup_md/file.rb, line 38</span>
+ <pre><span class="ruby-comment"># File lib/standup_md/file.rb, line 48</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">find_by_date</span>(<span class="ruby-identifier">date</span>)
<span class="ruby-keyword">unless</span> <span class="ruby-identifier">date</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Date</span>)
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-string">"Argument must be a Date object"</span>
<span class="ruby-keyword">end</span>
<span class="ruby-identifier">find</span>(<span class="ruby-identifier">date</span>.<span class="ruby-identifier">strftime</span>(<span class="ruby-identifier">config</span>.<span class="ruby-identifier">name_format</span>))
@@ -275,10 +277,47 @@
</div>
+ <div id="method-c-load" class="method-detail ">
+
+ <div class="method-heading">
+ <span class="method-name">load</span><span
+ class="method-args">(file_name)</span>
+
+ <span class="method-click-advice">click to toggle source</span>
+
+ </div>
+
+
+ <div class="method-description">
+
+ <p>Convenience method for calling <a href="File.html#method-c-find"><code>File.find(file_name)</code></a>.load</p>
+
+<p>@param [String] file_name</p>
+
+<p>@return [StandupMD::File]</p>
+
+
+
+
+ <div class="method-source-code" id="load-source">
+ <pre><span class="ruby-comment"># File lib/standup_md/file.rb, line 28</span>
+<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">load</span>(<span class="ruby-identifier">file_name</span>)
+ <span class="ruby-identifier">new</span>(<span class="ruby-identifier">file_name</span>).<span class="ruby-identifier">load</span>
+<span class="ruby-keyword">end</span></pre>
+ </div>
+
+ </div>
+
+
+
+
+ </div>
+
+
<div id="method-c-new" class="method-detail ">
<div class="method-heading">
<span class="method-name">new</span><span
class="method-args">(file_name)</span>
@@ -298,11 +337,11 @@
<div class="method-source-code" id="new-source">
- <pre><span class="ruby-comment"># File lib/standup_md/file.rb, line 63</span>
+ <pre><span class="ruby-comment"># File lib/standup_md/file.rb, line 73</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">file_name</span>)
<span class="ruby-ivar">@config</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">config</span>
<span class="ruby-keyword">if</span> <span class="ruby-identifier">file_name</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-operator">::</span><span class="ruby-constant">File</span><span class="ruby-operator">::</span><span class="ruby-constant">SEPARATOR</span>)
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>,
<span class="ruby-node">"#{file_name} contains directory. Please use `StandupMD.config.file.directory=`"</span>
@@ -360,11 +399,11 @@
<div class="method-source-code" id="exist-3F-source">
- <pre><span class="ruby-comment"># File lib/standup_md/file.rb, line 106</span>
+ <pre><span class="ruby-comment"># File lib/standup_md/file.rb, line 116</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">exist?</span>
<span class="ruby-operator">::</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">name</span>)
<span class="ruby-keyword">end</span></pre>
</div>
@@ -395,11 +434,11 @@
<div class="method-source-code" id="load-source">
- <pre><span class="ruby-comment"># File lib/standup_md/file.rb, line 115</span>
+ <pre><span class="ruby-comment"># File lib/standup_md/file.rb, line 125</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">load</span>
<span class="ruby-identifier">raise</span> <span class="ruby-node">"File #{name} does not exist."</span> <span class="ruby-keyword">unless</span> <span class="ruby-operator">::</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">file?</span>(<span class="ruby-identifier">name</span>)
<span class="ruby-identifier">entry_list</span> = <span class="ruby-constant">EntryList</span>.<span class="ruby-identifier">new</span>
<span class="ruby-identifier">record</span> = {}
<span class="ruby-identifier">section_type</span> = <span class="ruby-string">''</span>
@@ -457,11 +496,11 @@
<div class="method-source-code" id="loaded-3F-source">
- <pre><span class="ruby-comment"># File lib/standup_md/file.rb, line 98</span>
+ <pre><span class="ruby-comment"># File lib/standup_md/file.rb, line 108</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">loaded?</span>
<span class="ruby-ivar">@loaded</span>
<span class="ruby-keyword">end</span></pre>
</div>
@@ -492,11 +531,11 @@
<div class="method-source-code" id="new-3F-source">
- <pre><span class="ruby-comment"># File lib/standup_md/file.rb, line 90</span>
+ <pre><span class="ruby-comment"># File lib/standup_md/file.rb, line 100</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">new?</span>
<span class="ruby-ivar">@new</span>
<span class="ruby-keyword">end</span></pre>
</div>
@@ -529,10 +568,10 @@
<div class="method-source-code" id="write-source">
- <pre><span class="ruby-comment"># File lib/standup_md/file.rb, line 154</span>
+ <pre><span class="ruby-comment"># File lib/standup_md/file.rb, line 164</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">write</span>(<span class="ruby-identifier">dates</span> = {})
<span class="ruby-identifier">sorted_entries</span> = <span class="ruby-identifier">entries</span>.<span class="ruby-identifier">sort</span>
<span class="ruby-identifier">start_date</span> = <span class="ruby-identifier">dates</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-value">:start_date</span>, <span class="ruby-identifier">sorted_entries</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">date</span>)
<span class="ruby-identifier">end_date</span> = <span class="ruby-identifier">dates</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-value">:end_date</span>, <span class="ruby-identifier">sorted_entries</span>.<span class="ruby-identifier">last</span>.<span class="ruby-identifier">date</span>)
<span class="ruby-operator">::</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">name</span>, <span class="ruby-string">'w'</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>