toys 0.11.0 → 0.11.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 93df1335be3b4e82bc30602ed8e78d8a04e99e1df6eecadb1a13430107c761c0
4
- data.tar.gz: 448add98c695e182efcd00dd3995f4c62a8533f47dc8d80a915399a17ec584d5
3
+ metadata.gz: 063c28a7b9b7d3bc5f7ada761beb8623ff144b92847f2a9424889ca953d27cee
4
+ data.tar.gz: a1bcdb384d7592a0a43760aab7cd6da0e4afa4b6a1fd1ad59bb74ed6a6eeef73
5
5
  SHA512:
6
- metadata.gz: '014558969bf84b3f37a8e1948eaeaa7a4acfc0a07b4cfda1a0ec50f1fc11691219fa659a81ed73a0470e1f04ba85311810a3a151d2f5422042c983e969560584'
7
- data.tar.gz: 5fdb203c6b967e554bc16aeadd4d5e8dcccc931f11d04bca0e22d9b635727f7891b4a80363f4ac60b4e0d80ebdc39188595b3dce6e6a3dce72d9e27c83c14e86
6
+ metadata.gz: 50596ee8741422c0e186c7c2b63b52410a0afa1de04dfbea43e06acbf52c8b56f46c54c86471a80bae451c004d238ea94b58d666e7c39742de80bf9c95f95106
7
+ data.tar.gz: 1230cf4acb2414f378be58279a3017cd897a101a7c715e4db88394a8490fdb46dee7d0d9a617196698c034dddf3c6ac88b3855ba19262785dd4989dcf253d409
data/CHANGELOG.md CHANGED
@@ -1,6 +1,31 @@
1
1
  # Release History
2
2
 
3
- ### 0.11.0 / 2020-08-21
3
+ ### v0.11.5 / 2021-03-28
4
+
5
+ * BREAKING CHANGE: The exit_on_nonzero_status option to exec now exits on signals and failures to spawn, in addition to error codes.
6
+ * ADDED: Support retries in the bundler integration.
7
+ * FIXED: Fix a bundler 2.2 integration issue that fails install in certain cases when an update is needed.
8
+ * FIXED: Eliminate Rubygems warning on toys system update.
9
+
10
+ ### v0.11.4 / 2020-10-11
11
+
12
+ * FIXED: Doesn't modify bundler lockfiles when adding Toys to a bundle
13
+ * FIXED: Rdoc template now works on Ruby 3
14
+
15
+ ### v0.11.3 / 2020-09-13
16
+
17
+ * FIXED: The Exec mixin recognizes the argv0 option, and logs it appropriately
18
+
19
+ ### v0.11.2 / 2020-09-06
20
+
21
+ * FIXED: Don't get confused when running toys from within a toys directory
22
+ * FIXED: Fix a JRuby-specific race condition when capturing exec streams
23
+
24
+ ### v0.11.1 / 2020-08-24
25
+
26
+ * FIXED: The `.lib` directory actually works as advertised.
27
+
28
+ ### v0.11.0 / 2020-08-21
4
29
 
5
30
  * ADDED: The toys search path can be truncated using the `truncate_load_path!` directive.
6
31
  * ADDED: The `:clean` template recognizes `:gitignore` as a path indicating all gitignored files.
@@ -12,7 +37,7 @@
12
37
  * FIXED: Fixed a rare Exec capture failure that resulted from a race condition when closing streams.
13
38
  * DOCS: The Toys user guide now covers static bundle loading and `truncate_load_path!`.
14
39
 
15
- ### 0.10.5 / 2020-07-18
40
+ ### v0.10.5 / 2020-07-18
16
41
 
17
42
  * IMPROVED: The bundler mixin silences bundler output during bundle setup.
18
43
  * IMPROVED: The bundler mixin allows toys and toys-core to be in the Gemfile. It checks their version requirements against the running Toys version, and either adds the corret version to the bundle or raises IncompatibleToysError.
@@ -20,24 +45,24 @@
20
45
  * FIXED: Some cases of transitive dependency handling by the bundler mixin.
