toys 0.9.0 → 0.9.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/.yardopts +1 -1
- data/CHANGELOG.md +5 -0
- data/docs/guide.md +23 -23
- data/lib/toys/version.rb +1 -1
- metadata +35 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9e402d9e7cee9139d8ccbdaecc8618b6fa080a880bda920c0e4964946504068
|
4
|
+
data.tar.gz: c0b00b019405ed8a07dc3fee0b3514ead52c78dd5eec403628fd4b91f78cd763
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f81c5d3fd8670acac4337ca33ea657e354a5e26bdff9bfa8b7d4ed10701f0ff6937a44135832755bdde496c1cd04164a873588ae5afdd3b3399b1cc97e01c9a
|
7
|
+
data.tar.gz: 716002617b54f7095d4ee4ec7e445f79e74f168642db1b9d99a702290cb59435e0fbdfe6f6d339e5b5d6e0ae285673de03f6cb2c82ed792035cc7a4e5c299af4
|
data/.yardopts
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# Release History
|
2
2
|
|
3
|
+
### 0.9.1 / 2019-12-22
|
4
|
+
|
5
|
+
* IMPROVED: `delegate_to` and `alias_tool` can take symbols as well as strings.
|
6
|
+
* DOCS: Fixed user guide internal links on rubydoc.info.
|
7
|
+
|
3
8
|
### 0.9.0 / 2019-12-02
|
4
9
|
|
5
10
|
* ADDED: The `delegate_to` directive causes the tool to delegate execution to another tool. This means it takes the same arguments and has the same execution behavior.
|
data/docs/guide.md
CHANGED
@@ -219,7 +219,7 @@ flag, but it has no additional effect.) Namespaces also support the following
|
|
219
219
|
additional flags:
|
220
220
|
|
221
221
|
* `--all` which displays all subtools, including
|
222
|
-
[hidden subtools](#
|
222
|
+
[hidden subtools](#Hidden_tools) and namespaces.
|
223
223
|
* `--no-recursive` which displays only immediate subtools, instead of the
|
224
224
|
default behavior of showing all subtools recursively.
|
225
225
|
* `--search=TERM` which displays only subtools whose name or description
|
@@ -265,7 +265,7 @@ you could do this:
|
|
265
265
|
$ toys do build --staging , test --help
|
266
266
|
|
267
267
|
Each tool can choose which behavior it will support, whether or not to enforce
|
268
|
-
[flags before positional args](#
|
268
|
+
[flags before positional args](#Enforcing_flags_before_args).
|
269
269
|
|
270
270
|
You can also, of course, stop recognizing flags on the command line by passing
|
271
271
|
`--` as an argument.
|
@@ -273,7 +273,7 @@ You can also, of course, stop recognizing flags on the command line by passing
|
|
273
273
|
### Tab completion
|
274
274
|
|
275
275
|
If you are using the Bash shell, Toys provides custom tab completion. See
|
276
|
-
[this section](#
|
276
|
+
[this section](#Installing_tab_completion_for_Bash) for instructions on
|
277
277
|
installing tab completion.
|
278
278
|
|
279
279
|
Toys will complete tool and subtool names, flags, values passed to flags, and
|
@@ -516,7 +516,7 @@ an example:
|
|
516
516
|
long_desc: ["Long descriptions may have multiple lines.",
|
517
517
|
"This is the second line."]
|
518
518
|
|
519
|
-
See the [above section on Descriptions](#
|
519
|
+
See the [above section on Descriptions](#Tool_descriptions) for more
|
520
520
|
information on how descriptions are rendered and word wrapped.
|
521
521
|
|
522
522
|
Because long descriptions may be unwieldly to write as a hash argument in this
|
@@ -561,7 +561,7 @@ and
|
|
561
561
|
[OptionParser::OctalInteger](http://ruby-doc.org/stdlib/libdoc/optparse/rdoc/OptionParser.html#OctalInteger).
|
562
562
|
|
563
563
|
You may also create **custom acceptors**. See the
|
564
|
-
[section below on Custom Acceptors](#
|
564
|
+
[section below on Custom Acceptors](#Custom_acceptors) for more information.
|
565
565
|
|
566
566
|
#### Argument completions
|
567
567
|
|
@@ -772,7 +772,7 @@ and
|
|
772
772
|
[OptionParser::OctalInteger](http://ruby-doc.org/stdlib/libdoc/optparse/rdoc/OptionParser.html#OctalInteger).
|
773
773
|
|
774
774
|
You may also create **custom acceptors**. See the
|
775
|
-
[section below on Custom Acceptors](#
|
775
|
+
[section below on Custom Acceptors](#Custom_acceptors) for more information.
|
776
776
|
|
777
777
|
#### Defaults and handlers
|
778
778
|
|
@@ -830,7 +830,7 @@ like this:
|
|
830
830
|
Note that both flags affect the same option name, `VERBOSITY`. The first
|
831
831
|
increments it each time it appears, and the second decrements it. A tool can
|
832
832
|
query this option and get an integer telling the requested verbosity level, as
|
833
|
-
you will see [below](#
|
833
|
+
you will see [below](#Logging_and_verbosity).
|
834
834
|
|
835
835
|
Toys provides a few built-in handlers that can be specified by name. We already
|
836
836
|
discussed the default handler that can be specified by its name `:set` or by
|
@@ -858,7 +858,7 @@ directive. The `desc:` argument takes a single string description, while the
|
|
858
858
|
long_desc: ["Long descriptions may have multiple lines.",
|
859
859
|
"This is the second line."]
|
860
860
|
|
861
|
-
See the [above section on Descriptions](#
|
861
|
+
See the [above section on Descriptions](#Tool_descriptions) for more information on
|
862
862
|
how descriptions are rendered and word wrapped.
|
863
863
|
|
864
864
|
Because long descriptions may be unwieldly to write as a hash argument in this
|
@@ -981,7 +981,7 @@ your tools.
|
|
981
981
|
|
982
982
|
Note: If you do not define the `run` method for a tool, Toys provides a default
|
983
983
|
implementation that displays the tool's help screen. This is typically used for
|
984
|
-
namespaces, as we shall see [below](#
|
984
|
+
namespaces, as we shall see [below](#Namespaces_and_subtools). Most tools,
|
985
985
|
however, should define `run`.
|
986
986
|
|
987
987
|
Let's revisit the "greet" example we covered earlier.
|
@@ -1149,7 +1149,7 @@ than two or three levels of hierarchy can be confusing to use.
|
|
1149
1149
|
## Understanding Toys files
|
1150
1150
|
|
1151
1151
|
Toys commands are defined in Toys files. We covered the basic syntax for these
|
1152
|
-
files in the [above section on defining tools](#
|
1152
|
+
files in the [above section on defining tools](#Defining_tools). In this
|
1153
1153
|
section, we will take a deeper look at what you can do with Toys files.
|
1154
1154
|
|
1155
1155
|
### Toys directories
|
@@ -1254,7 +1254,7 @@ in the separate file `.toys/test/unit.rb`.
|
|
1254
1254
|
Toys also loads index files first before other files in the directory. This
|
1255
1255
|
means they are convenient places to define shared code that can be used by all
|
1256
1256
|
the subtools defined in that directory, as we shall see later in the
|
1257
|
-
[section on sharing code](#
|
1257
|
+
[section on sharing code](#Sharing_code).
|
1258
1258
|
|
1259
1259
|
### The Toys search path
|
1260
1260
|
|
@@ -1366,7 +1366,7 @@ or the
|
|
1366
1366
|
[Toys::Context#verbosity method](https://dazuma.github.io/toys/gems/toys-core/latest/Toys/Context#verbosity-instance_method).
|
1367
1367
|
The verbosity is set to 0 by default. This corresponds to a logger level of
|
1368
1368
|
`WARN`. That is, warnings, errors, and fatals are displayed, while infos and
|
1369
|
-
debugs are not. However, [as we saw earlier](#
|
1369
|
+
debugs are not. However, [as we saw earlier](#Standard_flags), most tools
|
1370
1370
|
automatically respond to the `--verbose` and `--quiet` flags, (or `-v` and
|
1371
1371
|
`-q`), which increment and decrement the verbosity value, respectively. If you
|
1372
1372
|
run a tool with `-v`, the verbosity is incremented to 1, and the logger level
|
@@ -1395,7 +1395,7 @@ execute, and return a process status code (i.e. 0 for success, and nonzero for
|
|
1395
1395
|
error). Make sure you handle the exit status. For example, in most cases, you
|
1396
1396
|
should probably exit if the tool you are calling returns a nonzero code.
|
1397
1397
|
|
1398
|
-
You may also use the `exec` mixin [described below](#
|
1398
|
+
You may also use the `exec` mixin [described below](#Executing_subprocesses) to
|
1399
1399
|
run a tool in a separate process. This is particularly useful if you need to
|
1400
1400
|
capture or manipulate that tool's input or output stream.
|
1401
1401
|
|
@@ -1403,7 +1403,7 @@ capture or manipulate that tool's input or output stream.
|
|
1403
1403
|
|
1404
1404
|
The methods of [Toys::Context](https://dazuma.github.io/toys/gems/toys-core/latest/Toys/Context)
|
1405
1405
|
are not the only methods available for your tool to call. We
|
1406
|
-
[saw earlier](#
|
1406
|
+
[saw earlier](#Tool_execution_basics) that a tool can define additional methods
|
1407
1407
|
that you can use as helpers.
|
1408
1408
|
|
1409
1409
|
You can also include **mixins**, which are modules that bring in a whole set of
|
@@ -1428,7 +1428,7 @@ We will look at a few examples of the use of these mixins below. Built-in
|
|
1428
1428
|
mixins have names that are symbols.
|
1429
1429
|
|
1430
1430
|
You can also define your own mixins, as we will see in the
|
1431
|
-
[upcoming section on defining mixins](#
|
1431
|
+
[upcoming section on defining mixins](#Defining_mixins).
|
1432
1432
|
|
1433
1433
|
### Executing subprocesses
|
1434
1434
|
|
@@ -1486,7 +1486,7 @@ more information, see the
|
|
1486
1486
|
|
1487
1487
|
You may also use other third-party gems such as
|
1488
1488
|
[tty](https://github.com/piotrmurach/tty). The section below on
|
1489
|
-
[useful gems](#
|
1489
|
+
[useful gems](#Useful_gems) provides some examples.
|
1490
1490
|
|
1491
1491
|
## Sharing code
|
1492
1492
|
|
@@ -1499,7 +1499,7 @@ classes, and constants, that you might define in your tools.
|
|
1499
1499
|
|
1500
1500
|
### Defining mixins
|
1501
1501
|
|
1502
|
-
We [saw earlier](#
|
1502
|
+
We [saw earlier](#Helper_methods_and_mixins) that you can mix a module (with
|
1503
1503
|
all its methods) into your tool using the `include` directive. You can specify
|
1504
1504
|
a module itself, or the name of a built-in mixin such as `:exec` or
|
1505
1505
|
`:terminal`. But you can also define your own mixin using the `mixin`
|
@@ -1514,7 +1514,7 @@ includes the mixin, in the same way that you can include a Ruby module.
|
|
1514
1514
|
|
1515
1515
|
(Note that, unlike full modules, mixins allow only methods to be shared. Mixins
|
1516
1516
|
do not support constants. See the next section on
|
1517
|
-
[using constants](#
|
1517
|
+
[using constants](#Using_constants) to learn how Toys handles constants.)
|
1518
1518
|
|
1519
1519
|
Here's an example. Suppose you had common setup code that you wanted to share
|
1520
1520
|
among your testing tools.
|
@@ -1553,7 +1553,7 @@ descendant tools defined in that same directory, but not in a different `.toys`
|
|
1553
1553
|
directory.
|
1554
1554
|
|
1555
1555
|
A common technique, for example, would be to define a mixin in the
|
1556
|
-
[index file](#
|
1556
|
+
[index file](#Index_files) in a Toys directory. You can then include it from
|
1557
1557
|
any subtools defined in other files in that same directory.
|
1558
1558
|
|
1559
1559
|
#### Mixin initializers
|
@@ -1733,7 +1733,7 @@ development, including templates that generate build, test, and documentation
|
|
1733
1733
|
tools. The `:minitest` template illustrated above is one of these built-in
|
1734
1734
|
templates. Like built-in mixins, built-in template names are always symbols.
|
1735
1735
|
You can read more about them in the next section on using
|
1736
|
-
[Toys as a Rake replacement](#
|
1736
|
+
[Toys as a Rake replacement](#Toys_as_a_Rake_replacement).
|
1737
1737
|
|
1738
1738
|
You may also write your own templates. Here's how...
|
1739
1739
|
|
@@ -1852,7 +1852,7 @@ tools are defined. You can use such files to define Ruby classes, modules, and
|
|
1852
1852
|
other code that may be used and shared by your tools.
|
1853
1853
|
|
1854
1854
|
To use preloaded files, you must define your tools inside a
|
1855
|
-
[Toys directory](#
|
1855
|
+
[Toys directory](#Toys_directories). Before any tools inside a directory are
|
1856
1856
|
loaded, any file named `.preload.rb` in the directory is automatically
|
1857
1857
|
required. Additionally, any Ruby files inside a subdirectory called `.preload`
|
1858
1858
|
are also automatically required.
|
@@ -2701,7 +2701,7 @@ provides a convenient place to put data files that can be looked up by tools
|
|
2701
2701
|
either during definition or runtime.
|
2702
2702
|
|
2703
2703
|
To use data files, you must define your tools inside a
|
2704
|
-
[Toys directory](#
|
2704
|
+
[Toys directory](#Toys_directories). Within the Toys directory, create a
|
2705
2705
|
directory named `.data` and copy your data files there.
|
2706
2706
|
|
2707
2707
|
You may then "find" a data file by providing the relative path to the file from
|
@@ -2858,7 +2858,7 @@ the entire toys directory structure. So if your tool definition is inside a
|
|
2858
2858
|
|
2859
2859
|
This behavior is particularly useful for build tools. Indeed, all the build
|
2860
2860
|
tools described in the section on
|
2861
|
-
[Toys as a Rake Replacement](#
|
2861
|
+
[Toys as a Rake Replacement](#Toys_as_a_Rake_replacement) automatically move
|
2862
2862
|
into the context directory when they execute.
|
2863
2863
|
|
2864
2864
|
#### Changing the context directory
|
data/lib/toys/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: toys
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Azuma
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-12-
|
11
|
+
date: 2019-12-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: toys-core
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.9.
|
19
|
+
version: 0.9.1
|
20
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.9.
|
26
|
+
version: 0.9.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: highline
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -38,20 +38,6 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '2.0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: kramdown
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '2.1'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '2.1'
|
55
41
|
- !ruby/object:Gem::Dependency
|
56
42
|
name: minitest
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -108,6 +94,34 @@ dependencies:
|
|
108
94
|
- - "~>"
|
109
95
|
- !ruby/object:Gem::Version
|
110
96
|
version: '13.0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rdoc
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '6.2'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '6.2'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: redcarpet
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '3.5'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '3.5'
|
111
125
|
- !ruby/object:Gem::Dependency
|
112
126
|
name: rspec
|
113
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -128,14 +142,14 @@ dependencies:
|
|
128
142
|
requirements:
|
129
143
|
- - "~>"
|
130
144
|
- !ruby/object:Gem::Version
|
131
|
-
version: 0.
|
145
|
+
version: 0.78.0
|
132
146
|
type: :development
|
133
147
|
prerelease: false
|
134
148
|
version_requirements: !ruby/object:Gem::Requirement
|
135
149
|
requirements:
|
136
150
|
- - "~>"
|
137
151
|
- !ruby/object:Gem::Version
|
138
|
-
version: 0.
|
152
|
+
version: 0.78.0
|
139
153
|
- !ruby/object:Gem::Dependency
|
140
154
|
name: yard
|
141
155
|
requirement: !ruby/object:Gem::Requirement
|
@@ -192,7 +206,7 @@ metadata:
|
|
192
206
|
changelog_uri: https://github.com/dazuma/toys/blob/master/toys/CHANGELOG.md
|
193
207
|
source_code_uri: https://github.com/dazuma/toys
|
194
208
|
bug_tracker_uri: https://github.com/dazuma/toys/issues
|
195
|
-
documentation_uri: https://dazuma.github.io/toys/gems/toys
|
209
|
+
documentation_uri: https://dazuma.github.io/toys/gems/toys/v0.9.1
|
196
210
|
post_install_message:
|
197
211
|
rdoc_options: []
|
198
212
|
require_paths:
|