toys 0.15.3 → 0.15.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: 57b1253240949a832b30bab7889080d57c7a756f30d2db5aa3f639c86190ea45
4
- data.tar.gz: bf4a045fcef88634614042023c58dbb2ccc48e4992fb23935ae0c13dcd1ff695
3
+ metadata.gz: ae3169177d9ed4bb476a290dd4519d69f175bc70d77330237d5091edf6719f28
4
+ data.tar.gz: cbb74e67ca8141e42bafe3fc7f3f27843166ae2ec021316b6bfaa18367f086c2
5
5
  SHA512:
6
- metadata.gz: c1acf98ea97a5b08f03b703ac7caeb0a9a329f507717a516833bd60a53f8f3ae506aa3d91d23d0da4a213ceccffd67c6acf427e4cbeff37a9ce85a45bcd20587
7
- data.tar.gz: 837994ddbe9dd840bb59499e6676b0446058a5c9598536328455d4724948ebfe5736b6842295c9519f26fba6a276f41a50391c8e4c50219ef4f957ebdff93687
6
+ metadata.gz: 60dc839c46110b7cad9bf51d206611f68a930f4884612384d95707390de831c3e4ee45ce4d5daef0068e3601a949085aadf553e1a1cfae4c2fbd98d726860e34
7
+ data.tar.gz: 725498c71164fb03221741c116788494cfaab52a4d985a5dcbed714724d3bdf5402688b2ad57fefa911e8553d0cf0135834c9be1ef48ad825935df06fcea25a0
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Release History
2
2
 
3
+ ### v0.15.5 / 2024-01-31
4
+
5
+ * FIXED: Fix for uri version mismatch error in certain bundler integration cases
6
+
7
+ ### v0.15.4 / 2024-01-04
8
+
9
+ * FIXED: Fix error message when failing assertion of the toys version
10
+ * DOCS: Various documentation improvements
11
+
3
12
  ### v0.15.3 / 2023-10-31
4
13
 
5
14
  * FIXED: Minitest template defers calling autorun until after tests are loaded, which should eliminate stringio warnings when running Rails tests without bundler integration
@@ -9,6 +9,6 @@ module Toys
9
9
  # Current version of Toys core.
10
10
  # @return [String]
11
11
  #
12
- VERSION = "0.15.3"
12
+ VERSION = "0.15.5"
13
13
  end
14
14
  end
@@ -1310,7 +1310,7 @@ module Toys
1310
1310
  # tool "foo" do
1311
1311
  # to_run :foo
1312
1312
  # def foo
1313
- # puts "The fool tool ran!"
1313
+ # puts "The foo tool ran!"
1314
1314
  # end
1315
1315
  # end
1316
1316
  #
@@ -1,8 +1,11 @@
1
1
  ##
2
2
  # **_Defined in the toys-core gem_**
3
3
  #
4
- # This module is a namespace for constant scopes. Whenever a configuration file
5
- # is parsed, a module is created under this parent for that file's constants.
4
+ # This module is the root namespace for tool definitions loaded from files.
5
+ # Whenever a toys configuration file is parsed, a module is created under this
6
+ # parent for that file's contents. Tool classes defined in that file, along
7
+ # with mixins and templates, and any other classes, modules, and constants
8
+ # defined, are located within that file's module.
6
9
  #
7
10
  module Toys::InputFile # rubocop:disable Style/ClassAndModuleChildren
8
11
  ##
@@ -5,17 +5,49 @@ module Toys
5
5
  # Information about the source of a tool, such as the file, git repository,
6
6
  # or block that defined it.
7
7
  #
8
+ # This object represents a source of tool information and definitions. Such a
9
+ # source could include:
10
+ #
11
+ # * A toys directory
12
+ # * A single toys file
13
+ # * A file or directory loaded from git
14
+ # * A config block passed directly to the CLI
15
+ # * A tool block within a toys file
16
+ #
17
+ # The SourceInfo provides information such as the tool's context directory,
18
+ # and locates data and lib directories appropriate to the tool. It also
19
+ # locates the tool's source code so it can be reported when an error occurs.
20
+ #
21
+ # Each tool has a unique SourceInfo with all the information specific to that
22
+ # tool. Additionally, SourceInfo objects are arranged in a containment
23
+ # hierarchy. For example, a SourceInfo object representing a toys files could
24
+ # have a parent representing a toys directory, and an object representing a
25
+ # tool block could have a parent representing an enclosing block or a file.
26
+ #
27
+ # Child SourceInfo objects generally inherit some attributes of their parent.
28
+ # For example, the `.toys` directory in a project directory defines the
29
+ # context directory as that project directory. Then all tools defined under
30
+ # that directory will share that context directory, so all SourceInfo objects
31
+ # descending from that root will inherit that value (unless it's changed
32
+ # explicitly).
33
+ #
34
+ # SourceInfo objects can be obtained in the DSL from
35
+ # {Toys::DSL::Tool#source_info} or at runtime by getting the
36
+ # {Toys::Context::Key::TOOL_SOURCE} key. However, they are created internally
37
+ # by the Loader and should not be created manually.
38
+ #
8
39
  class SourceInfo
9
40
  ##
10
41
  # The parent of this SourceInfo.
11
42
  #
12
43
  # @return [Toys::SourceInfo] The parent.
13
- # @return [nil] if this SourceInfo is the root.
44
+ # @return [nil] if this SourceInfo is a root.
14
45
  #
