benry-cmdopt 1.0.0 → 2.0.0
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/CHANGES.md +34 -1
- data/MIT-LICENSE +21 -0
- data/README.md +570 -62
- data/Rakefile.rb +6 -87
- data/benry-cmdopt.gemspec +23 -21
- data/doc/benry-cmdopt.html +650 -0
- data/doc/css/style.css +160 -0
- data/lib/benry/cmdopt.rb +568 -417
- data/task/common-task.rb +138 -0
- data/task/package-task.rb +72 -0
- data/task/readme-task.rb +125 -0
- data/task/test-task.rb +81 -0
- data/test/cmdopt_test.rb +1372 -681
- metadata +22 -28
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb91a08288099f5e011818d0dc0790f4a0ce39885417a248365bc1d34342f51b
|
4
|
+
data.tar.gz: 16ac9a7a312d7fac7ee082b20e18f16dfd0303f685028db29290bebd6e95fdf5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd5db670a903764317a3cc0a4a35f96b8c80b3bcc9e422c5d48da7d53a12847017c1175aef861af6abaaa43791e27824557f341d7b4038197fc8bdbfd7285bba
|
7
|
+
data.tar.gz: bf0c0b66d9c5972662c8bd45db7956fd1cb9a8b8562c3bb1e76fa3ff0421ab42feb8195c76fd04eeb110dd63f06cd787e394090d338b1571be6d9570f3852e28
|
data/CHANGES.md
CHANGED
@@ -1,8 +1,41 @@
|
|
1
|
-
=======
|
2
1
|
CHANGES
|
3
2
|
=======
|
4
3
|
|
5
4
|
|
5
|
+
Release 2.0.0 (2023-10-10)
|
6
|
+
--------------------------
|
7
|
+
|
8
|
+
* [change] rename `Benry::Cmdopt` to `Benry::CmdOpt`, and the old name is still available for backward compatibility.
|
9
|
+
* [change] `Parser#parse()` parses all options even after arguments.
|
10
|
+
* [change] treat argument `-` as normal argument (in before release, `-` is ignored because treated as option).
|
11
|
+
* [change] keyword parameter `pattern:` is renamed to `rexp:` (`pattern:` is also available for backward compatibilidy).
|
12
|
+
* [change] `SchemaItem#help` is renamed to `SchemaItem#desc` (old name `#help` is also available for backward compatibility).
|
13
|
+
* [change] `add(..., type: Integer, enum: ['1','2'])` now raises error because enum contains non-Integer value.
|
14
|
+
* [change] freeze enum value of `enum:` keyword arg of `Facade#add()` and `Schema#add()`.
|
15
|
+
* [enhance] `Parser#parse(argv, false)` parses options only before arguments.
|
16
|
+
* [enhance] define `#to_s()` which is alias of `#option_help()`.
|
17
|
+
* [enhance] `Facade#add()` and `Schema#add()` supports `range:` keyword arg which validates option value.
|
18
|
+
* [enhance] `Facade#add()` and `Schema#add()` supports `value:` keyword arg for additional value.
|
19
|
+
* [enhance] `Facade#add()` and `Schema#add()` supports `detail:` keyword arg for detailed description.
|
20
|
+
* [enhance] `Facade#add()` and `Schema#add()` supports `tag:` keyword arg which accepts arbitrary value.
|
21
|
+
* [enhance] regard options which key name starts with '_' as hidden, as well as options which description is nil.
|
22
|
+
* [enhance] add `Schema#get()` which finds option item by key name.
|
23
|
+
* [enhance] add `Schema#delete()` which deletes option item by key name.
|
24
|
+
* [enhance] add `Schema#each()` which yields option items.
|
25
|
+
* [enhance] add `Schema#empty?(all: true)` which returns true if schema has no option items.
|
26
|
+
* [enhance] add `Schema#dup()` which duplicates each object.
|
27
|
+
* [enhance] add `Schema#copy_from(other)` which copies option items from other schema.
|
28
|
+
* [change] switch testing library from MiniTest to Oktest.
|
29
|
+
* [change] capitalize the first letter of error messages.
|
30
|
+
|
31
|
+
|
32
|
+
Release 1.1.0 (2021-01-18)
|
33
|
+
--------------------------
|
34
|
+
|
35
|
+
* [change] rename `build_option_help()` to `option_help()`.
|
36
|
+
* [change] shorten option help width when no long options defined.
|
37
|
+
|
38
|
+
|
6
39
|
Release 1.0.0 (2021-01-17)
|
7
40
|
--------------------------
|
8
41
|
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2021-2023 kuwata-lab.com
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|