21
46
  * FIXED: Fixed a crash when computing suggestions, when running with a bundle on Ruby 2.6 or earlier.
22
47
 
23
- ### 0.10.4 / 2020-07-11
48
+ ### v0.10.4 / 2020-07-11
24
49
 
25
50
  * IMPROVED: Bundler integration can now handle Toys itself being in the bundle, as long as the version requirements cover the running Toys version.
26
51
  * IMPROVED: Passing `static: true` to the `:bundler` mixin installs the bundle at definition rather than execution time.
27
52
 
28
- ### 0.10.3 / 2020-07-04
53
+ ### v0.10.3 / 2020-07-04
29
54
 
30
55
  * FIXED: The `exec_separate_tool` method in the `:exec` mixin no longer throws ENOEXEC on Windows.
31
56
 
32
- ### 0.10.2 / 2020-07-03
57
+ ### v0.10.2 / 2020-07-03
33
58
 
34
59
  * FIXED: The load path no longer loses the toys and toys-core directories after a bundle install.
35
60
 
36
- ### 0.10.1 / 2020-03-07
61
+ ### v0.10.1 / 2020-03-07
37
62
 
38
63
  * FIXED: Setting `:exit_on_nonzero_status` explicitly to false now works as expected.
39
64
 
40
- ### 0.10.0 / 2020-02-24
65
+ ### v0.10.0 / 2020-02-24
41
66
 
42
67
  * ADDED: `:bundler` mixin that installs and sets up a bundle for the tool
43
68
  * ADDED: `bundler` options in the standard templates, to run those tools in a bundle
@@ -53,26 +78,26 @@
53
78
  * FIXED: `rdoc` template crashed if any nonstandard options were given.
54
79
  * FIXED: `rubocop` template would abort prematurely if standard streams were redirected.
55
80
 
56
- ### 0.9.4 / 2020-01-26
81
+ ### v0.9.4 / 2020-01-26
57
82
 
58
83
  * FIXED: Crash in the loader when a non-ruby file appears in a toys directory
59
84
 
60
- ### 0.9.3 / 2020-01-05
85
+ ### v0.9.3 / 2020-01-05
61
86
 
62
87
  * FIXED: `delegate_to` directive could crash if an overriding tool has already been defined.
63
88
  * FIXED: A Ruby 2.7 warning when reporting a Toys file syntax error.
64
89
 
65
- ### 0.9.2 / 2020-01-03
90
+ ### v0.9.2 / 2020-01-03
66
91
 
67
92
  * IMPROVED: Mixins can now take real keyword arguments, and will pass them on properly to `on_initialize` and `on_include` blocks.
68
93
  * CHANGED: `Toys::Utils::Exec` and the `:exec` mixin methods now take real keyword arguments rather than an `opts` hash. This means you should use keywords (or the double-splat operator) to avoid a deprecation warning on Ruby 2.7.
69
94
 
70
- ### 0.9.1 / 2019-12-22
95
+ ### v0.9.1 / 2019-12-22
71
96
 
72
97
  * IMPROVED: `delegate_to` and `alias_tool` can take symbols as well as strings.
73
98
  * DOCS: Fixed user guide internal links on rubydoc.info.
74
99
 
75
- ### 0.9.0 / 2019-12-02
100
+ ### v0.9.0 / 2019-12-02
76
101
 
77
102
  * 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.
78
103
  * ADDED: The `delegate_to` argument to the `tool` directive causes the tool to delegate to another tool. (Note: the `alias_tool` directive is now just shorthand for creating a tool with a delegate, and as such is mildly deprecated.)
@@ -83,12 +108,12 @@
83
108
  * IMPROVED: JRuby is now supported for most operations. However, JRuby is generally not recommended because of JVM boot latency, lack of Kernel#fork support, and other issues.
84
109
  * FIXED: The the `tool` directive no longer crashes if not passed a block.
85
110
 
86
- ### 0.8.1 / 2019-11-19
111
+ ### v0.8.1 / 2019-11-19
87
112
 
