simpleflags 1.0.2 → 1.0.3
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/simpleflags.rb → simpleflags.rb} +13 -3
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4e4dea41131197f9d4fb9097219d48059780b92879e6533afbd97a95847ba854
|
|
4
|
+
data.tar.gz: f5a507c04cb26c79cb458d94a0a2649d211214be9e194679a1ad3e0fbecefb6e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4b0dc1ad5e89c4a12572049d278462977ae61b4e3c8cf117a1089031f91e53bd9d698390a837024e8d5413732c16c0416318f30574e27811e5597bf6e1e0d025
|
|
7
|
+
data.tar.gz: c5ad4b47b3b6918b973b4349740e9439832e0eb6e6aafae78a4e5790e93718a037053165a613f6687ac1edf8f8d284a2e6528bda876a9243096a783e4f9f92f8
|
|
@@ -29,8 +29,14 @@ class SimpleFlags
|
|
|
29
29
|
@flagSets = flagSets
|
|
30
30
|
end
|
|
31
31
|
|
|
32
|
+
def empty?
|
|
33
|
+
return @flagSets.flatten.length < 1
|
|
34
|
+
end
|
|
35
|
+
|
|
32
36
|
def none
|
|
33
|
-
if
|
|
37
|
+
if empty?
|
|
38
|
+
return ""
|
|
39
|
+
elsif !@flagSets[0][0].start_with? "-"
|
|
34
40
|
return @flagSets[0].join " "
|
|
35
41
|
else
|
|
36
42
|
return ""
|
|
@@ -38,7 +44,9 @@ class SimpleFlags
|
|
|
38
44
|
end
|
|
39
45
|
|
|
40
46
|
def flag(flagName)
|
|
41
|
-
if
|
|
47
|
+
if empty?
|
|
48
|
+
return ""
|
|
49
|
+
elsif flagName == ""
|
|
42
50
|
if !@flagSets[0][0].start_with? "-"
|
|
43
51
|
return @flagSets[0].join " "
|
|
44
52
|
else
|
|
@@ -55,7 +63,9 @@ class SimpleFlags
|
|
|
55
63
|
end
|
|
56
64
|
|
|
57
65
|
def flag?(flagName)
|
|
58
|
-
if
|
|
66
|
+
if empty?
|
|
67
|
+
return false
|
|
68
|
+
elsif flagName == ""
|
|
59
69
|
return true
|
|
60
70
|
else
|
|
61
71
|
for flagSet in @flagSets
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: simpleflags
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Rick Shaw
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-01
|
|
11
|
+
date: 2018-02-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: A simple gem to parse flags in command line arguments
|
|
14
14
|
email: rick@maximumpcexperience.com
|
|
@@ -16,7 +16,7 @@ executables: []
|
|
|
16
16
|
extensions: []
|
|
17
17
|
extra_rdoc_files: []
|
|
18
18
|
files:
|
|
19
|
-
-
|
|
19
|
+
- simpleflags.rb
|
|
20
20
|
homepage: https://github.com/rsrickshaw/simpleflags
|
|
21
21
|
licenses: []
|
|
22
22
|
metadata: {}
|