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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fa12272618cb7bd23bf218ce2405f99119f1686352b7ddfc622e5697caa22dbf
4
- data.tar.gz: 5f6c5ebf2b1ff5bdfa3d701b493359aff5fdea521f221b78d0f5f3e3838060a9
3
+ metadata.gz: fad5aa10d2f59f1463750eaf26714fa89c84c57bc1af8834467fcc5af041ae7c
4
+ data.tar.gz: 01f8276d9423596b87a88c6f9af13904bfc8df9b3c11ce7bcc4fef2121ca7bba
5
5
  SHA512:
6
- metadata.gz: bb9e676b416e06afdb02c10740026afd313f41aaf17ce60824054309327915e00dd4883901d311bb96ff15d376793fdf27a9cc6be7a1c2ee6d8074a75ff302bc
7
- data.tar.gz: 1a40c994e1b1943c070f6b2969c1b4b59ab832e17e79908cd7218210bbf12e916c1521ea5758aa0e7330515606dd4745a18941771f8bd9e3d57d775b941791a2
6
+ metadata.gz: c4d6c8d6d3324e96bbeafff6c232dbd21e28036ef49ab92b0c3d91f41d967c8fbf844c24bff30d2427bfe03709d73482fcdf0b4b2bea3d8bf582135be9e82f87
7
+ data.tar.gz: 6a0b083147b1f5c62ef82dc6b5769ba2fc1f5e744d6b1866ea1f002332fb5a0e47f28c11fab6f6ba53e89534e91f7e76db9ce6db380f9492076e1ae965f79af5
@@ -1,5 +1,7 @@
1
+ require 'l42/map'
2
+
1
3
  module Lab42
2
4
  class Rgxargs
3
- VERSION = "0.2.4"
5
+ VERSION = "0.3.1"
4
6
  end
5
7
  end
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, :open_struct, :options, :posix, :required, :syntaxes
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(open_struct: true, posix: false, &blk)
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
- @open_struct = open_struct
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 open_struct
224
- [::OpenStruct.new(options), args, errors]
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.2.4
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: speculate_about
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.2
20
- type: :development
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.2
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
@@ -1,9 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'ostruct'
4
- class OpenStruct
5
- def deconstruct_keys(_keys)
6
- to_h
7
- end
8
- end
9
- # SPDX-License-Identifier: Apache-2.0