toys 0.15.6 → 0.16.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.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +6 -1
  3. data/README.md +2 -2
  4. data/builtins/system/tools.rb +1 -1
  5. data/lib/toys/templates/clean.rb +1 -1
  6. data/lib/toys/templates/gem_build.rb +1 -1
  7. data/lib/toys/templates/rubocop.rb +4 -1
  8. data/lib/toys/version.rb +1 -1
  9. metadata +8 -63
  10. data/core-docs/toys/acceptor.rb +0 -474
  11. data/core-docs/toys/arg_parser.rb +0 -397
  12. data/core-docs/toys/cli.rb +0 -466
  13. data/core-docs/toys/compat.rb +0 -2
  14. data/core-docs/toys/completion.rb +0 -340
  15. data/core-docs/toys/context.rb +0 -386
  16. data/core-docs/toys/core.rb +0 -14
  17. data/core-docs/toys/dsl/base.rb +0 -56
  18. data/core-docs/toys/dsl/flag.rb +0 -284
  19. data/core-docs/toys/dsl/flag_group.rb +0 -267
  20. data/core-docs/toys/dsl/internal.rb +0 -4
  21. data/core-docs/toys/dsl/positional_arg.rb +0 -155
  22. data/core-docs/toys/dsl/tool.rb +0 -1639
  23. data/core-docs/toys/errors.rb +0 -126
  24. data/core-docs/toys/flag.rb +0 -560
  25. data/core-docs/toys/flag_group.rb +0 -186
  26. data/core-docs/toys/input_file.rb +0 -17
  27. data/core-docs/toys/loader.rb +0 -363
  28. data/core-docs/toys/middleware.rb +0 -336
  29. data/core-docs/toys/mixin.rb +0 -142
  30. data/core-docs/toys/module_lookup.rb +0 -75
  31. data/core-docs/toys/positional_arg.rb +0 -145
  32. data/core-docs/toys/settings.rb +0 -524
  33. data/core-docs/toys/source_info.rb +0 -271
  34. data/core-docs/toys/standard_middleware/add_verbosity_flags.rb +0 -49
  35. data/core-docs/toys/standard_middleware/apply_config.rb +0 -24
  36. data/core-docs/toys/standard_middleware/handle_usage_errors.rb +0 -33
  37. data/core-docs/toys/standard_middleware/set_default_descriptions.rb +0 -222
  38. data/core-docs/toys/standard_middleware/show_help.rb +0 -190
  39. data/core-docs/toys/standard_middleware/show_root_version.rb +0 -45
  40. data/core-docs/toys/standard_mixins/bundler.rb +0 -98
  41. data/core-docs/toys/standard_mixins/exec.rb +0 -711
  42. data/core-docs/toys/standard_mixins/fileutils.rb +0 -18
  43. data/core-docs/toys/standard_mixins/gems.rb +0 -62
  44. data/core-docs/toys/standard_mixins/git_cache.rb +0 -41
  45. data/core-docs/toys/standard_mixins/highline.rb +0 -133
  46. data/core-docs/toys/standard_mixins/pager.rb +0 -50
  47. data/core-docs/toys/standard_mixins/terminal.rb +0 -135
  48. data/core-docs/toys/standard_mixins/xdg.rb +0 -49
  49. data/core-docs/toys/template.rb +0 -112
  50. data/core-docs/toys/tool_definition.rb +0 -1079
  51. data/core-docs/toys/utils/completion_engine.rb +0 -49
  52. data/core-docs/toys/utils/exec.rb +0 -776
  53. data/core-docs/toys/utils/gems.rb +0 -185
  54. data/core-docs/toys/utils/git_cache.rb +0 -353
  55. data/core-docs/toys/utils/help_text.rb +0 -134
  56. data/core-docs/toys/utils/pager.rb +0 -118
  57. data/core-docs/toys/utils/standard_ui.rb +0 -184
  58. data/core-docs/toys/utils/terminal.rb +0 -310
  59. data/core-docs/toys/utils/xdg.rb +0 -253
  60. data/core-docs/toys/wrappable_string.rb +0 -132
  61. data/core-docs/toys-core.rb +0 -111
