toys 0.15.5 → 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 (62) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +12 -1
  3. data/README.md +2 -2
  4. data/builtins/system/test.rb +5 -4
  5. data/builtins/system/tools.rb +1 -1
  6. data/lib/toys/templates/clean.rb +1 -1
  7. data/lib/toys/templates/gem_build.rb +1 -1
  8. data/lib/toys/templates/rubocop.rb +4 -1
  9. data/lib/toys/version.rb +1 -1
  10. metadata +8 -63
  11. data/core-docs/toys/acceptor.rb +0 -474
  12. data/core-docs/toys/arg_parser.rb +0 -397
  13. data/core-docs/toys/cli.rb +0 -466
  14. data/core-docs/toys/compat.rb +0 -2
  15. data/core-docs/toys/completion.rb +0 -340
  16. data/core-docs/toys/context.rb +0 -386
  17. data/core-docs/toys/core.rb +0 -14
  18. data/core-docs/toys/dsl/base.rb +0 -56
  19. data/core-docs/toys/dsl/flag.rb +0 -284
  20. data/core-docs/toys/dsl/flag_group.rb +0 -267
  21. data/core-docs/toys/dsl/internal.rb +0 -4
  22. data/core-docs/toys/dsl/positional_arg.rb +0 -155
  23. data/core-docs/toys/dsl/tool.rb +0 -1639
  24. data/core-docs/toys/errors.rb +0 -126
  25. data/core-docs/toys/flag.rb +0 -560
  26. data/core-docs/toys/flag_group.rb +0 -186
  27. data/core-docs/toys/input_file.rb +0 -17
  28. data/core-docs/toys/loader.rb +0 -363
  29. data/core-docs/toys/middleware.rb +0 -336
  30. data/core-docs/toys/mixin.rb +0 -142
  31. data/core-docs/toys/module_lookup.rb +0 -75
  32. data/core-docs/toys/positional_arg.rb +0 -145
  33. data/core-docs/toys/settings.rb +0 -524
  34. data/core-docs/toys/source_info.rb +0 -271
  35. data/core-docs/toys/standard_middleware/add_verbosity_flags.rb +0 -49
  36. data/core-docs/toys/standard_middleware/apply_config.rb +0 -24
  37. data/core-docs/toys/standard_middleware/handle_usage_errors.rb +0 -33
  38. data/core-docs/toys/standard_middleware/set_default_descriptions.rb +0 -222
  39. data/core-docs/toys/standard_middleware/show_help.rb +0 -190
  40. data/core-docs/toys/standard_middleware/show_root_version.rb +0 -45
  41. data/core-docs/toys/standard_mixins/bundler.rb +0 -98
  42. data/core-docs/toys/standard_mixins/exec.rb +0 -711
  43. data/core-docs/toys/standard_mixins/fileutils.rb +0 -18
  44. data/core-docs/toys/standard_mixins/gems.rb +0 -62
  45. data/core-docs/toys/standard_mixins/git_cache.rb +0 -41
  46. data/core-docs/toys/standard_mixins/highline.rb +0 -133
  47. data/core-docs/toys/standard_mixins/pager.rb +0 -50
  48. data/core-docs/toys/standard_mixins/terminal.rb +0 -135
  49. data/core-docs/toys/standard_mixins/xdg.rb +0 -49
  50. data/core-docs/toys/template.rb +0 -112
  51. data/core-docs/toys/tool_definition.rb +0 -1079
  52. data/core-docs/toys/utils/completion_engine.rb +0 -49
  53. data/core-docs/toys/utils/exec.rb +0 -776
  54. data/core-docs/toys/utils/gems.rb +0 -185
  55. data/core-docs/toys/utils/git_cache.rb +0 -353
  56. data/core-docs/toys/utils/help_text.rb +0 -134
  57. data/core-docs/toys/utils/pager.rb +0 -118
  58. data/core-docs/toys/utils/standard_ui.rb +0 -184
  59. data/core-docs/toys/utils/terminal.rb +0 -310
  60. data/core-docs/toys/utils/xdg.rb +0 -253
  61. data/core-docs/toys/wrappable_string.rb +0 -132
  62. data/core-docs/toys-core.rb +0 -111
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ae3169177d9ed4bb476a290dd4519d69f175bc70d77330237d5091edf6719f28
4
- data.tar.gz: cbb74e67ca8141e42bafe3fc7f3f27843166ae2ec021316b6bfaa18367f086c2
3
+ metadata.gz: 655d198d4597ba9c37fcc968d0e8a79782ef6d54736c821d157dea3b9cb1bec1
4
+ data.tar.gz: 12b95827ad721652171dd6b0de05eda69ffa6fed5b823313de4626c9a8ed8f45
5
5
  SHA512:
6
- metadata.gz: 60dc839c46110b7cad9bf51d206611f68a930f4884612384d95707390de831c3e4ee45ce4d5daef0068e3601a949085aadf553e1a1cfae4c2fbd98d726860e34
7
- data.tar.gz: 725498c71164fb03221741c116788494cfaab52a4d985a5dcbed714724d3bdf5402688b2ad57fefa911e8553d0cf0135834c9be1ef48ad825935df06fcea25a0
6
+ metadata.gz: b5d089ca709d0516a60d91ad8a47e92ba88aad1e761a3c78952cb3338c7146f761490baab0dd96f2cd9090179622772a04332c1eee124c85e4e86214afa67e39
7
+ data.tar.gz: f0b2471d424cc9da3d0570ff309f6bf2723a11b8fe0d5c2fb6e330c2e0deb768ebc13a4fa2238a30f9c602073539a2aedaf02bf4f63e3b05cb86ff6ccb5ea1a8
data/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Release History
2
2
 
3
+ ### v0.16.0 / 2025-10-31
4
+
5
+ * ADDED: Updated minimum Ruby version to 2.7
6
+ * ADDED: Rubocop template now creates tools that respond to Rubocop command line flags and arguments
7
+
8
+ ### v0.15.6 / 2024-05-15
9
+
10
+ * FIXED: Fixed argument parsing to allow a flag values delimited by "=" to contain newlines
11
+ * FIXED: Fixed minitest version failures in the system test builtin tool
12
+ * FIXED: Fixed crash in the system test builtin tool's minitest-rg integration with minitest-rg 5.3
13
+
3
14
  ### v0.15.5 / 2024-01-31
4
15
 
5
16
  * FIXED: Fix for uri version mismatch error in certain bundler integration cases
@@ -42,7 +53,7 @@ Fixes and documentation:
42
53
 
43
54
  * The Bundler integration prevents Bundler from attempting to self-update to the version specified in a lockfile (which would often cause problems when Bundler is called from Toys).
44
55
  * Tools generated by the minitest and rspec standard templates can now interact properly with stdin (e.g. so you can invoke pry temporarily from a test.)
45
- * Some cleanup of varioius mixins to prevent issues if their methods ever get overridden.
56
+ * Some cleanup of various mixins to prevent issues if their methods ever get overridden.
46
57
  * Various improvements and clarifications in the reference documentation and user guide.
47
58
 
48
59
  ### v0.14.7 / 2023-07-19
data/README.md CHANGED
@@ -316,7 +316,7 @@ Toys scripts instead of Rakefiles.
316
316
 
317
317
  ## System requirements
318
318
 
319
- Toys requires Ruby 2.4 or later.
319
+ Toys requires Ruby 2.7 or later.
320
320
 
321
321
  Most parts of Toys work on JRuby. However, JRuby is not recommended because of
322
322
  JVM boot latency, lack of support for Kernel#fork, and other issues.
@@ -326,7 +326,7 @@ because it has a few known bugs that affect Toys.
326
326
 
327
327
  ## License
328
328
 
329
- Copyright 2019-2023 Daniel Azuma and the Toys contributors
329
+ Copyright 2019-2025 Daniel Azuma and the Toys contributors
330
330
 
331
331
  Permission is hereby granted, free of charge, to any person obtaining a copy
332
332
  of this software and associated documentation files (the "Software"), to deal
@@ -45,12 +45,12 @@ def load_minitest_gems
45
45
  gem "minitest", minitest_version
46
46
  require "minitest"
47
47
  if minitest_focus
48
- minitest_focus = "~> 1.0" if minitest_focus == true
48
+ set :minitest_focus, "~> 1.0" if minitest_focus == true
49
49
  gem "minitest-focus", minitest_focus
50
50
  require "minitest/focus"
51
51
  end
52
52
  if minitest_rg
53
- minitest_rg = "~> 5.0" if minitest_rg == true
53
+ set :minitest_rg, "~> 5.0" if minitest_rg == true
54
54
  gem "minitest-rg", minitest_rg
55
55
  require "minitest/rg"
