nub 0.0.44 → 0.0.45
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/lib/nub/commander.rb +8 -0
- 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: 867a70047e9f70cfe52dcf96d22038a33b981f4d51596a9c770048f52ba7abbc
|
4
|
+
data.tar.gz: 0e61b494698663f1abfd4b518ae1014466d925d398e8afe96fae71c1b5e19a74
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 432d3f0a1169a974eeb9d1adbd784f56cf63b4c594d09b3687df2f0b2c2795351952e2c3def0e742aa4b464b52ce051e62332c25ca57d5d266171deb7e7824f0
|
7
|
+
data.tar.gz: 4340abc5d2100d98bf4e919500251ebfcff8dee1d2a592757e4bf2fdcb1a163baddd883d1282b028ab2cb06a769981cc3ed59324130ad4800316e9f3a690a729
|
data/lib/nub/commander.rb
CHANGED
@@ -121,6 +121,11 @@ class Commander
|
|
121
121
|
return @cmds[key] if @cmds[key]
|
122
122
|
end
|
123
123
|
|
124
|
+
# Test if the key exists
|
125
|
+
def key?(key)
|
126
|
+
return @cmds.key?(key)
|
127
|
+
end
|
128
|
+
|
124
129
|
# Add a command to the command list
|
125
130
|
# @param cmd [String] name of the command
|
126
131
|
# @param desc [String] description of the command
|
@@ -314,6 +319,9 @@ class Commander
|
|
314
319
|
end
|
315
320
|
}
|
316
321
|
|
322
|
+
# Ensure global is always set
|
323
|
+
@cmds[:global] = {} if !@cmds[:global]
|
324
|
+
|
317
325
|
# Ensure all options were consumed
|
318
326
|
Log.die("invalid options #{ARGV}") if ARGV.any?
|
319
327
|
|