@@ -1,336 +0,0 @@
1
- module Toys
2
- ##
3
- # **_Defined in the toys-core gem_**
4
- #
5
- # A middleware is an object that has the opportunity to alter the
6
- # configuration and runtime behavior of each tool in a Toys CLI. A CLI
7
- # contains an ordered list of middleware, known as the *middleware stack*,
8
- # that together define the CLI's default behavior.
9
- #
10
- # Specifically, a middleware can perform two functions.
11
- #
12
- # First, it can modify the configuration of a tool. After tools are defined
13
- # from configuration, the middleware stack can make modifications to each
14
- # tool. A middleware can add flags and arguments to the tool, modify the
15
- # description, or make any other changes to how the tool is set up.
16
- #
17
- # Second, a middleware can intercept and change tool execution. Like a Rack
18
- # middleware, a Toys middleware can wrap execution with its own code,
19
- # replace it outright, or leave it unmodified.
20
- #
21
- # Generally, a middleware is a class that implements one or more of the
22
- # methods defined in this module: {Toys::Middleware#config}, and
23
- # {Toys::Middleware#run}. This module provides default implementations that
24
- # do nothing, but it is not required to include this module, or even to
25
- # define both methods. Middleware objects need respond only to methods they
26
- # care about.
27
- #
28
- module Middleware
29
- ##
30
- # This method is called *after* a tool has been defined, and gives this
31
- # middleware the opportunity to modify the tool definition. It is passed
32
- # the tool definition object and the loader, and can make any changes to
33
- # the tool definition. In most cases, this method should also call
34
- # `yield`, which passes control to the next middleware in the stack. A
35
- # middleware can disable modifications done by subsequent middleware by
36
- # omitting the `yield` call, but this is uncommon.
37
- #
38
- # This basic implementation does nothing and simply yields to the next
39
- # middleware.
40
- #
41
- # @param tool [Toys::ToolDefinition] The tool definition to modify.
42
- # @param loader [Toys::Loader] The loader that loaded this tool.
43
- # @return [void]
44
- #
45
- def config(tool, loader)
46
- # Source available in the toys-core gem
47
- end
48
-
49
- ##
50
- # This method is called when the tool is run. It gives the middleware an
51
- # opportunity to modify the runtime behavior of the tool. It is passed
52
- # the tool instance (i.e. the object that hosts a tool's `run` method),
53
- # and you can use this object to access the tool's options and other
54
- # context data. In most cases, this method should also call `yield`,
55
- # which passes control to the next middleware in the stack. A middleware
56
- # can "wrap" normal execution by calling `yield` somewhere in its
57
- # implementation of this method, or it can completely replace the
58
- # execution behavior by not calling `yield` at all.
59
- #
60
- # Like a tool's `run` method, this method's return value is unused. If
61
- # you want to output from a tool, write to stdout or stderr. If you want
62
- # to set the exit status code, call {Toys::Context#exit} on the context.
63
- #
64
- # This basic implementation does nothing and simply yields to the next
65
- # middleware.
66
- #
67
- # @param context [Toys::Context] The tool execution context.
68
- # @return [void]
69
- #
70
- def run(context)
71
- # Source available in the toys-core gem
72
- end
73
-
74
- class << self
75
- ##
76
- # Create a middleware spec.
77
- #
78
- # @overload spec(name, *args, **kwargs, &block)
79
- # Create a spec indicating a given middleware name should be
80
- # instantiated with the given arguments.
81
- #
82
- # @param name [String,Symbol,Class] The middleware name or class
83
- # @param args [Array] The arguments to pass to the constructor
84
- # @param kwargs [Hash] The keyword arguments to pass to the constructor
85
- # @param block [Proc,nil] The block to pass to the constructor
86
- # @return [Toys::Middleware::Spec] A spec
87
- #
88
- # @overload spec(array)
89
- # Create a middleware spec from an array specification.
90
- #
91
- # The array must be 1-4 elements long. The first element must be the
92
- # middleware name or class. The other three arguments may include any
93
- # or all of the following optional elements, in any order:
94
- # * An array for the positional arguments to pass to the constructor
95
- # * A hash for the keyword arguments to pass to the constructor
96
- # * A proc for the block to pass to the constructor
97
- #
98
- # @param array [Array] The array input
99
- # @return [Toys::Middleware::Spec] A spec
100
- #
101
- # @overload spec(middleware_object)
102
- # Create a spec wrapping an existing middleware object
103
- #
104
- # @param middleware_object [Toys::Middleware] The middleware object
105
- # @return [Toys::Middleware::Spec] A spec
106
- #
107
- def spec(middleware, *args, **kwargs, &block)
108
- # Source available in the toys-core gem
109
- end
110
-
111
- ##
112
- # Create a {Toys::Middleware::Stack} from an array of middleware specs.
113
- # Each element may be one of the following:
114
- #
115
- # * A {Toys::Middleware} object
116
- # * A {Toys::Middleware::Spec}
117
- # * An array whose first element is a middleware name or class, and the
118
- # subsequent elements are params that define what to pass to the class
119
- # constructor (see {Toys::Middleware.spec})
120
- #
121
- # @param input [Array<Toys::Middleware,Toys::Middleware::Spec,Array>]
122
- # @return [Toys::Middleware::Stack]
123
- #
124
- def stack(input)
125
- # Source available in the toys-core gem
126
- end
127
-
128
- ##
129
- # Create a spec from an array specification.
130
- #
131
- # @private This interface is internal and subject to change without warning.
132
- #
133
- def spec_from_array(array)
134
- # Source available in the toys-core gem
135
- end
136
- end
137
-
138
- ##
139
- # **_Defined in the toys-core gem_**
140
- #
141
- # A base class that provides default no-op implementation of the middleware
142
- # interface. This base class may optionally be subclassed by a middleware
143
- # implementation.
144
- #
145
- class Base
146
- include Middleware
147
- end
148
-
149
- ##
150
- # **_Defined in the toys-core gem_**
151
- #
152
- # A middleware specification, including the middleware class and the
153
- # arguments to pass to the constructor.
154
- #
155
- # Use {Toys::Middleware.spec} to create a middleware spec.
156
- #
157
- class Spec
158
- ##
159
- # Builds a middleware for this spec, given a ModuleLookup for middleware.
160
- #
161
- # If this spec wraps an existing middleware object, returns that object.
162
- # Otherwise, constructs a middleware object from the spec.
163
- #
164
- # @param lookup [Toys::ModuleLookup] A module lookup to resolve
165
- # middleware names
166
- # @return [Toys::Middleware] The middleware
167
- #
168
- def build(lookup)
169
- # Source available in the toys-core gem
170
- end
171
-
172
- ##
173
- # @return [Toys::Middleware] if this spec wraps a middleware object
174
- # @return [nil] if this spec represents a class to instantiate
175
- #
176
- attr_reader :object
177
-
178
- ##
179
- # @return [String,Symbol] if this spec represents a middleware name
180
- # @return [Class] if this spec represents a middleware class
181
- # @return [nil] if this spec wraps a middleware object
182
- #
183
- attr_reader :name
184
-
185
- ##
186
- # @return [Array] the positional arguments to be passed to a middleware
187
- # class constructor, or the empty array if there are no positional
188
- # arguments
189
- # @return [nil] if this spec wraps a middleware object
190
- #
191
- attr_reader :args
192
-
193
- ##
194
- # @return [Hash] the keyword arguments to be passed to a middleware class
195
- # constructor, or the empty hash if there are no keyword arguments
196
- # @return [nil] if this spec wraps a middleware object
197
- #
198
- attr_reader :kwargs
199
-
200
- ##
201
- # @return [Proc] if there is a block argument to be passed to a
202
- # middleware class constructor
203
- # @return [nil] if there is no block argument, or this spec wraps a
204
- # middleware object
205
- #
206
- attr_reader :block
207
-
208
- ##
209
- # Equality check
210
- #
211
- # @param other [Object]
212
- # @return [Boolean]
213
- #
214
- def ==(other)
215
- # Source available in the toys-core gem
216
- end
217
- alias eql? ==
218
-
219
- ##
220
- # Return the hash code
221
- #
222
- # @return [Integer]
223
- #
224
- def hash
225
- # Source available in the toys-core gem
226
- end
227
-
228
- ##
229
- # Internal constructor. Use {Toys::Middleware.spec} instead.
230
- #
231
- # @private This interface is internal and subject to change without warning.
232
- #
233
- def initialize(object, name, args, kwargs, block)
234
- # Source available in the toys-core gem
235
- end
236
- end
237
-
238
- ##
239
- # **_Defined in the toys-core gem_**
240
- #
241
- # A stack of middleware specs, which can be applied in order to a tool.
242
- #
243
- # A middleware stack is separated into three groups:
244
- #
245
- # * {#pre_specs}, which are applied first.
246
- # * {#default_specs}, which are applied next. The default specs are set
247
- # when the stack is created and are generally not modified.
248
- # * {#post_specs}, which are applied third.
249
- #
250
- # When adding middleware to a stack, you should normally add them to the
251
- # pre or post specs. By default, {Stack#add} appends to the pre specs,
252
- # inserting new middleware just before the defaults.
253
- #
254
- # Use {Toys::Middleware.stack} to create a middleware stack.
255
- #
256
- class Stack
257
- ##
258
- # The middleware specs that precede the default set.
259
- # @return [Array<Toys::Middleware:Spec>]
260
- #
261
- attr_reader :pre_specs
262
-
263
- ##
264
- # The default set of middleware specs.
265
- # @return [Array<Toys::Middleware:Spec>]
266
- #
267
- attr_reader :default_specs
268
-
269
- ##
270
- # The middleware specs that follow the default set.
271
- # @return [Array<Toys::Middleware:Spec>]
272
- #
273
- attr_reader :post_specs
274
-
275
- ##
276
- # Add a middleware spec to the stack, in the default location, which is
277
- # at the end of pre_specs). See {Toys::Middleware.spec} for a description
278
- # of the arguments you can pass.
279
- #
280
- # @overload add(name, *args, **kwargs, &block)
281
- # @overload add(array)
282
- # @overload add(middleware_object)
283
- #
284
- def add(middleware, *args, **kwargs, &block)
285
- # Source available in the toys-core gem
286
- end
287
-
288
- ##
289
- # Duplicate this stack.
290
- #
291
- # @return [Toys::Middleware::Stack]
292
- #
293
- def dup
294
- # Source available in the toys-core gem
295
- end
296
-
297
- ##
298
- # Build the middleware in this stack.
299
- #
300
- # @return [Array<Toys::Middleware>]
301
- #
302
- def build(middleware_lookup)
303
- # Source available in the toys-core gem
304
- end
305
-
306
- ##
307
- # Equality check
308
- #
309
- # @param other [Object]
310
- # @return [Boolean]
311
- #
312
- def ==(other)
313
- # Source available in the toys-core gem
314
- end
315
- alias eql? ==
316
-
317
- ##
318
- # Return the hash code
319
- #
320
- # @return [Integer]
321
- #
322
- def hash
323
- # Source available in the toys-core gem
324
- end
325
-
326
- ##
327
- # Internal constructor. Use {Toys::Middleware.stack} instead.
328
- #
329
- # @private This interface is internal and subject to change without warning.
330
- #
331
- def initialize(default_specs: nil, pre_specs: nil, post_specs: nil)
332
- # Source available in the toys-core gem
333
- end
334
- end
335
- end
336
- end
@@ -1,142 +0,0 @@
1
- module Toys
2
- ##
3
- # **_Defined in the toys-core gem_**
4
- #
5
- # A mixin definition. Mixin modules should include this module.
6
- #
7
- # A mixin is a collection of methods that are available to be called from a
8
- # tool implementation (i.e. its run method). The mixin is added to the tool
9
- # class, so it has access to the same methods that can be called by the tool,
10
- # such as {Toys::Context#get}.
11
- #
12
- # ### Usage
13
- #
14
- # To create a mixin, define a module, and include this module. Then define
15
- # the methods you want to be available.
16
- #
17
- # If you want to perform some initialization specific to the mixin, you can
18
- # provide an *initializer* block and/or an *inclusion* block. These can be
19
- # specified by calling the module methods defined in
20
- # {Toys::Mixin::ModuleMethods}.
21
- #
22
- # The initializer block is called when the tool context is instantiated
23
- # in preparation for execution. It has access to context methods such as
24
- # {Toys::Context#get}, and can perform setup for the tool execution itself,
25
- # such as initializing some persistent state and storing it in the tool using
26
- # {Toys::Context#set}. The initializer block is passed any extra arguments
27
- # that were provided to the `include` directive. Define the initializer by
28
- # calling {Toys::Mixin::ModuleMethods#on_initialize}.
29
- #
30
- # The inclusion block is called in the context of your tool class when your
31
- # mixin is included. It is also passed any extra arguments that were provided
32
- # to the `include` directive. It can be used to issue directives to define
33
- # tools or other objects in the DSL, or even enhance the DSL by defining DSL
34
- # methods specific to the mixin. Define the inclusion block by calling
35
- # {Toys::Mixin::ModuleMethods#on_include}.
36
- #
37
- # ### Example
38
- #
39
- # This is an example that implements a simple counter. Whenever the counter
40
- # is incremented, a log message is emitted. The tool can also retrieve the
41
- # final counter value.
42
- #
43
- # # Define a mixin by creating a module that includes Toys::Mixin
44
- # module MyCounterMixin
45
- # include Toys::Mixin
46
- #
47
- # # Initialize the counter. Notice that the initializer is evaluated
48
- # # in the context of the runtime context, so has access to the runtime
49
- # # context state.
50
- # on_initialize do |start = 0|
51
- # set(:counter_value, start)
52
- # end
53
- #
54
- # # Mixin methods are evaluated in the runtime context and so have
55
- # # access to the runtime context state, just as if you had defined
56
- # # them in your tool.
57
- # def counter_value
58
- # get(:counter_value)
59
- # end
60
- #
61
- # def increment
62
- # set(:counter_value, counter_value + 1)
63
- # logger.info("Incremented counter")
64
- # end
65
- # end
66
- #
67
- # Now we can use it from a tool:
68
- #
69
- # tool "count-up" do
70
- # # Pass 1 as an extra argument to the mixin initializer
71
- # include MyCounterMixin, 1
72
- #
73
- # def run
74
- # # Mixin methods can be called.
75
- # 5.times { increment }
76
- # puts "Final value is #{counter_value}"
77
- # end
78
- # end
79
- #
80
- module Mixin
81
- ##
82
- # Create a mixin module with the given block.
83
- #
84
- # @param block [Proc] Defines the mixin module.
85
- # @return [Class]
86
- #
87
- def self.create(&block)
88
- # Source available in the toys-core gem
89
- end
90
-
91
- ##
92
- # **_Defined in the toys-core gem_**
93
- #
94
- # Methods that will be added to a mixin module object.
95
- #
96
- module ModuleMethods
97
- ##
98
- # Set the initializer for this mixin. This block is evaluated in the
99
- # runtime context before execution, and is passed any arguments provided
100
- # to the `include` directive. It can perform any runtime initialization
101
- # needed by the mixin.
102
- #
103
- # @param block [Proc] Sets the initializer proc.
104
- # @return [self]
105
- #
106
- def on_initialize(&block)
107
- # Source available in the toys-core gem
108
- end
109
-
110
- ##
111
- # The initializer proc for this mixin. This proc is evaluated in the
112
- # runtime context before execution, and is passed any arguments provided
113
- # to the `include` directive. It can perform any runtime initialization
114
- # needed by the mixin.
115
- #
116
- # @return [Proc] The iniitiliazer for this mixin.
117
- #
118
- attr_accessor :initializer
119
-
120
- ##
121
- # Set an inclusion proc for this mixin. This block is evaluated in the
122
- # tool class immediately after the mixin is included, and is passed any
123
- # arguments provided to the `include` directive.
124
- #
125
- # @param block [Proc] Sets the inclusion proc.
126
- # @return [self]
127
- #
128
- def on_include(&block)
129
- # Source available in the toys-core gem
130
- end
131
-
132
- ##
133
- # The inclusion proc for this mixin. This block is evaluated in the tool
134
- # class immediately after the mixin is included, and is passed any
135
- # arguments provided to the `include` directive.
136
- #
137
- # @return [Proc] The inclusion procedure for this mixin.
138
- #
139
- attr_accessor :inclusion
140
- end
141
- end
142
- end
@@ -1,75 +0,0 @@
1
- module Toys
2
- ##
3
- # **_Defined in the toys-core gem_**
4
- #
5
- # A helper module that provides methods to do module lookups. This is
6
- # used to obtain named helpers, middleware, and templates from the
7
- # respective modules.
8
- #
9
- class ModuleLookup
10
- class << self
11
- ##
12
- # Convert the given string to a path element. Specifically, converts
13
- # to `lower_snake_case`.
14
- #
15
- # @param str [String,Symbol] String to convert.
16
- # @return [String] Converted string
17
- #
18
- def to_path_name(str)
19
- # Source available in the toys-core gem
20
- end
21
-
22
- ##
23
- # Convert the given string to a module name. Specifically, converts
24
- # to `UpperCamelCase`, and then to a symbol.
25
- #
26
- # @param str [String,Symbol] String to convert.
27
- # @return [Symbol] Converted name
28
- #
29
- def to_module_name(str)
30
- # Source available in the toys-core gem
31
- end
32
-
33
- ##
34
- # Given a require path, return the module expected to be defined.
35
- #
36
- # @param path [String] File path, delimited by forward slash
37
- # @return [Module] The module loaded from that path
38
- #
39
- def path_to_module(path)
40
- # Source available in the toys-core gem
41
- end
42
- end
43
-
44
- ##
45
- # Create an empty ModuleLookup
46
- #
47
- def initialize
48
- # Source available in the toys-core gem
49
- end
50
-
51
- ##
52
- # Add a lookup path for modules.
53
- #
54
- # @param path_base [String] The base require path
55
- # @param module_base [Module] The base module, or `nil` (the default) to
56
- # infer a default from the path base.
57
- # @param high_priority [Boolean] If true, add to the head of the lookup
58
- # path, otherwise add to the end.
59
- # @return [self]
60
- #
61
- def add_path(path_base, module_base: nil, high_priority: false)
62
- # Source available in the toys-core gem
63
- end
64
-
65
- ##
66
- # Obtain a named module. Returns `nil` if the name is not present.
67
- #
68
- # @param name [String,Symbol] The name of the module to return.
69
- # @return [Module] The specified module
70
- #
71
- def lookup(name)
72
- # Source available in the toys-core gem
73
- end
74
- end
75
- end
@@ -1,145 +0,0 @@
1
- module Toys
2
- ##
3
- # **_Defined in the toys-core gem_**
4
- #
5
- # Representation of a formal positional argument
6
- #
7
- class PositionalArg
8
- ##
9
- # Create a PositionalArg definition.
10
- #
11
- # @param key [String,Symbol] The key to use to retrieve the value from
12
- # the execution context.
13
- # @param type [Symbol] The type of arg. Valid values are `:required`,
14
- # `:optional`, and `:remaining`.
15
- # @param accept [Object] An acceptor that validates and/or converts the
16
- # value. See {Toys::Acceptor.create} for recognized formats. Optional.
17
- # If not specified, defaults to {Toys::Acceptor::DEFAULT}.
18
- # @param complete [Object] A specifier for shell tab completion. See
19
- # {Toys::Completion.create} for recognized formats.
20
- # @param display_name [String] A name to use for display (in help text and
21
- # error reports). Defaults to the key in upper case.
22
- # @param desc [String,Array<String>,Toys::WrappableString] Short
23
- # description for the flag. See {Toys::ToolDefintion#desc} for a
24
- # description of the allowed formats. Defaults to the empty string.
25
- # @param long_desc [Array<String,Array<String>,Toys::WrappableString>]
26
- # Long description for the flag. See {Toys::ToolDefintion#long_desc}
27
- # for a description of the allowed formats. (But note that this param
28
- # takes an Array of description lines, rather than a series of
29
- # arguments.) Defaults to the empty array.
30
- # @return [Toys::PositionalArg]
31
- #
32
- def self.create(key, type,
33
- accept: nil, default: nil, complete: nil, desc: nil,
34
- long_desc: nil, display_name: nil)
35
- # Source available in the toys-core gem
36
- end
37
-
38
- ##
39
- # The key for this arg.
40
- # @return [Symbol]
41
- #
42
- attr_reader :key
43
-
44
- ##
45
- # Type of this argument.
46
- # @return [:required,:optional,:remaining]
47
- #
48
- attr_reader :type
49
-
50
- ##
51
- # The effective acceptor.
52
- # @return [Toys::Acceptor::Base]
53
- #
54
- attr_accessor :acceptor
55
-
56
- ##
57
- # The default value, which may be `nil`.
58
- # @return [Object]
59
- #
60
- attr_reader :default
61
-
62
- ##
63
- # The proc that determines shell completions for the value.
64
- # @return [Proc,Toys::Completion::Base]
65
- #
66
- attr_reader :completion
67
-
68
- ##
69
- # The short description string.
70
- #
71
- # When reading, this is always returned as a {Toys::WrappableString}.
72
- #
73
- # When setting, the description may be provided as any of the following:
74
- # * A {Toys::WrappableString}.
75
- # * A normal String, which will be transformed into a
76
- # {Toys::WrappableString} using spaces as word delimiters.
77
- # * An Array of String, which will be transformed into a
78
- # {Toys::WrappableString} where each array element represents an
79
- # individual word for wrapping.
80
- #
81
- # @return [Toys::WrappableString]
82
- #
83
- attr_reader :desc
84
-
85
- ##
86
- # The long description strings.
87
- #
88
- # When reading, this is returned as an Array of {Toys::WrappableString}
89
- # representing the lines in the description.
90
- #
91
- # When setting, the description must be provided as an Array where *each
92
- # element* may be any of the following:
93
- # * A {Toys::WrappableString} representing one line.
94
- # * A normal String representing a line. This will be transformed into a
95
- # {Toys::WrappableString} using spaces as word delimiters.
96
- # * An Array of String representing a line. This will be transformed into
97
- # a {Toys::WrappableString} where each array element represents an
98
- # individual word for wrapping.
99
- #
100
- # @return [Array<Toys::WrappableString>]
101
- #
102
- attr_reader :long_desc
103
-
104
- ##
105
- # The displayable name.
106
- # @return [String]
107
- #
108
- attr_accessor :display_name
109
-
110
- ##
111
- # Set the short description string.
112
- #
113
- # See {#desc} for details.
114
- #
115
- # @param desc [Toys::WrappableString,String,Array<String>]
116
- #
117
- def desc=(desc)
118
- # Source available in the toys-core gem
119
- end
120
-
121
- ##
122
- # Set the long description strings.
123
- #
124
- # See {#long_desc} for details.
125
- #
126
- # @param long_desc [Array<Toys::WrappableString,String,Array<String>>]
127
- #
128
- def long_desc=(long_desc)
129
- # Source available in the toys-core gem
130
- end
131
-
132
- ##
133
- # Append long description strings.
134
- #
135
- # You must pass an array of lines in the long description. See {#long_desc}
136
- # for details on how each line may be represented.
137
- #
138
- # @param long_desc [Array<Toys::WrappableString,String,Array<String>>]
139
- # @return [self]
140
- #
141
- def append_long_desc(long_desc)
142
- # Source available in the toys-core gem
143
- end
144
- end
145
- end