cl 0.1.24 → 0.1.25

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.
Files changed (6) hide show
  1. checksums.yaml +5 -5
  2. data/NOTES.md +1 -1
  3. data/README.md +8 -5
  4. data/lib/cl.rb +11 -1
  5. data/lib/cl/version.rb +1 -1
  6. metadata +16 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 72952e2db91c199b725e62742a795797062e4ce6
4
- data.tar.gz: 44492b50481c1622bc45436f611ae1a4211169a6
2
+ SHA256:
3
+ metadata.gz: fdd4074de1e4d5cd388b007470f2670288ceea192d9759e8a2f023970ae814eb
4
+ data.tar.gz: 9e65045265af54581182190eb281f594e6154d2db4bd54481af2e894405b6d02
5
5
  SHA512:
6
- metadata.gz: 7b4a5998249ae7521747203fc2e7b3f21f66bcbef86568d025113b4e808faa84f4f7f7b2aa7401eb9ca1e190f25977bf0c5a5856a5b128181e551584a021e665
7
- data.tar.gz: 11d40ccbca05ab8dc596dca41d7610992a09745809fb19fdb1ba3c17828a1bf49a0bf1f4e935e5776b6d5a541980b4fe482f82b228d9afd08c760f3bc76be16e
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
- This library wraps Ruby's `OptionParser` in order to make it easier to use it
4
- in an object oriented context.
3
+ OptionParser based CLI support for rapid CLI development in an object-oriented
4
+ context.
5
5
 
6
- It uses `OptionParser` for parsing your options, so you get all the goodness that
7
- this gem from Ruby's stoneage provides.
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 Rubygem's `gem --help` output).
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.map(&:dup)).run
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
@@ -1,3 +1,3 @@
1
1
  class Cl
2
- VERSION = '0.1.24'
2
+ VERSION = '0.1.25'
3
3
  end
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.24
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: OptionParser based CLI support.
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
- rubyforge_project:
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: []