88
113
  * FIXED: Listing subtools would crash if a broken alias was present.
89
114
  * DOCUMENTATION: Switched from redcarpet to kramdown, and tried to make some structural fixes.
90
115
 
91
- ### 0.8.0 / 2019-06-20
116
+ ### v0.8.0 / 2019-06-20
92
117
 
93
118
  This is a major update with significant new features and a bunch of fixes.
94
119
  It does include a few minor backward-incompatible changes. All signifiant
@@ -142,18 +167,18 @@ Details:
142
167
 
143
168
  Additionally, a significant amount of internal reorganization and cleanup happened in the toys-core gem. See the changelog for toys-core for more details.
144
169
 
145
- ### 0.7.0 / 2019-01-23
170
+ ### v0.7.0 / 2019-01-23
146
171
 
147
172
  * ADDED: A template for creating tools that invoke RSpec.
148
173
  * ADDED: Flag groups, which enforce policies around which flags are required.
149
174
  * CHANGED: Flags within a group are sorted in the help screens.
150
175
  * IMPROVED: The minitest template now honors all standard minitest flags.
151
176
 
152
- ### 0.6.1 / 2019-01-07
177
+ ### v0.6.1 / 2019-01-07
153
178
 
154
179
  * FIXED: The presence of aliases caused subtool listing to crash.
155
180
 
156
- ### 0.6.0 / 2018-10-22
181
+ ### v0.6.0 / 2018-10-22
157
182
 
158
183
  * FIXED: Build tools cd into the context directory when running.
159
184
  * FIXED: Rakefiles are evaluated and tasks are run in the Rakefile's directory.
@@ -165,7 +190,7 @@ Additionally, a significant amount of internal reorganization and cleanup happen
165
190
  * IMPROVED: Non-runnable namespaces are no longer displayed in recursive subtool
166
191
  lists if their children are already displayed.
167
192
 
168
- ### 0.5.0 / 2018-10-07
193
+ ### v0.5.0 / 2018-10-07
169
194
 
170
195
  * ADDED: Period and colon are recognized as tool path delimiters.
171
196
  * ADDED: New rake template that supports loading rake tasks as tools.
@@ -176,31 +201,31 @@ Additionally, a significant amount of internal reorganization and cleanup happen
176
201
  * IMPROVED: The tool directive can now take an `if_defined` argument.
177
202
  * FIXED: Template instantiation was failing if the hosting tool was priority-masked.
178
203
 
179
- ### 0.4.5 / 2018-08-05
204
+ ### v0.4.5 / 2018-08-05
180
205
 
181
206
  * CHANGED: Dropped preload file feature
182
207
 
183
- ### 0.4.4 / 2018-07-21
208
+ ### v0.4.4 / 2018-07-21
184
209
 
185
210
  * FIXED: Utils::Exec wasn't closing streams after copying.
186
211
  * IMPROVED: Utils::Exec::Controller can capture or redirect the remainder of a controlled stream.
187
212
  * ADDED: Terminal#ask
188
213
 
189
- ### 0.4.3 / 2018-07-13
214
+ ### v0.4.3 / 2018-07-13
190
215
 
191
216
  * IMPROVED: Exec mixin methods can now spawn subprocesses in the background
192
217
  * IMPROVED: Exec mixin capture methods can now yield a controller
193
218
 
194
- ### 0.4.2 / 2018-07-08
219
+ ### v0.4.2 / 2018-07-08
195
220
 
196
221
  * FIXED: Raise an error rather than cause unexpected behavior if a mixin is included twice.
197
222
  * IMPROVED: The `include?` method extended to support mixin names in a tool dsl.
198
223
 
199
- ### 0.4.1 / 2018-07-03
224
+ ### v0.4.1 / 2018-07-03
200
225
 
201
226
  * FIXED: Terminal#confirm uppercased "N" for the wrong default.
202
227
 
203
- ### 0.4.0 / 2018-07-03
228
+ ### v0.4.0 / 2018-07-03
204
229
 
