lab42_rgxargs 0.2.4 → 0.3.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/version.rb +3 -1
- data/lib/lab42/rgxargs.rb +5 -6
- metadata +5 -48
- data/lib/lab42/monkey/open_struct.rb +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fad5aa10d2f59f1463750eaf26714fa89c84c57bc1af8834467fcc5af041ae7c
|
4
|
+
data.tar.gz: 01f8276d9423596b87a88c6f9af13904bfc8df9b3c11ce7bcc4fef2121ca7bba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4d6c8d6d3324e96bbeafff6c232dbd21e28036ef49ab92b0c3d91f41d967c8fbf844c24bff30d2427bfe03709d73482fcdf0b4b2bea3d8bf582135be9e82f87
|
7
|
+
data.tar.gz: 6a0b083147b1f5c62ef82dc6b5769ba2fc1f5e744d6b1866ea1f002332fb5a0e47f28c11fab6f6ba53e89534e91f7e76db9ce6db380f9492076e1ae965f79af5
|
data/lib/lab42/rgxargs.rb
CHANGED
@@ -2,7 +2,6 @@ require 'forwardable'
|
|
2
2
|
require 'lab42/enumerable'
|
3
3
|
require 'set'
|
4
4
|
|
5
|
-
require_relative 'monkey/open_struct'
|
6
5
|
module Lab42
|
7
6
|
|
8
7
|
class Rgxargs
|
@@ -19,7 +18,7 @@ module Lab42
|
|
19
18
|
extend Forwardable
|
20
19
|
def_delegators Predefined, :list_matcher
|
21
20
|
|
22
|
-
attr_reader :allowed, :args, :conversions, :defaults, :defined_rules, :errors, :
|
21
|
+
attr_reader :allowed, :args, :conversions, :defaults, :defined_rules, :errors, :l42_map, :options, :posix, :required, :syntaxes
|
23
22
|
|
24
23
|
def predefined_matchers
|
25
24
|
Predefined.defined_names
|
@@ -70,7 +69,7 @@ module Lab42
|
|
70
69
|
|
71
70
|
private
|
72
71
|
|
73
|
-
def initialize(
|
72
|
+
def initialize(l42_map: true, posix: false, &blk)
|
74
73
|
@args = []
|
75
74
|
@allowed = nil
|
76
75
|
@conversions = {}
|
@@ -78,7 +77,7 @@ module Lab42
|
|
78
77
|
@defined_rules = []
|
79
78
|
@errors = []
|
80
79
|
@posix = posix
|
81
|
-
@
|
80
|
+
@l42_map = l42_map
|
82
81
|
@required = ::Set.new
|
83
82
|
@syntaxes = []
|
84
83
|
|
@@ -220,8 +219,8 @@ module Lab42
|
|
220
219
|
end
|
221
220
|
|
222
221
|
def _return_values
|
223
|
-
if
|
224
|
-
[::
|
222
|
+
if l42_map
|
223
|
+
[L42::Map.new(**options).with_default(nil), args, errors]
|
225
224
|
else
|
226
225
|
[options, args, errors]
|
227
226
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lab42_rgxargs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Dober
|
@@ -11,61 +11,19 @@ cert_chain: []
|
|
11
11
|
date: 2020-01-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: l42_map
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.1.
|
20
|
-
type: :
|
19
|
+
version: 0.1.1
|
20
|
+
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.1.
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: rspec
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '3.9'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '3.9'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: pry-byebug
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '3.7'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '3.7'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: pry-doc
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '1.0'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - "~>"
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '1.0'
|
26
|
+
version: 0.1.1
|
69
27
|
description: Parse CL args according to regexen
|
70
28
|
email: robert.dober@gmail.com
|
71
29
|
executables: []
|
@@ -73,7 +31,6 @@ extensions: []
|
|
73
31
|
extra_rdoc_files: []
|
74
32
|
files:
|
75
33
|
- lib/lab42/enumerable.rb
|
76
|
-
- lib/lab42/monkey/open_struct.rb
|
77
34
|
- lib/lab42/rgxargs.rb
|
78
35
|
- lib/lab42/rgxargs/argument_matcher.rb
|
79
36
|
- lib/lab42/rgxargs/checker.rb
|