15
46
  attr_reader :parent
16
47
 
17
48
  ##
18
- # The root ancestor of this SourceInfo.
49
+ # The root ancestor of this SourceInfo. This generally represents a source
50
+ # that was added directly to a CLI in code.
19
51
  #
20
52
  # @return [Toys::SourceInfo] The root ancestor.
21
53
  #
@@ -33,14 +65,16 @@ module Toys
33
65
  # The context directory path (normally the directory containing the
34
66
  # toplevel toys file or directory).
35
67
  #
68
+ # This is not affected by setting a custom context directory for a tool.
69
+ #
36
70
  # @return [String] The context directory path.
37
- # @return [nil] if there is no context directory (perhaps because the tool
38
- # is being defined from a block)
71
+ # @return [nil] if there is no context directory (perhaps because the root
72
+ # source was a block)
39
73
  #
40
74
  attr_reader :context_directory
41
75
 
42
76
  ##
43
- # The source, which may be a path or a proc.
77
+ # The source, which may be a path or a proc depending on the {#source_type}.
44
78
  #
45
79
  # @return [String] Path to the source file or directory.
46
80
  # @return [Proc] The block serving as the source.
@@ -48,7 +82,15 @@ module Toys
48
82
  attr_reader :source
49
83
 
50
84
  ##
51
- # Return the type of source.
85
+ # The type of source. This could be:
86
+ #
87
+ # * `:file`, representing a single toys file. The {#source} will be the
88
+ # filesystem path to that file.
89
+ # * `:directory`, representing a toys directory. The {#source} will be the
90
+ # filesystem path to that directory.
91
+ # * `:proc`, representing a proc, which could be a toplevel block added
92
+ # directly to a CLI, a `tool` block within a toys file, or a block within
93
+ # another block. The {#source} will be the proc itself.
52
94
  #
53
95
  # @return [:file,:directory,:proc]
54
96
  #
@@ -57,13 +99,17 @@ module Toys
57
99
  ##
58
100
  # The path of the current source file or directory.
59
101
  #
102
+ # This could be set even if {#source_type} is `:proc`, if that proc is
103
+ # defined within a toys file. The only time this is not set is if the
104
+ # source is added directly to a CLI in a code block.
105
+ #
60
106
  # @return [String] The source path
61
107
  # @return [nil] if this source has no file system path.
62
108
  #
63
109
  attr_reader :source_path
64
110
 
65
111
  ##
66
- # The source proc.
112
+ # The source proc. This is set if {#source_type} is `:proc`.
67
113
  #
68
114
  # @return [Proc] The source proc
69
115
  # @return [nil] if this source has no proc.
@@ -71,7 +117,8 @@ module Toys
71
117
  attr_reader :source_proc
72
118
 
73
119
  ##
74
- # The git remote.
120
+ # The git remote. This is set if the source, or one of its ancestors, comes
121
+ # from git.
75
122
  #
76
123
  # @return [String] The git remote
77
124
  # @return [nil] if this source is not fron git.
@@ -79,7 +126,8 @@ module Toys
79
126
  attr_reader :git_remote
80
127
 
81
128
  ##
82
- # The git path.
129
+ # The git path. This is set if the source, or one of its ancestors, comes
130
+ # from git.
83
131
  #
84
132
  # @return [String] The git path. This could be the empty string.
85
133
  # @return [nil] if this source is not fron git.
@@ -87,7 +135,8 @@ module Toys
87
135
  attr_reader :git_path
88
136
 
89
137
  ##
90
- # The git commit.
138
+ # The git commit. This is set if the source, or one of its ancestors, comes
139
+ # from git.
91
140
  #
92
141
  # @return [String] The git commit.
93
142
  # @return [nil] if this source is not fron git.
@@ -95,7 +144,7 @@ module Toys
95
144
  attr_reader :git_commit
96
145
 
97
146
  ##
98
- # The user-visible name of this source.
147
+ # A user-visible name of this source.
99
148
  #
100
149
  # @return [String]
101
150
  #
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.3"
8
+ VERSION = "0.15.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.15.3
4
+ version: 0.15.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: 2023-10-31 00:00:00.000000000 Z
11
+ date: 2024-01-31 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.15.3
19
+ version: 0.15.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.15.3
26
+ version: 0.15.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
@@ -121,10 +121,10 @@ homepage: https://github.com/dazuma/toys
121
121
  licenses:
122
122
  - MIT
123
123
  metadata:
124
- changelog_uri: https://dazuma.github.io/toys/gems/toys/v0.15.3/file.CHANGELOG.html
124
+ changelog_uri: https://dazuma.github.io/toys/gems/toys/v0.15.5/file.CHANGELOG.html
125
125
  source_code_uri: https://github.com/dazuma/toys/tree/main/toys
126
126
  bug_tracker_uri: https://github.com/dazuma/toys/issues
127
- documentation_uri: https://dazuma.github.io/toys/gems/toys/v0.15.3
127
+ documentation_uri: https://dazuma.github.io/toys/gems/toys/v0.15.5
128
128
  post_install_message:
129
129
  rdoc_options: []
130
130
  require_paths:
@@ -140,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
140
140
  - !ruby/object:Gem::Version
141
141
  version: '0'
142
142
  requirements: []
143
- rubygems_version: 3.4.10
143
+ rubygems_version: 3.5.3
144
144
  signing_key:
145
145
  specification_version: 4
146
146
  summary: A configurable command line tool