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,155 +0,0 @@
1
- module Toys
2
- module DSL
3
- ##
4
- # **_Defined in the toys-core gem_**
5
- #
6
- # DSL for an arg definition block. Lets you set arg attributes in a block
7
- # instead of a long series of keyword arguments.
8
- #
9
- # These directives are available inside a block passed to
10
- # {Toys::DSL::Tool#required_arg}, {Toys::DSL::Tool#optional_arg}, or
11
- # {Toys::DSL::Tool#remaining_args}.
12
- #
13
- # ### Example
14
- #
15
- # tool "mytool" do
16
- # optional_arg :value do
17
- # # The directives in here are defined by this class
18
- # accept Integer
19
- # desc "An integer value"
20
- # end
21
- # # ...
22
- # end
23
- #
24
- class PositionalArg
25
- ##
26
- # Set the acceptor for this argument's values.
27
- # You can pass either the string name of an acceptor defined in this tool
28
- # or any of its ancestors, or any other specification recognized by
29
- # {Toys::Acceptor.create}.
30
- #
31
- # @param spec [Object]
32
- # @param options [Hash]
33
- # @param block [Proc]
34
- # @return [self]
35
- #
36
- def accept(spec = nil, **options, &block)
37
- # Source available in the toys-core gem
38
- end
39
-
40
- ##
41
- # Set the default value.
42
- #
43
- # @param default [Object]
44
- # @return [self]
45
- #
46
- def default(default)
47
- # Source available in the toys-core gem
48
- end
49
-
50
- ##
51
- # Set the shell completion strategy for arg values.
52
- # You can pass either the string name of a completion defined in this
53
- # tool or any of its ancestors, or any other specification recognized by
54
- # {Toys::Completion.create}.
55
- #
56
- # @param spec [Object]
57
- # @param options [Hash]
58
- # @param block [Proc]
59
- # @return [self]
60
- #
61
- def complete(spec = nil, **options, &block)
62
- # Source available in the toys-core gem
63
- end
64
-
65
- ##
66
- # Set the name of this arg as it appears in help screens.
67
- #
68
- # @param display_name [String]
69
- # @return [self]
70
- #
71
- def display_name(display_name)
72
- # Source available in the toys-core gem
73
- end
74
-
75
- ##
76
- # Set the short description for the current positional argument. The
77
- # short description is displayed with the argument in online help.
78
- #
79
- # The description is a {Toys::WrappableString}, which may be word-wrapped
80
- # when displayed in a help screen. You may pass a {Toys::WrappableString}
81
- # directly to this method, or you may pass any input that can be used to
82
- # construct a wrappable string:
83
- #
84
- # * If you pass a String, its whitespace will be compacted (i.e. tabs,
85
- # newlines, and multiple consecutive whitespace will be turned into a
86
- # single space), and it will be word-wrapped on whitespace.
87
- # * If you pass an Array of Strings, each string will be considered a
88
- # literal word that cannot be broken, and wrapping will be done
89
- # across the strings in the array. In this case, whitespace is not
90
- # compacted.
91
- #
92
- # ### Examples
93
- #
94
- # If you pass in a sentence as a simple string, it may be word wrapped
95
- # when displayed:
96
- #
97
- # desc "This sentence may be wrapped."
98
- #
99
- # To specify a sentence that should never be word-wrapped, pass it as the
100
- # sole element of a string array:
101
- #
102
- # desc ["This sentence will not be wrapped."]
103
- #
104
- # @param desc [String,Array<String>,Toys::WrappableString]
105
- # @return [self]
106
- #
107
- def desc(desc)
108
- # Source available in the toys-core gem
109
- end
110
-
111
- ##
112
- # Add to the long description for the current positional argument. The
113
- # long description is displayed with the argument in online help. This
114
- # directive may be given multiple times, and the results are cumulative.
115
- #
116
- # A long description is a series of descriptions, which are generally
117
- # displayed in a series of lines/paragraphs. Each individual description
118
- # uses the form described in the {#desc} documentation, and may be
119
- # word-wrapped when displayed. To insert a blank line, include an empty
120
- # string as one of the descriptions.
121
- #
122
- # ### Example
123
- #
124
- # long_desc "This initial paragraph might get word wrapped.",
125
- # "This next paragraph is followed by a blank line.",
126
- # "",
127
- # ["This line will not be wrapped."],
128
- # [" This indent is preserved."]
129
- # long_desc "This line is appended to the description."
130
- #
131
- # @param long_desc [String,Array<String>,Toys::WrappableString...]
132
- # @return [self]
133
- #
134
- def long_desc(*long_desc)
135
- # Source available in the toys-core gem
136
- end
137
-
138
- ##
139
- # Specify whether to add a method for this argument.
140
- #
141
- # Recognized values are true to force creation of a method, false to
142
- # disable method creation, and nil for the default behavior. The default
143
- # checks the name and adds a method if the name is a symbol representing
144
- # a legal method name that starts with a letter and does not override any
145
- # public method in the Ruby Object class or collide with any method
146
- # directly defined in the tool class.
147
- #
148
- # @param value [true,false,nil]
149
- #
150
- def add_method(value)
151
- # Source available in the toys-core gem
152
- end
153
- end
154
- end
155
- end