ex_aequo_args 0.1.0 → 0.1.1
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/README.md +49 -1
- data/lib/ex_aequo/args/parser.rb +0 -2
- data/lib/ex_aequo/args/version.rb +1 -1
- data/lib/ex_aequo/args.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d8287836234ce84bc4334f25d1aa3463a674c45cfb222d7a93cdbc5c0b427109
|
|
4
|
+
data.tar.gz: 3d180da623eb7fa58e2bbc81e2c5a81d8fbf0842fd27c57999904d80117bd0f6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 701c1a082c2877b0c12ebc7964f703cdb71825c7f601de3cc7d3b5b94b7c1a8826d29a59bff2e734deee73af86c4df0e456ab9dd3c74c2c31dc33bffc66fd140
|
|
7
|
+
data.tar.gz: 3f02f088b4c05a0602d75e59d797587fd057abfe009485d886f4c69a652995cf1179130394f3b199ad72715003efaa6c9f4ae177c360943a36de9a215e8a2591
|
data/README.md
CHANGED
|
@@ -1,3 +1,51 @@
|
|
|
1
1
|
# rb_ex_aequo_args
|
|
2
2
|
|
|
3
|
-
args as I need them
|
|
3
|
+
args as I need them
|
|
4
|
+
|
|
5
|
+
## How it works:
|
|
6
|
+
|
|
7
|
+
### Install:
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
gem install ex_aequo_args
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### Context: Usage
|
|
14
|
+
|
|
15
|
+
Given we import the `Args` parser
|
|
16
|
+
```ruby
|
|
17
|
+
require 'ex_aequo/args/import'
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
And the parser
|
|
21
|
+
```ruby
|
|
22
|
+
let(:parser) { Args.new }
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
#### Context: Simple Usecase allow some kwds
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
Then we can parse arguments as a hash and an array
|
|
29
|
+
```ruby
|
|
30
|
+
parser.parse(%w[:help verbose: 3 hello world]) => {kwds:, positionals:}
|
|
31
|
+
|
|
32
|
+
expect(kwds).to eq(help: true, verbose: '3')
|
|
33
|
+
|
|
34
|
+
expect(positionals).to eq(%w[hello world])
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
#### Context: Kwds as OpenStruct
|
|
39
|
+
|
|
40
|
+
Then we can parse arguments as an OpenStruct and an array
|
|
41
|
+
```ruby
|
|
42
|
+
parser.parse(%w[:debug name: robert -- :help], :ostruct) => {kwds:, positionals:}
|
|
43
|
+
|
|
44
|
+
expect(kwds.debug).to eq(true)
|
|
45
|
+
expect(kwds.name).to eq('robert')
|
|
46
|
+
|
|
47
|
+
expect(positionals).to eq(%w[:help])
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
<!-- SPDX-License-Identifier: AGPL-3.0-or-later -->
|
data/lib/ex_aequo/args/parser.rb
CHANGED
data/lib/ex_aequo/args.rb
CHANGED
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ex_aequo_args
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Robert Dober
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: ex_aequo_base
|
|
@@ -15,14 +15,14 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - "~>"
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: 0.
|
|
18
|
+
version: 0.3.9
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - "~>"
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: 0.
|
|
25
|
+
version: 0.3.9
|
|
26
26
|
description: The arg parser I need
|
|
27
27
|
email: robert.dober@gmail.com
|
|
28
28
|
executables: []
|
|
@@ -46,14 +46,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
46
46
|
requirements:
|
|
47
47
|
- - ">="
|
|
48
48
|
- !ruby/object:Gem::Version
|
|
49
|
-
version: 3.4.
|
|
49
|
+
version: 3.4.5
|
|
50
50
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
51
51
|
requirements:
|
|
52
52
|
- - ">="
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
54
|
version: '0'
|
|
55
55
|
requirements: []
|
|
56
|
-
rubygems_version: 3.
|
|
56
|
+
rubygems_version: 3.7.2
|
|
57
57
|
specification_version: 4
|
|
58
58
|
summary: The arg parser I need
|
|
59
59
|
test_files: []
|