205
230
  Now declaring this alpha quality. Backward-incompatible changes are still
206
231
  possible from this point, but I'll try to avoid them.
@@ -210,24 +235,24 @@ possible from this point, but I'll try to avoid them.
210
235
  * IMPROVED: Toys::Utils::Gems can suppress the confirmation prompt
211
236
  * IMPROVED: Magic comments are now honored in toys files.
212
237
 
213
- ### 0.3.11 / 2018-07-02
238
+ ### v0.3.11 / 2018-07-02
214
239
 
215
240
  * CHANGED: Require Ruby 2.3 or later
216
241
  * CHANGED: Renamed "set" directive to "static" to reduce confusion with Tool#set.
217
242
  * ADDED: Convenience methods for getting option values
218
243
 
219
- ### 0.3.10 / 2018-06-30
244
+ ### v0.3.10 / 2018-06-30
220
245
 
221
246
  * CHANGED: Dropped Tool#option. Use Tool#get instead.
222
247
  * CHANGED: "run" directive renamed to "to_run"
223
248
  * CHANGED: Highline mixin now uses Highline 2.0
224
249
  * ADDED: Mixins can provide initializers
225
250
 
226
- ### 0.3.9.1 / 2018-06-24
251
+ ### v0.3.9.1 / 2018-06-24
227
252
 
228
253
  * FIXED: Built-in flags were interfering with disable_argument_parsing
229
254
 
230
- ### 0.3.9 / 2018-06-24
255
+ ### v0.3.9 / 2018-06-24
231
256
 
232
257
  * CHANGED: Removed alias_as directive since it's incompatible with selective loading.
233
258
  * ADDED: Ability to define named templates in Toys files
@@ -237,18 +262,18 @@ possible from this point, but I'll try to avoid them.
237
262
  * IMPROVED: Acceptors can be looked up recursively in the same way as mixins and templates
238
263
  * FIXED: Templates were not activating needed gems
239
264
 
240
- ### 0.3.8 / 2018-06-10
265
+ ### v0.3.8 / 2018-06-10
241
266
 
242
267
  * CHANGED: Renamed helpers to mixins.
243
268
  * CHANGED: Renamed :in_from, :out_to, and :err_to exec options to :in, :out, :err
244
269
  * IMPROVED: Exec raises an error if passed an unknown option.
245
270
  * IMPROVED: Exec now accepts nearly all the same stream specifications as Process#spawn.
246
271
 
247
- ### 0.3.7.1 / 2018-05-30
272
+ ### v0.3.7.1 / 2018-05-30
248
273
 
249
274
  * FIXED: Fix crash in system update.
250
275
 
251
- ### 0.3.7 / 2018-05-30
276
+ ### v0.3.7 / 2018-05-30
252
277
 
253
278
  * CHANGED: Execution runs in the same scope as the DSL, which lets us use normal methods instead of helper-blocks.
254
279
  * CHANGED: Renamed "script" to "run", and allow setting of runnable by defining a "run" method
@@ -257,7 +282,7 @@ possible from this point, but I'll try to avoid them.
257
282
  * CHANGED: Removed spinner helper and added terminal helper.
258
283
  * ADDED: Helper modules scoped to the tool hierarchy
259
284
 
260
- ### 0.3.6 / 2018-05-21
285
+ ### v0.3.6 / 2018-05-21
261
286
 
262
287
  * CHANGED: Removed Context#new_cli and exposed Context#cli instead.
263
288
  * CHANGED: Raises ToolDefinitionError if you declare a duplicate flag.
@@ -266,13 +291,13 @@ possible from this point, but I'll try to avoid them.
266
291
  * IMPROVED: Support custom acceptors.
267
292
  * IMPROVED: Highline helper automatically sets use_color based on the type of stdout.
268
293
 
269
- ### 0.3.5 / 2018-05-15
294
+ ### v0.3.5 / 2018-05-15
270
295
 
271
296
  * CHANGED: Flag and arg blocks in the DSL have an interface more similar to the rest of the DSL.
