duplicated_filename_checker 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -1
- data/README.md +16 -4
- data/bin/dup-filename +8 -4
- data/lib/duplicated_filename_checker/file_profile.rb +4 -0
- data/lib/duplicated_filename_checker/version.rb +1 -1
- data/test/test_file_profile.rb +4 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e7d8f17b9b9d6562d66797c2b3f986c95eeb055a
|
4
|
+
data.tar.gz: 2bd3e09bf4652a242928bb5299a050b1caff028b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5962c5ee7b6389bd20b828b06a08e23bb8ce10c44ff65100f98a93656894af96c8e9e1faf07495c94a27fd64969c403f382b934c1961619da4ccc2944c8b4178
|
7
|
+
data.tar.gz: 273a1a2fe8586e6727c81710019d2bc958bc22d3e915f40f744800d5addfc1eade2f8f6024d6c17868e3b569aeff77393fb0f8106918f6806e381acb9ae3bf77
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
[![Gem Version](https://badge.fury.io/rb/duplicated_filename_checker.svg)](http://badge.fury.io/rb/duplicated_filename_checker)
|
1
2
|
[![Build Status](https://travis-ci.org/Shinya131/duplicated_filename_checker.svg?branch=master)](https://travis-ci.org/Shinya131/duplicated_filename_checker)
|
2
3
|
[![Coverage Status](https://coveralls.io/repos/Shinya131/duplicated_filename_checker/badge.svg?branch=master)](https://coveralls.io/r/Shinya131/duplicated_filename_checker?branch=master)
|
3
4
|
[![Code Climate](https://codeclimate.com/github/Shinya131/duplicated_filename_checker/badges/gpa.svg)](https://codeclimate.com/github/Shinya131/duplicated_filename_checker)
|
@@ -18,12 +19,23 @@ install:
|
|
18
19
|
$ dup-filename ./survey_dir1_root ./survey_dir2_root
|
19
20
|
|
20
21
|
## dupfilename1.png
|
21
|
-
/Users/shinya131/survey_dir1_root/dupfilename1.png
|
22
|
-
|
22
|
+
1. /Users/shinya131/survey_dir1_root/dupfilename1.png
|
23
|
+
* md5: 5b915134b95109c68e7515f4737c5e6d
|
24
|
+
* mtime: 2015-03-03 15:14:35 +0900
|
25
|
+
|
26
|
+
2. /Users/shinya131/survey_dir2_root/subdirectory/dupfilename1.png
|
27
|
+
* md5: 5b915134b95109c68e7515f4737c5e6d
|
28
|
+
* mtime: 2015-03-03 15:14:35 +0900
|
23
29
|
|
24
30
|
## dupfilename2.png
|
25
|
-
/Users/shinya131/survey_dir1_root/dupfilename2.png
|
26
|
-
|
31
|
+
1. /Users/shinya131/survey_dir1_root/dupfilename2.png
|
32
|
+
* md5: 5f524466f49b96221fe7c5a6ddf5d881
|
33
|
+
* mtime: 2014-10-16 20:19:07 +0900
|
34
|
+
|
35
|
+
2. /Users/shinya131/survey_dir1_root/dupfilename2.png
|
36
|
+
* md5: 5ca13f9af7db4c8e80ac153fd4c0a552
|
37
|
+
* mtime: 2015-03-03 15:14:35 +0900
|
38
|
+
|
27
39
|
```
|
28
40
|
|
29
41
|
## Usage `duplicated_filename_checker` as library
|
data/bin/dup-filename
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'duplicated_filename_checker'
|
2
|
+
class DuplicatedFilenameChecker; end
|
3
|
+
require '../lib/duplicated_filename_checker/check.rb'
|
4
|
+
require '../lib/duplicated_filename_checker/file_profile.rb'
|
4
5
|
|
5
6
|
unless ARGV.size > 0
|
6
7
|
raise ArgumentError.new('Specify the argument. Argument is survey target root paths.')
|
@@ -12,8 +13,11 @@ duplicated_file_profiles = DuplicatedFilenameChecker::Check.new(*servey_root_pat
|
|
12
13
|
duplicated_file_profiles.each do |basename, file_profiles|
|
13
14
|
puts "## #{basename}"
|
14
15
|
|
15
|
-
file_profiles.each do |file_profile|
|
16
|
-
puts "#{file_profile.path}"
|
16
|
+
file_profiles.each.with_index(1) do |file_profile, index|
|
17
|
+
puts "#{index}. #{file_profile.path}"
|
18
|
+
puts " * md5: #{file_profile.md5_digest}"
|
19
|
+
puts " * mtime: #{file_profile.stat.mtime}"
|
20
|
+
puts "\n"
|
17
21
|
end
|
18
22
|
|
19
23
|
puts "\n"
|
data/test/test_file_profile.rb
CHANGED