duplicated_filename_checker 0.0.5 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/dup-filename +13 -1
- data/lib/duplicated_filename_checker/version.rb +1 -1
- 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: 7ab8cff2f3e31f6071bd3a14773ba6ccc80b1de2
|
4
|
+
data.tar.gz: 329cc390c657a46b4d4a4795d1749c62e871f678
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3acbcc235243c4ba747a88323691fea36ddfcf308d99e175db7f11a36d1760208fa5d3abac0d6e11932d16934514d5f57c8c531fdc7a35a8ae54a903cd49ee46
|
7
|
+
data.tar.gz: 6d23f23982c269cbd602994489c38c0890fa5de9e1687991123c5bfb3d8d9a4160a478914831e751aedfb1264b835acacc95cf85a1291133a0345f7fb99230b5
|
data/bin/dup-filename
CHANGED
@@ -1,14 +1,26 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
require 'duplicated_filename_checker'
|
3
|
+
require 'optparse'
|
3
4
|
|
5
|
+
# check argument
|
4
6
|
unless ARGV.size > 0
|
5
7
|
raise ArgumentError.new('Specify the argument. Argument is survey target root paths.')
|
6
8
|
end
|
7
9
|
|
10
|
+
# survey
|
8
11
|
servey_root_paths = ARGV
|
9
12
|
duplicated_file_profiles = DuplicatedFilenameChecker::Check.new(*servey_root_paths).execute
|
10
13
|
|
14
|
+
# options
|
15
|
+
options = ARGV.getopts("i:")
|
16
|
+
ignore_keyword = options["i"]
|
17
|
+
|
18
|
+
# formatting
|
11
19
|
duplicated_file_profiles.each do |basename, file_profiles|
|
20
|
+
if ignore_keyword
|
21
|
+
next if basename =~ Regexp.new(ignore_keyword)
|
22
|
+
end
|
23
|
+
|
12
24
|
puts "## #{basename}"
|
13
25
|
|
14
26
|
file_profiles.each.with_index(1) do |file_profile, index|
|
@@ -19,4 +31,4 @@ duplicated_file_profiles.each do |basename, file_profiles|
|
|
19
31
|
end
|
20
32
|
|
21
33
|
puts "\n"
|
22
|
-
end
|
34
|
+
end
|