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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2a702495c905bd44346916ee09d8e24c7abb0615
4
- data.tar.gz: c49ed7dbf3a1659cb5231af315dc3d367e8b6893
3
+ metadata.gz: e7d8f17b9b9d6562d66797c2b3f986c95eeb055a
4
+ data.tar.gz: 2bd3e09bf4652a242928bb5299a050b1caff028b
5
5
  SHA512:
6
- metadata.gz: b423ef8e3882fa8367e6cd1690e965938c3e8c68cd580adc4b9de7560e3efee212d537518b085c3722249cbe5013759eb6d8a233142a7e367ee8a15d6f62b84b
7
- data.tar.gz: 578eec4739ae1f619cca5d3acfceda0601179c0295f5b05c812f5540126e4148cfab18e9c782719c31d105c13063003dc33c47cbd66c8196895ada65c189ca09
6
+ metadata.gz: 5962c5ee7b6389bd20b828b06a08e23bb8ce10c44ff65100f98a93656894af96c8e9e1faf07495c94a27fd64969c403f382b934c1961619da4ccc2944c8b4178
7
+ data.tar.gz: 273a1a2fe8586e6727c81710019d2bc958bc22d3e915f40f744800d5addfc1eade2f8f6024d6c17868e3b569aeff77393fb0f8106918f6806e381acb9ae3bf77
data/.gitignore CHANGED
@@ -1,2 +1,3 @@
1
1
  /coverage/
2
- /Gemfile.lock
2
+ /Gemfile.lock
3
+ /pkg/
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
- /Users/shinya131/survey_dir2_root/subdirectory/dupfilename1.png
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
- /Users/shinya131/survey_dir1_root/dupfilename2.png
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"
@@ -16,4 +16,8 @@ class DuplicatedFilenameChecker::FileProfile
16
16
  def md5_digest
17
17
  Digest::MD5.file(path).to_s
18
18
  end
19
+
20
+ def stat
21
+ File.stat path
22
+ end
19
23
  end
@@ -1,3 +1,3 @@
1
1
  module DuplicatedFilenameChecker
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -21,4 +21,8 @@ class TestFileProfile < MiniTest::Unit::TestCase
21
21
  def test_md5_digest
22
22
  assert @file_profile.md5_digest == @sample_md5_digest
23
23
  end
24
+
25
+ def test_stat
26
+ assert @file_profile.stat.class == File::Stat
27
+ end
24
28
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: duplicated_filename_checker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shinya131