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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: deb9dbe25bc11a6ab39530dd90584bf05a1ac674
4
- data.tar.gz: 60bea77f1ba2cfde3a2eefa576ed2abb0de62497
3
+ metadata.gz: 7ab8cff2f3e31f6071bd3a14773ba6ccc80b1de2
4
+ data.tar.gz: 329cc390c657a46b4d4a4795d1749c62e871f678
5
5
  SHA512:
6
- metadata.gz: 6a593e0e577f268484e53c9a9674ae073615a0b18c0a091e61e93ab43875d4901c5e6179ef0c9fb117b3c642911ffefe525f6ce459e7accdb6d202a8c6c142dd
7
- data.tar.gz: 4eeb59869fa107824cff3c58668885960224e6b34692dc1845e1ef0e4752cab799f546ee915635587c967bf48925bf8288652cd49249d1120e6519db4073f448
6
+ metadata.gz: 3acbcc235243c4ba747a88323691fea36ddfcf308d99e175db7f11a36d1760208fa5d3abac0d6e11932d16934514d5f57c8c531fdc7a35a8ae54a903cd49ee46
7
+ data.tar.gz: 6d23f23982c269cbd602994489c38c0890fa5de9e1687991123c5bfb3d8d9a4160a478914831e751aedfb1264b835acacc95cf85a1291133a0345f7fb99230b5
@@ -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
@@ -1,3 +1,3 @@
1
1
  module DuplicatedFilenameChecker
2
- VERSION = "0.0.5"
2
+ VERSION = "0.1.0"
3
3
  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.5
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shinya131