hash-that-tree 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -224,7 +224,7 @@
224
224
 
225
225
  <div class="method-source-code" id="new-source">
226
226
  <pre>
227
- <span class="ruby-comment"># File lib/hashthattree.rb, line 80</span>
227
+ <span class="ruby-comment"># File lib/hashthattree.rb, line 75</span>
228
228
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">file_name</span>, <span class="ruby-identifier">file_hash1</span>, <span class="ruby-identifier">file_hash2</span>)
229
229
  <span class="ruby-ivar">@file_name</span> = <span class="ruby-identifier">file_name</span>
230
230
  <span class="ruby-ivar">@file_hash1</span> = <span class="ruby-identifier">file_hash1</span>
@@ -215,7 +215,7 @@ analysis</p>
215
215
 
216
216
  <div class="method-source-code" id="new-source">
217
217
  <pre>
218
- <span class="ruby-comment"># File lib/hashthattree.rb, line 25</span>
218
+ <span class="ruby-comment"># File lib/hashthattree.rb, line 20</span>
219
219
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">folder1</span>, <span class="ruby-identifier">folder2</span>)
220
220
  <span class="ruby-ivar">@folder1</span> = <span class="ruby-identifier">folder1</span>
221
221
  <span class="ruby-ivar">@folder2</span> = <span class="ruby-identifier">folder2</span>
@@ -259,7 +259,7 @@ results of the comparisson</p>
259
259
 
260
260
  <div class="method-source-code" id="compare-source">
261
261
  <pre>
262
- <span class="ruby-comment"># File lib/hashthattree.rb, line 48</span>
262
+ <span class="ruby-comment"># File lib/hashthattree.rb, line 43</span>
263
263
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">compare</span>
264
264
 
265
265
  <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">foreach</span>(<span class="ruby-ivar">@folder1</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">item</span><span class="ruby-operator">|</span>
@@ -304,16 +304,17 @@ results of the comparisson</p>
304
304
  <div class="method-description">
305
305
 
306
306
  <p>Dumps the contents of the <a
307
- href="FileHashResults.html">FileHashResults</a> object to standard out</p>
307
+ href="FileHashResults.html">FileHashResults</a> object in csv form to
308
+ standard out</p>
308
309
 
309
310
 
310
311
 
311
312
  <div class="method-source-code" id="display_results-source">
312
313
  <pre>
313
- <span class="ruby-comment"># File lib/hashthattree.rb, line 70</span>
314
+ <span class="ruby-comment"># File lib/hashthattree.rb, line 65</span>
314
315
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">display_results</span>
315
- <span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;FileName Hash1 Hash2&quot;</span>
316
- <span class="ruby-ivar">@filehash</span>.<span class="ruby-identifier">each</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span> <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;#{value.file_name} is #{value.file_hash1} #{value.file_hash2}&quot;</span> }
316
+ <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;FileName,#{@folder1},#{@folder2},Are Equal&quot;</span>
317
+ <span class="ruby-ivar">@filehash</span>.<span class="ruby-identifier">each</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span> <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;#{value.file_name},#{value.file_hash1},#{value.file_hash2}, #{value.file_hash1==value.file_hash2}&quot;</span> }
317
318
  <span class="ruby-keyword">end</span></pre>
318
319
  </div><!-- display_results-source -->
319
320
 
@@ -344,7 +345,7 @@ href="FileHashResults.html">FileHashResults</a> object to standard out</p>
344
345
 
345
346
  <div class="method-source-code" id="validate-source">
346
347
  <pre>
347
- <span class="ruby-comment"># File lib/hashthattree.rb, line 33</span>
348
+ <span class="ruby-comment"># File lib/hashthattree.rb, line 28</span>
348
349
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">validate</span>
349
350
  <span class="ruby-keyword">if</span>(<span class="ruby-identifier">folder1</span><span class="ruby-operator">==</span><span class="ruby-keyword">nil</span>) <span class="ruby-operator">||</span> (<span class="ruby-identifier">folder1</span><span class="ruby-operator">==</span><span class="ruby-string">&quot;&quot;</span>) <span class="ruby-operator">||</span> <span class="ruby-operator">!</span><span class="ruby-constant">Dir</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-identifier">folder1</span>)
350
351
  <span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;a valid folder path is required as argument 1&quot;</span>
@@ -121,16 +121,10 @@
121
121
  <h1 class="module">HashThatTree</h1>
122
122
 
123
123
  <div id="description" class="description">