272
297
  * CHANGED: Renamed `execute do` to `script do`.
273
298
  * IMPROVED: Help display uses `less` if available.
274
299
 
275
- ### 0.3.4 / 2018-05-14
300
+ ### v0.3.4 / 2018-05-14
276
301
 
277
302
  * CHANGED: Renamed switch to flag
278
303
  * CHANGED: Renamed docs: parameter again, to desc: and long_desc: to match tool desc.
@@ -289,7 +314,7 @@ possible from this point, but I'll try to avoid them.
289
314
  * FIXED: Subtools with no desc now properly pick up the default
290
315
  * FIXED: Usage errors and show-help now interact in the right way
291
316
 
292
- ### 0.3.3 / 2018-05-09
317
+ ### v0.3.3 / 2018-05-09
293
318
 
294
319
  * CHANGED: Renamed file_utils helper to fileutils.
295
320
  * CHANGED: Renamed doc: parameter to docs:
@@ -299,7 +324,7 @@ possible from this point, but I'll try to avoid them.
299
324
  * ADDED: WrappableString for descriptions and docs
300
325
  * IMPROVED: Descriptions can have multiple lines
301
326
 
302
- ### 0.3.2 / 2018-05-07
327
+ ### v0.3.2 / 2018-05-07
303
328
 
304
329
  * CHANGED: Split core engine out into separate "toys-core" gem. See the
305
330
  toys-core changelog for additional changes in core.
@@ -310,7 +335,7 @@ possible from this point, but I'll try to avoid them.
310
335
  * IMPROVED: Help shows the config file path on "--verbose".
311
336
  * IMPROVED: You can now run a sub-instance of toys from an executor.
312
337
 
313
- ### 0.3.1 / 2018-05-02
338
+ ### v0.3.1 / 2018-05-02
314
339
 
315
340
  * CHANGED: Subcommand display is now recursive by default.
316
341
  * IMPROVED: Improved error messaging for bad switch syntax.
@@ -319,6 +344,6 @@ possible from this point, but I'll try to avoid them.
319
344
  * DOCS: Completed a first pass on class and method documentation.
320
345
  * INTERNAL: Adjusted naming of switch-related methods.
321
346
 
322
- ### 0.3.0 / 2018-04-30
347
+ ### v0.3.0 / 2018-04-30
323
348
 
324
349
  * Initial generally usable release
data/builtins/system.rb CHANGED
@@ -28,7 +28,7 @@ tool "update" do
28
28
  configure_exec(exit_on_nonzero_status: true)
29
29
  version_info = spinner(leading_text: "Checking rubygems for the latest release... ",
30
30
  final_text: "Done.\n") do
31
- capture(["gem", "query", "-q", "-r", "-e", "toys"])
31
+ capture(["gem", "list", "-q", "-r", "-e", "toys"])
32
32
  end
33
33
  if version_info =~ /toys\s\((.+)\)/
34
34
  latest_version = ::Gem::Version.new(::Regexp.last_match(1))
@@ -42,6 +42,12 @@ module Toys
42
42
  #
43
43
  DATA_DIR_NAME = ".data"
44
44
 
45
+ ##
46
+ # Standard lib directory name in a toys configuration.
47
+ # @return [String]
48
+ #
49
+ LIB_DIR_NAME = ".lib"
50
+
45
51
  ##
46
52
  # Name of the standard toys executable.
47
53
  # @return [String]
@@ -99,11 +105,12 @@ module Toys
99
105
  preload_file_name: PRELOAD_FILE_NAME,
100
106
  preload_dir_name: PRELOAD_DIR_NAME,
101
107
  data_dir_name: DATA_DIR_NAME,
108
+ lib_dir_name: LIB_DIR_NAME,
102
109
  extra_delimiters: EXTRA_DELIMITERS,
103
110
  middleware_stack: default_middleware_stack,
104
111
  template_lookup: default_template_lookup
105
112
  )
106
- add_standard_paths(cur_dir: cur_dir)
113
+ add_standard_paths(cur_dir: cur_dir, toys_dir_name: CONFIG_DIR_NAME)
107
114
  end
108
115
 
109
116
  private
@@ -125,8 +132,9 @@ module Toys
125
132
  # directories, or `nil` to use the defaults.
126
133
  # @return [self]
127
134
  #
128
- def add_standard_paths(cur_dir: nil, global_dirs: nil)
135
+ def add_standard_paths(cur_dir: nil, global_dirs: nil, toys_dir_name: nil)
129
136
  cur_dir ||= ::Dir.pwd
137
+ cur_dir = skip_toys_dir(cur_dir, toys_dir_name) if toys_dir_name
130
138
  global_dirs ||= default_global_dirs
131
139
  add_search_path_hierarchy(start: cur_dir, terminate: global_dirs)
132
140
  global_dirs.each { |path| add_search_path(path) }
@@ -135,6 +143,20 @@ module Toys
135
143
  self
136
144
  end
137
145
 
146
+ # Step out of any toys dir
147
+ def skip_toys_dir(dir, toys_dir_name)
148
+ cur_dir = dir
149
+ loop do
150
+ parent = ::File.dirname(dir)
151
+ return cur_dir if parent == dir
152
+ if ::File.basename(dir) == toys_dir_name
153
+ cur_dir = dir = parent
154
+ else
155
+ dir = parent
156
+ end
157
+ end
158
+ end
159
+
138
160
  # rubocop:disable Metrics/MethodLength
139
161
 
140
162
  ##
@@ -12,7 +12,7 @@ module Toys
12
12
  # Default version requirements for the rdoc gem.
13
13
  # @return [Array<String>]
14
14
  #
15
- DEFAULT_GEM_VERSION_REQUIREMENTS = ["~> 6.1.0"].freeze
15
+ DEFAULT_GEM_VERSION_REQUIREMENTS = [">= 6.1.0"].freeze
16
16
 
17
17
  ##
18
18
  # Default tool name
data/lib/toys/version.rb CHANGED
@@ -5,5 +5,5 @@ module Toys
5
5
  # Current version of the Toys command line executable.
6
6
  # @return [String]
7
7
  #
8
- VERSION = "0.11.0"
8
+ VERSION = "0.11.5"
9
9
  end
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.11.0
4
+ version: 0.11.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Azuma
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-21 00:00:00.000000000 Z
11
+ date: 2021-03-28 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.11.0
19
+ version: 0.11.5
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.11.0
26
+ version: 0.11.5
27
27
  description: Toys is a configurable command line tool. Write commands in Ruby using
28
28
  a simple DSL, and Toys will provide the command line executable and take care of
29
29
  all the details such as argument parsing, online help, and error reporting. Toys
@@ -63,10 +63,10 @@ homepage: https://github.com/dazuma/toys
63
63
  licenses:
64
64
  - MIT
65
65
  metadata:
66
- changelog_uri: https://dazuma.github.io/toys/gems/toys/v0.11.0/file.CHANGELOG.html
67
- source_code_uri: https://github.com/dazuma/toys
66
+ changelog_uri: https://dazuma.github.io/toys/gems/toys/v0.11.5/file.CHANGELOG.html
67
+ source_code_uri: https://github.com/dazuma/toys/tree/main/toys
68
68
  bug_tracker_uri: https://github.com/dazuma/toys/issues
69
- documentation_uri: https://dazuma.github.io/toys/gems/toys/v0.11.0
69
+ documentation_uri: https://dazuma.github.io/toys/gems/toys/v0.11.5
70
70
  post_install_message:
71
71
  rdoc_options: []
72
72
  require_paths:
@@ -82,7 +82,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
82
82
  - !ruby/object:Gem::Version
83
83
  version: '0'
84
84
  requirements: []
85
- rubygems_version: 3.1.2
85
+ rubygems_version: 3.1.4
86
86
  signing_key:
87
87
  specification_version: 4
88
88
  summary: A configurable command line tool