check_names 0.4.0 → 0.5.0
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.
- checksums.yaml +4 -4
- data/exe/check_names +23 -18
- data/lib/check_names/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6bab692e352dc013e789d94d727cdc70520b1bf58a6ec2547dc770f94956e086
|
4
|
+
data.tar.gz: 8f753e604b1ceca688e5205ef9b4c55e17bbead39f3b2c3484038ae38fcd9b30
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6eba30abc087cbf322224c1d689df2b3ed234252b3ac7e239b66046f20c45c62d9736961c6ba257ab054e49fc74c6c1ac7581de3aef23075ba8bc6bd2f89d5d
|
7
|
+
data.tar.gz: 51318e1543af9c775d589a6b5bdb401eb8383a3e74b8a4413a6d2ba073fe093403de878adde1627ce86e4ac415024279573bfb625f888d9ce2e36fdc2bf2869f
|
data/exe/check_names
CHANGED
@@ -11,16 +11,19 @@
|
|
11
11
|
# 4. Does an alias with this name already exist?
|
12
12
|
# 5. Does a function with this name already exist?
|
13
13
|
|
14
|
+
require 'optimist'
|
14
15
|
require_relative '../lib/check_names/version'
|
15
16
|
require_relative '../lib/check_names'
|
16
17
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
18
|
+
BANNER = <<-BANNER_TEXT
|
19
|
+
#{File.basename(__FILE__)}:
|
20
|
+
ersion #{CheckNames.version}
|
21
|
+
|
22
|
+
Check whether a proposed gem name already exists
|
21
23
|
|
22
24
|
Usage:
|
23
|
-
|
25
|
+
#{File.basename(__FILE__)} OPTIONS NAME...
|
26
|
+
|
24
27
|
|
25
28
|
check_names looks to see whether the names provided are already in use.
|
26
29
|
It outputs the usage (if any) of each name on $STDOUT. It exits with a
|
@@ -36,26 +39,28 @@ check_names checks for each of the following uses:
|
|
36
39
|
- The name of a shell function
|
37
40
|
- The name of an executable (reachable via \$PATH)
|
38
41
|
|
39
|
-
The following options are
|
42
|
+
The following options are allowed:
|
43
|
+
BANNER_TEXT
|
40
44
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
45
|
+
def main
|
46
|
+
opts = Optimist.options do
|
47
|
+
version CheckNames.version
|
48
|
+
banner BANNER
|
49
|
+
opt :all, "Check for all possible uses. (Default is to stop at the first one found.)", default: false
|
50
|
+
educate_on_error
|
51
|
+
end
|
46
52
|
|
47
|
-
|
53
|
+
all = opts[:all]
|
54
|
+
args = ARGV
|
48
55
|
args = args.map { |arg| arg.downcase }
|
49
|
-
|
50
|
-
args.
|
51
|
-
|
52
|
-
show_help
|
56
|
+
|
57
|
+
if args.size == 0
|
58
|
+
Optimist.educate
|
53
59
|
exit
|
54
60
|
end
|
55
61
|
|
56
62
|
rc = 0
|
57
63
|
args.each.with_index(0) do |arg, i|
|
58
|
-
results = []
|
59
64
|
print "#{arg}: "
|
60
65
|
checks_printed_count = 0
|
61
66
|
(1...(CheckNames.check_methods.size)).each do |check|
|
@@ -77,5 +82,5 @@ def main(args)
|
|
77
82
|
end
|
78
83
|
|
79
84
|
if __FILE__ == $0
|
80
|
-
main
|
85
|
+
main
|
81
86
|
end
|
data/lib/check_names/version.rb
CHANGED