124
- <table class="rdoc-list"><tr><td class="rdoc-term"><p>Author</p></td>
125
- <td>
126
- <p>John Ryan (<a href="mailto:555john@gmail.com">555john@gmail.com</a>)</p>
127
- </td></tr><tr><td class="rdoc-term"><p>Copyright</p></td>
128
- <td>
129
- <p>Copyright © 2012 John Ryan</p>
130
- </td></tr><tr><td class="rdoc-term"><p>License</p></td>
131
- <td>
132
- <p>Distributes under the same terms as Ruby</p>
133
- </td></tr></table>
124
+
125
+ <p>The program takes two directories and creates a MD5 hash for every file
126
+ contained within. It then builds a result set that compares files with the
127
+ same name and allows for them to be outputted as a csv string</p>
134
128
 
135
129
  </div><!-- description -->
136
130
 
@@ -150,7 +144,7 @@
150
144
 
151
145
  <dt><a name="VERSION">VERSION</a></dt>
152
146
 
153
- <dd class="description"></dd>
147
+ <dd class="description"><p>File containing the current version of the gem</p></dd>
154
148
 
155
149
 
156
150
  </dl>
data/doc/created.rid CHANGED
@@ -1,6 +1,6 @@
1
- Mon, 05 Nov 2012 10:45:27 +0000
1
+ Mon, 05 Nov 2012 11:43:37 +0000
2
2
  ./Rakefile Mon, 05 Nov 2012 09:29:11 +0000
3
- ./lib/hashthattree.rb Mon, 05 Nov 2012 10:29:05 +0000
4
- ./lib/version.rb Mon, 05 Nov 2012 09:29:11 +0000
3
+ ./lib/hashthattree.rb Mon, 05 Nov 2012 11:40:27 +0000
4
+ ./lib/version.rb Mon, 05 Nov 2012 11:43:30 +0000
5
5
  ./LICENSE.txt Mon, 05 Nov 2012 09:29:11 +0000
6
6
  ./Gemfile Mon, 05 Nov 2012 09:29:11 +0000
@@ -24,7 +24,7 @@
24
24
  <div id="metadata">
25
25
  <dl>
26
26
  <dt class="modified-date">Last Modified</dt>
27
- <dd class="modified-date">2012-11-05 10:29:05 +0000</dd>
27
+ <dd class="modified-date">2012-11-05 11:40:27 +0000</dd>
28
28
 
29
29
 
30
30
  <dt class="requires">Requires</dt>
@@ -24,7 +24,7 @@
24
24
  <div id="metadata">
25
25
  <dl>
26
26
  <dt class="modified-date">Last Modified</dt>
27
- <dd class="modified-date">2012-11-05 09:29:11 +0000</dd>
27
+ <dd class="modified-date">2012-11-05 11:43:30 +0000</dd>
28
28
 
29
29
 
30
30
  <dt class="requires">Requires</dt>
data/lib/hashthattree.rb CHANGED
@@ -1,17 +1,12 @@
1
1
  require 'digest/md5'
2
2
 
3
- # The program takes an initial word or phrase from
4
- # the command line (or in the absence of a
5
- # parameter from the first line of standard
6
- # input). In then reads successive words or
7
- # phrases from standard input and reports whether
8
- # they are angrams of the first word.
9
-
10
- #
11
3
  # Author:: John Ryan (mailto:555john@gmail.com)
12
4
  # Copyright:: Copyright (c) 2012 John Ryan
13
5
  # License:: Distributes under the same terms as Ruby
14
6
 
7
+ # The program takes two directories and creates a MD5 hash for every file contained within.
8
+ # It then builds a result set that compares files with the same name and allows for them to be outputted
9
+ # as a csv string
15
10
  module HashThatTree
16
11
 
17
12
  # This class accepts two folders and provides methods to iterate
@@ -66,10 +61,10 @@ module HashThatTree
66
61
  end
67
62
  end
68
63
 
69
- #Dumps the contents of the FileHashResults object to standard out
64
+ #Dumps the contents of the FileHashResults object in csv form to standard out
70
65
  def display_results
71
- puts "FileName Hash1 Hash2"
72
- @filehash.each{ |key, value| puts "#{value.file_name} is #{value.file_hash1} #{value.file_hash2}" }
66
+ puts "FileName,#{@folder1},#{@folder2},Are Equal"
67
+ @filehash.each{ |key, value| puts "#{value.file_name},#{value.file_hash1},#{value.file_hash2}, #{value.file_hash1==value.file_hash2}" }
73
68
  end
74
69
 
75
70
  end
data/lib/version.rb CHANGED
@@ -1,3 +1,4 @@
1
1
  module HashThatTree
2
- VERSION = "0.0.2"
2
+ #File containing the current version of the gem
3
+ VERSION = "0.0.3"
3
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hash-that-tree
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: