cl 0.1.24 → 0.1.25
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/NOTES.md +1 -1
- data/README.md +8 -5
- data/lib/cl.rb +11 -1
- data/lib/cl/version.rb +1 -1
- metadata +16 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: fdd4074de1e4d5cd388b007470f2670288ceea192d9759e8a2f023970ae814eb
|
4
|
+
data.tar.gz: 9e65045265af54581182190eb281f594e6154d2db4bd54481af2e894405b6d02
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 71b0cb12a6a341e6dc92c11f0035550cea52978419bd4f9038f62e2590aa8782486f752742d22060a23a2d70aed0b08e12e8fa564d7d1898f7a8e6c707249f7a
|
7
|
+
data.tar.gz: e7c17550880c5fd107a3e1afb463e6057fbfb834481c87e58cef744b044f98feef6e501137835b6fd2f9893669bad0999b3fa5ced89ce794e11b6079b1d970f9
|
data/NOTES.md
CHANGED
@@ -8,6 +8,6 @@ x register runners, accept any object as a runner, too
|
|
8
8
|
x readme passing a block to opt
|
9
9
|
x complete readme (e.g. description, summary, examples)
|
10
10
|
x add toc
|
11
|
+
x add yard docs
|
11
12
|
|
12
|
-
- add yard docs
|
13
13
|
- refactor Help::Cmd and Table so that everything goes into one big table
|
data/README.md
CHANGED
@@ -1,14 +1,17 @@
|
|
1
1
|
# Cl [![Build Status](https://travis-ci.org/svenfuchs/cl.svg?branch=master)](https://travis-ci.org/svenfuchs/cl)
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
OptionParser based CLI support for rapid CLI development in an object-oriented
|
4
|
+
context.
|
5
5
|
|
6
|
-
|
7
|
-
|
6
|
+
This library wraps Ruby's OptionParser in order to make it easier to use it in
|
7
|
+
an object oriented context.
|
8
|
+
|
9
|
+
It uses OptionParser for parsing your options under the hood, so you get all
|
10
|
+
the goodness that this library provides.
|
8
11
|
|
9
12
|
But on top of that it also provides a rich DSL for defining, validating, and
|
10
13
|
normalizing options, as well as automatic and gorgeous help output (modeled
|
11
|
-
after
|
14
|
+
after `gem --help`).
|
12
15
|
|
13
16
|
Further documentation is available on [rubydoc.info](https://www.rubydoc.info/github/svenfuchs/cl)
|
14
17
|
|
data/lib/cl.rb
CHANGED
@@ -29,7 +29,7 @@ class Cl
|
|
29
29
|
#
|
30
30
|
# @param args [Array<String>] arguments (usually ARGV)
|
31
31
|
def run(args)
|
32
|
-
runner(args
|
32
|
+
runner(untaint(args)).run
|
33
33
|
rescue UnknownCmd => e
|
34
34
|
ctx.abort e
|
35
35
|
rescue Error => e
|
@@ -47,4 +47,14 @@ class Cl
|
|
47
47
|
def help(*args)
|
48
48
|
runner(['help', *args]).cmd.help
|
49
49
|
end
|
50
|
+
|
51
|
+
private
|
52
|
+
|
53
|
+
# Tainting is being used for identifying values on options that have
|
54
|
+
# been declared as secret. Ruby taints incoming arguments, so we want to
|
55
|
+
# untaint them here.
|
56
|
+
def untaint(args)
|
57
|
+
args.map(&:dup).each(&:untaint)
|
58
|
+
end
|
59
|
+
|
50
60
|
end
|
data/lib/cl/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.25
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sven Fuchs
|
@@ -24,7 +24,19 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 1.0.3
|
27
|
-
description:
|
27
|
+
description: |-
|
28
|
+
OptionParser based CLI support for rapid CLI development in an object-oriented
|
29
|
+
context.
|
30
|
+
|
31
|
+
This library wraps Ruby's OptionParser in order to make it easier to use it in
|
32
|
+
an object oriented context.
|
33
|
+
|
34
|
+
It uses OptionParser for parsing your options under the hood, so you get all
|
35
|
+
the goodness that this library provides.
|
36
|
+
|
37
|
+
But on top of that it also provides a rich DSL for defining, validating, and
|
38
|
+
normalizing options, as well as automatic and gorgeous help output (modeled
|
39
|
+
after `gem --help`).
|
28
40
|
email:
|
29
41
|
executables: []
|
30
42
|
extensions: []
|
@@ -112,9 +124,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
112
124
|
- !ruby/object:Gem::Version
|
113
125
|
version: '0'
|
114
126
|
requirements: []
|
115
|
-
|
116
|
-
rubygems_version: 2.6.13
|
127
|
+
rubygems_version: 3.0.3
|
117
128
|
signing_key:
|
118
129
|
specification_version: 4
|
119
|
-
summary: OptionParser based CLI support
|
130
|
+
summary: Object-oriented OptionParser based CLI support
|
120
131
|
test_files: []
|