lab42_rgxargs 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lab42/rgxargs/checker.rb +2 -2
- data/lib/lab42/rgxargs/predefined_matchers.rb +1 -0
- data/lib/lab42/rgxargs/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: b9f2ee6bdaddb5db512e1cf55c65f42699b2441ac0878760f44c8083ff12f023
|
4
|
+
data.tar.gz: 8e4175e4906cc5b5a3511f413b96f27f63cf7eaeaec7c07fe5e851ee2faa6e08
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33a12fa2ce1f98386d28bdd1c99a18fc982545fb26030c5a6dd618f5ce75e2276dfc06f91a4c9bbe6bb6867550be9a9a2aa95ca18d67244f4c3861409d4d58fe
|
7
|
+
data.tar.gz: 022b992b251e8027bb19e1a91810abc066fac549b4d74ff77d43ecfa3c8ceae7bd41311b3161d7f7546ba187673307385c522f272a677aa0e81c54250c4ca0af
|
@@ -15,7 +15,7 @@ module Lab42
|
|
15
15
|
missing = required - options.to_h.keys
|
16
16
|
@errors += missing.map(&_mk_pair(:required_kwd_missing))
|
17
17
|
end
|
18
|
-
|
18
|
+
|
19
19
|
|
20
20
|
def _mk_pair(prefix)
|
21
21
|
-> element do
|
@@ -24,7 +24,7 @@ module Lab42
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def _check_switch(_)
|
27
|
-
|
27
|
+
|
28
28
|
end
|
29
29
|
|
30
30
|
|
@@ -1,5 +1,6 @@
|
|
1
1
|
module Lab42::Rgxargs::PredefinedMatchers extend self
|
2
2
|
PREDEFINED = {
|
3
|
+
existing_dirs: [%r{(.+)}, ->(glob){ Dir.glob(glob).filter{ File.directory?(_1) } }],
|
3
4
|
int: [%r{\A([-+]?\d+)\z}, :to_i.to_proc],
|
4
5
|
int_list: [%r{\A(-?\d+(?:,-?\d+)*)\z}, ->(*groups){ groups.first.split(",").map(&:to_i)}],
|
5
6
|
int_range: [%r{\A(-?\d+)(?:-|\.\.)(-?\d+)\z}, ->(f, l){ Range.new(f.to_i, l.to_i) }],
|