56
56
  end
@@ -82,14 +82,15 @@ end
82
82
 
83
83
  def ruby_code
84
84
  code = []
85
- code << "gem 'minitest', '= #{::Minitest::VERSION}'"
85
+ code << "gem 'minitest', #{minitest_version.inspect}"
86
86
  code << "require 'minitest/autorun'"
87
87
  if minitest_focus
88
88
  code << "gem 'minitest-focus', '= #{::Minitest::Test::Focus::VERSION}'"
89
89
  code << "require 'minitest/focus'"
90
90
  end
91
91
  if minitest_rg
92
- code << "gem 'minitest-rg', '= #{::MiniTest::RG::VERSION}'"
92
+ version = defined?(::Minitest::RG::VERSION) ? ::Minitest::RG::VERSION : ::MiniTest::RG::VERSION
93
+ code << "gem 'minitest-rg', '= #{version}'"
93
94
  code << "require 'minitest/rg'"
94
95
  end
95
96
  code << "require 'toys'"
@@ -3,7 +3,7 @@
3
3
  mixin "tool-methods" do
4
4
  def format_tool(tool, namespace, detailed: false)
5
5
  output = {
6
- "name" => tool.full_name[namespace.length..-1].join(" "),
6
+ "name" => tool.full_name[namespace.length..].join(" "),
7
7
  "desc" => tool.desc.to_s,
8
8
  "runnable" => tool.runnable?,
9
9
  }
@@ -135,7 +135,7 @@ module Toys
135
135
  #
136
136
  def dir_children(dir)
137
137
  ::Dir.entries(dir)
138
- .reject { |entry| entry =~ /^\.\.?$/ }
138
+ .grep_v(/^\.\.?$/)
139
139
  .sort
140
140
  .map { |entry| ::File.join(dir, entry) }
141
141
  end
@@ -188,7 +188,7 @@ module Toys
188
188
  return @gem_name if @gem_name
189
189
  candidates =
190
190
  if context_dir
191
- Compat.glob_in_dir("*.gemspec", context_dir)
191
+ ::Dir.glob("*.gemspec", base: context_dir)
192
192
  else
193
193
  ::Dir.glob("*.gemspec")
194
194
  end
@@ -183,16 +183,19 @@ module Toys
183
183
  bundler_settings = template.bundler_settings
184
184
  include :bundler, **bundler_settings if bundler_settings
185
185
 
186
+ disable_argument_parsing
187
+
186
188
  # @private
187
189
  def run
188
190
  gem "rubocop", *gem_version
189
191
 
190
192
  ::Dir.chdir(context_directory || ::Dir.getwd) do
191
193
  logger.info "Running RuboCop..."
194
+ rubocop_args = rubocop_options + args
192
195
  code = <<~CODE
193
196
  gem 'rubocop', *#{gem_version.inspect}
194
197
  require 'rubocop'
195
- exit(::RuboCop::CLI.new.run(#{rubocop_options.inspect}))
198
+ exit(::RuboCop::CLI.new.run(#{rubocop_args.inspect}))
196
199
  CODE
197
200
  result = exec_ruby(["-e", code])
198
201
  if result.error?
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.15.5"
8
+ VERSION = "0.16.0"
9
9
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: toys
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.5
4
+ version: 0.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Azuma
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-01-31 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: toys-core
@@ -16,14 +15,14 @@ dependencies:
16
15
  requirements:
17
16
  - - '='
18
17
  - !ruby/object:Gem::Version
19
- version: 0.15.5
18
+ version: 0.16.0
20
19
  type: :runtime
21
20
  prerelease: false
22
21
  version_requirements: !ruby/object:Gem::Requirement
23
22
  requirements:
24
23
  - - '='
25
24
  - !ruby/object:Gem::Version
26
- version: 0.15.5
25
+ version: 0.16.0
27
26
  description: Toys is a configurable command line tool. Write commands in Ruby using
28
27
  a simple DSL, and Toys will provide the command line executable and take care of
29
28
  all the details such as argument parsing, online help, and error reporting. Toys
@@ -50,58 +49,6 @@ files:
50
49
  - builtins/system/test.rb
51
50
  - builtins/system/tools.rb
52
51
  - builtins/system/update.rb
53
- - core-docs/toys-core.rb
54
- - core-docs/toys/acceptor.rb
55
- - core-docs/toys/arg_parser.rb
56
- - core-docs/toys/cli.rb
57
- - core-docs/toys/compat.rb
58
- - core-docs/toys/completion.rb
59
- - core-docs/toys/context.rb
60
- - core-docs/toys/core.rb
61
- - core-docs/toys/dsl/base.rb
62
- - core-docs/toys/dsl/flag.rb
63
- - core-docs/toys/dsl/flag_group.rb
64
- - core-docs/toys/dsl/internal.rb
65
- - core-docs/toys/dsl/positional_arg.rb
66
- - core-docs/toys/dsl/tool.rb
67
- - core-docs/toys/errors.rb
68
- - core-docs/toys/flag.rb
69
- - core-docs/toys/flag_group.rb
70
- - core-docs/toys/input_file.rb
71
- - core-docs/toys/loader.rb
72
- - core-docs/toys/middleware.rb
73
- - core-docs/toys/mixin.rb
74
- - core-docs/toys/module_lookup.rb
75
- - core-docs/toys/positional_arg.rb
76
- - core-docs/toys/settings.rb
77
- - core-docs/toys/source_info.rb
78
- - core-docs/toys/standard_middleware/add_verbosity_flags.rb
79
- - core-docs/toys/standard_middleware/apply_config.rb
80
- - core-docs/toys/standard_middleware/handle_usage_errors.rb
81
- - core-docs/toys/standard_middleware/set_default_descriptions.rb
82
- - core-docs/toys/standard_middleware/show_help.rb
83
- - core-docs/toys/standard_middleware/show_root_version.rb
84
- - core-docs/toys/standard_mixins/bundler.rb
85
- - core-docs/toys/standard_mixins/exec.rb
86
- - core-docs/toys/standard_mixins/fileutils.rb
87
- - core-docs/toys/standard_mixins/gems.rb
88
- - core-docs/toys/standard_mixins/git_cache.rb
89
- - core-docs/toys/standard_mixins/highline.rb
90
- - core-docs/toys/standard_mixins/pager.rb
91
- - core-docs/toys/standard_mixins/terminal.rb
92
- - core-docs/toys/standard_mixins/xdg.rb
93
- - core-docs/toys/template.rb
94
- - core-docs/toys/tool_definition.rb
95
- - core-docs/toys/utils/completion_engine.rb
96
- - core-docs/toys/utils/exec.rb
97
- - core-docs/toys/utils/gems.rb
98
- - core-docs/toys/utils/git_cache.rb
99
- - core-docs/toys/utils/help_text.rb
100
- - core-docs/toys/utils/pager.rb
101
- - core-docs/toys/utils/standard_ui.rb
102
- - core-docs/toys/utils/terminal.rb
103
- - core-docs/toys/utils/xdg.rb
104
- - core-docs/toys/wrappable_string.rb
105
52
  - docs/guide.md
106
53
  - lib/toys.rb
107
54
  - lib/toys/standard_cli.rb
@@ -121,11 +68,10 @@ homepage: https://github.com/dazuma/toys
121
68
  licenses:
122
69
  - MIT
123
70
  metadata:
124
- changelog_uri: https://dazuma.github.io/toys/gems/toys/v0.15.5/file.CHANGELOG.html
71
+ changelog_uri: https://dazuma.github.io/toys/gems/toys/v0.16.0/file.CHANGELOG.html
125
72
  source_code_uri: https://github.com/dazuma/toys/tree/main/toys
126
73
  bug_tracker_uri: https://github.com/dazuma/toys/issues
127
- documentation_uri: https://dazuma.github.io/toys/gems/toys/v0.15.5
128
- post_install_message:
74
+ documentation_uri: https://dazuma.github.io/toys/gems/toys/v0.16.0
129
75
  rdoc_options: []
130
76
  require_paths:
131
77
  - lib
@@ -133,15 +79,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
133
79
  requirements:
134
80
  - - ">="
135
81
  - !ruby/object:Gem::Version
136
- version: 2.4.0
82
+ version: 2.7.0
137
83
  required_rubygems_version: !ruby/object:Gem::Requirement
138
84
  requirements:
139
85
  - - ">="
140
86
  - !ruby/object:Gem::Version
141
87
  version: '0'
142
88
  requirements: []
143
- rubygems_version: 3.5.3
144
- signing_key:
89
+ rubygems_version: 3.6.9
145
90
  specification_version: 4
146
91
  summary: A configurable command line tool
147
92
  test_files: []