hash-that-tree 0.0.4 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Gemfile.lock CHANGED
@@ -1,13 +1,16 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- hash-that-tree (0.0.1)
4
+ hash-that-tree (0.0.6)
5
+ thor
5
6
 
6
7
  GEM
7
8
  remote: https://rubygems.org/
8
9
  specs:
10
+ thor (0.16.0)
9
11
 
10
12
  PLATFORMS
13
+ ruby
11
14
  x86-mingw32
12
15
 
13
16
  DEPENDENCIES
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  #hash-that-tree
2
- a ruby app that compares the MD5 hashes of the files in two different folders
2
+ A ruby command line app that compares the MD5 hashes of the files in different folders
3
3
 
4
- Looking into bundling with https://github.com/radar/guides/blob/master/gem-development.md
4
+ It allows the user to enter folder locations, then iterats through the files, creating and comparing the MD5 hashes of the files with the same name
5
5
 
6
6
  ## Installation
7
7
 
@@ -19,11 +19,12 @@ Or install it yourself as:
19
19
 
20
20
  ## Usage
21
21
  e.g
22
- hashthattree.rb c:/testfiles/folder1 c:/testfiles/folder2
23
-
24
- to test the app
25
- ruby lib/hashthattree.rb spec/testfiles/1 spec/testfiles/2
22
+
23
+ hashthattree help
24
+
25
+ hashthattree CompareMD5 spec/testfiles/1 spec/testfiles/2
26
26
 
27
+
27
28
  ## Creating Documentation
28
29
  Run the following command to generate the documantation
29
30
 
@@ -31,9 +32,15 @@ Or install it yourself as:
31
32
 
32
33
  ## Create a gem
33
34
 
34
- gem update --system
35
- gem build hash-that-tree.gemspec
36
- gem push hash-that-tree-0.0.1.gem
35
+ Build and Test Locally
36
+ -gem build hash-that-tree.gemspec
37
+ -gem install hash-that-tree-X.X.X # where X.X.X is the version of the compiled gemspec
38
+ -hashthattree
39
+
40
+ Build and deploy to rubygems.org
41
+ -gem update --system
42
+ -gem build hash-that-tree.gemspec
43
+ -gem push hash-that-tree-0.0.1.gem # where X.X.X is the version of the compiled gemspec
37
44
 
38
45
  ## Contributing
39
46
 
@@ -43,10 +50,17 @@ Or install it yourself as:
43
50
  4. Push to the branch (`git push origin my-new-feature`)
44
51
  5. Create new Pull Request
45
52
 
53
+ ##References
54
+
55
+ Looking into bundling with https://github.com/radar/guides/blob/master/gem-development.md
56
+ http://whatisthor.com/
57
+
46
58
  ## TODO
47
- I have a few items to do in upcoming releases
48
- * Add a Command Line Interface
49
- * Allow multiple folders to be specified
50
- * Add folder recursion option
51
- * Add SHA1
59
+
60
+ I have a few items to do in upcoming releases
61
+ * Add Unit Tests
62
+ * Allow to be used as an API as well as a Command Line Tool
63
+ * Allow multiple folders to be specified
64
+ * Add folder recursion option
65
+ * Add SHA1
52
66
 
data/bin/hashthattree ADDED
@@ -0,0 +1,21 @@
1
+ require 'thor'
2
+ require_relative '../lib/compare'
3
+
4
+ # Command Line Program that takes two directories and creates a MD5 hash for every file contained within.
5
+ # It then builds a result set that compares files with the same name and allows for them to be outputted
6
+ # as a csv string
7
+ module HashThatTree
8
+ class CLI < Thor
9
+ option :recurse
10
+
11
+ desc "compare FOLDER1 FOLDER2", "Create a hash of all files in the folders, compare them and output the results in CSV format"
12
+ def compare(folder1, folder2)
13
+ htt = CompareMD5.new(folder1, folder2)
14
+ htt.compare
15
+ htt.display_results
16
+ end
17
+ end
18
+
19
+ CLI.start(ARGV)
20
+
21
+ end
@@ -1,19 +1,19 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  lib = File.expand_path('../lib', __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'version'
5
4
 
6
5
  Gem::Specification.new do |gem|
7
6
  gem.name = "hash-that-tree"
8
- gem.version = HashThatTree::VERSION
7
+ gem.version = "0.0.6"
9
8
  gem.authors = ["John Ryan"]
10
9
  gem.email = ["555john@gmail.com"]
11
- gem.description = "Compares the MD5 hashes of the files in two different folders"
12
- gem.summary = "Allows the user to enter two folder locations and the gem will iterate through the files, creating and comparing the MD5 hashes of the files with the same name"
10
+ gem.description = "Command line app that compares the MD5 hashes of the files in different folders"
11
+ gem.summary = "Allows the user to enter folder locations iterating through the files, creating and comparing the MD5 hashes of the files with the same name"
13
12
  gem.homepage = "http://github.com/jnyryan/hash-that-tree"
14
-
13
+ gem.has_rdoc = true
15
14
  gem.files = `git ls-files`.split($/)
16
15
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
16
+ gem.executable = 'hashthattree'
17
17
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
18
  gem.require_paths = ["lib"]
19
19
 
data/lib/compare.rb CHANGED
@@ -4,16 +4,13 @@ require 'digest/md5'
4
4
  # Copyright:: Copyright (c) 2012 John Ryan
5
5
  # License:: Distributes under the same terms as Ruby
6
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
10
7
  module HashThatTree
11
8
 
12
9
  # This class accepts two folders and provides methods to iterate
13
10
  # through them creating a hash of each file within and can display
14
11
  # the results for analysis
15
12
 
16
- class MD5Compare
13
+ class CompareMD5
17
14
  attr_accessor :folder1, :folder2
18
15
 
19
16
  #initialize the class with the folders to be compared
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.4
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-06 00:00:00.000000000 Z
12
+ date: 2012-11-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor
@@ -27,10 +27,12 @@ dependencies:
27
27
  - - ! '>='
28
28
  - !ruby/object:Gem::Version
29
29
  version: '0'
30
- description: Compares the MD5 hashes of the files in two different folders
30
+ description: Command line app that compares the MD5 hashes of the files in different
31
+ folders
31
32
  email:
32
33
  - 555john@gmail.com
33
- executables: []
34
+ executables:
35
+ - hashthattree
34
36
  extensions: []
35
37
  extra_rdoc_files: []
36
38
  files:
@@ -40,9 +42,9 @@ files:
40
42
  - LICENSE.txt
41
43
  - README.md
42
44
  - Rakefile
45
+ - bin/hashthattree
43
46
  - hash-that-tree.gemspec
44
47
  - lib/compare.rb
45
- - lib/version.rb
46
48
  - spec/doc/created.rid
47
49
  - spec/doc/images/brick.png
48
50
  - spec/doc/images/brick_link.png
@@ -113,8 +115,8 @@ rubyforge_project:
113
115
  rubygems_version: 1.8.24
114
116
  signing_key:
115
117
  specification_version: 3
116
- summary: Allows the user to enter two folder locations and the gem will iterate through
117
- the files, creating and comparing the MD5 hashes of the files with the same name
118
+ summary: Allows the user to enter folder locations iterating through the files, creating
119
+ and comparing the MD5 hashes of the files with the same name
118
120
  test_files:
119
121
  - spec/doc/created.rid
120
122
  - spec/doc/images/brick.png
data/lib/version.rb DELETED
@@ -1,4 +0,0 @@
1
- module HashThatTree
2
- #File containing the current version of the gem
3
- VERSION = "0.0.4"
4
- end