toys-core 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 +4 -4
- data/CHANGELOG.md +9 -0
- data/lib/toys/core.rb +1 -1
- data/lib/toys/dsl/tool.rb +2 -2
- data/lib/toys/input_file.rb +5 -2
- data/lib/toys/source_info.rb +60 -11
- data/lib/toys/utils/gems.rb +7 -0
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ebfb8fda8d9f4aa9fab8169a1b928897d2f99345a9f3b180106b7f17ce2cc882
|
4
|
+
data.tar.gz: 79dba27ffa72f6ebb312688840805e28c8f732c612e19336c5462b7fcbba9d06
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a7cbff222f7311375a89f042a00ef8ffa3f5eb5b05d89923241ced59e0604e11c823952b704c271eecd7723e6511abc9c0d1fcf86b03a94f4f5b4062fa359a8c
|
7
|
+
data.tar.gz: 72d2bfeffe4de765ff480ec23acab92e63a777c10db6c0b9ff3ce2379b5c84f96ed253f6aeaa7d4732637a962be94b79f4b77a43f12f14a8e91986c1343c07d8
|
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
|
* (No significant changes)
|
data/lib/toys/core.rb
CHANGED
data/lib/toys/dsl/tool.rb
CHANGED
@@ -1467,7 +1467,7 @@ module Toys
|
|
1467
1467
|
# tool "foo" do
|
1468
1468
|
# to_run :foo
|
1469
1469
|
# def foo
|
1470
|
-
# puts "The
|
1470
|
+
# puts "The foo tool ran!"
|
1471
1471
|
# end
|
1472
1472
|
# end
|
1473
1473
|
#
|
@@ -1820,7 +1820,7 @@ module Toys
|
|
1820
1820
|
requirement = ::Gem::Requirement.new(*requirements)
|
1821
1821
|
unless requirement.satisfied_by?(version)
|
1822
1822
|
raise Toys::ToolDefinitionError,
|
1823
|
-
"Toys version requirements #{requirement} not satisfied by {version}"
|
1823
|
+
"Toys version requirements #{requirement} not satisfied by #{version}"
|
1824
1824
|
end
|
1825
1825
|
self
|
1826
1826
|
end
|
data/lib/toys/input_file.rb
CHANGED
@@ -1,8 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
##
|
4
|
-
# This module is
|
5
|
-
# is parsed, a module is created under this
|
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
|
##
|
data/lib/toys/source_info.rb
CHANGED
@@ -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
|
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
|
38
|
-
#
|
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
|
-
#
|
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
|
-
#
|
147
|
+
# A user-visible name of this source.
|
99
148
|
#
|
100
149
|
# @return [String]
|
101
150
|
#
|
data/lib/toys/utils/gems.rb
CHANGED
@@ -304,6 +304,13 @@ module Toys
|
|
304
304
|
end
|
305
305
|
|
306
306
|
def setup_bundle(gemfile_path, groups: nil, retries: nil)
|
307
|
+
# Ensure certain built-in gems that may be used by bundler/rubygems
|
308
|
+
# themselves are preloaded so they can be included in the modified
|
309
|
+
# gemfile. This prevents a gem version mismatch if bundler/rubygems
|
310
|
+
# loads a version of the gem during the bundler setup code (i.e. after
|
311
|
+
# the modified gemfile is created) but the gemfile lock itself calls
|
312
|
+
# for a different version.
|
313
|
+
require "uri"
|
307
314
|
# Lock the bundler version, preventing bundler's SelfManager from
|
308
315
|
# installing a different bundler and taking over the process.
|
309
316
|
::ENV["BUNDLER_VERSION"] = ::Bundler::VERSION
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: toys-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.15.
|
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:
|
11
|
+
date: 2024-01-31 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Toys-Core is the command line tool framework underlying Toys. It can
|
14
14
|
be used to create command line executables using the Toys DSL and classes.
|
@@ -79,10 +79,10 @@ homepage: https://github.com/dazuma/toys
|
|
79
79
|
licenses:
|
80
80
|
- MIT
|
81
81
|
metadata:
|
82
|
-
changelog_uri: https://dazuma.github.io/toys/gems/toys-core/v0.15.
|
82
|
+
changelog_uri: https://dazuma.github.io/toys/gems/toys-core/v0.15.5/file.CHANGELOG.html
|
83
83
|
source_code_uri: https://github.com/dazuma/toys/tree/main/toys-core
|
84
84
|
bug_tracker_uri: https://github.com/dazuma/toys/issues
|
85
|
-
documentation_uri: https://dazuma.github.io/toys/gems/toys-core/v0.15.
|
85
|
+
documentation_uri: https://dazuma.github.io/toys/gems/toys-core/v0.15.5
|
86
86
|
post_install_message:
|
87
87
|
rdoc_options: []
|
88
88
|
require_paths:
|
@@ -98,7 +98,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
98
98
|
- !ruby/object:Gem::Version
|
99
99
|
version: '0'
|
100
100
|
requirements: []
|
101
|
-
rubygems_version: 3.
|
101
|
+
rubygems_version: 3.5.3
|
102
102
|
signing_key:
|
103
103
|
specification_version: 4
|
104
104
|
summary: Framework for creating command line executables
|