squared 0.8.4 → 0.8.6
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +78 -4
- data/README.md +18 -8
- data/lib/squared/common/host.rb +4 -0
- data/lib/squared/common/prompt.rb +4 -2
- data/lib/squared/version.rb +1 -1
- data/lib/squared/workspace/application.rb +16 -2
- data/lib/squared/workspace/project/base.rb +17 -5
- data/lib/squared/workspace/project/docker.rb +77 -49
- data/lib/squared/workspace/project/git.rb +36 -28
- data/lib/squared/workspace/project/node.rb +20 -19
- data/lib/squared/workspace/project/python.rb +16 -17
- data/lib/squared/workspace/project/ruby.rb +29 -27
- data/lib/squared/workspace/project/support/optionpartition.rb +24 -5
- data/lib/squared/workspace/repo.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d49aff6b1cd9bedf0f0057bd7f9afe30cee588a2d86224f59585f53f16003ac6
|
|
4
|
+
data.tar.gz: 445bcbd6ae09304dc4797404de44819600abae31b5f41f8bc61ce1951428a25c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 66c420cde0388bbb2c284fc83b365014bdd770cf30d9edb4a5c5b903b9c95752a87a3c8d951acd1c9b73473d2ce5b1167c6bff63fa582d75f79418ed80e468a5
|
|
7
|
+
data.tar.gz: 0b89a2327e97e8f26e077134dfa228bfb1234a09cc6e499a96cd042d23d9e004aea623c63f8b34e3251b198b9f9806b6d191db9978f251c0d52608d1b4e452dd
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,74 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.8.6] - 2026-10-01
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- Pip command options were updated to 26.2.
|
|
8
|
+
- Application method assign for appending project instance methods was created.
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- Bundle exec wrapper did not accept boolean values.
|
|
13
|
+
- RuboCop did not resolve config to project directory.
|
|
14
|
+
|
|
15
|
+
## [0.7.13] - 2026-09-25
|
|
16
|
+
|
|
17
|
+
### Fixed
|
|
18
|
+
|
|
19
|
+
- OptionPartition did not parse quoted option values.
|
|
20
|
+
|
|
21
|
+
## [0.6.20] - 2026-09-25
|
|
22
|
+
|
|
23
|
+
### Added
|
|
24
|
+
|
|
25
|
+
- Prompt choice optional selection can be bypassed with a single dash.
|
|
26
|
+
- OptionPartition can parse supplementary option flags for plain output.
|
|
27
|
+
|
|
28
|
+
### Fixed
|
|
29
|
+
|
|
30
|
+
- Git interactive commit selection did not accept additional values.
|
|
31
|
+
|
|
32
|
+
## [0.8.5] - 2026-09-23
|
|
33
|
+
|
|
34
|
+
### Added
|
|
35
|
+
|
|
36
|
+
- Docker command network action rm was implemented.
|
|
37
|
+
- Git command options were updated to version 2.56.
|
|
38
|
+
|
|
39
|
+
### Changed
|
|
40
|
+
|
|
41
|
+
- Node package managers will check for a lock file when in CI.
|
|
42
|
+
- Docker method network param target was renamed to name.
|
|
43
|
+
|
|
44
|
+
## [0.7.12]
|
|
45
|
+
|
|
46
|
+
### Fixed
|
|
47
|
+
|
|
48
|
+
- See `0.4.42`.
|
|
49
|
+
|
|
50
|
+
## [0.6.19]
|
|
51
|
+
|
|
52
|
+
### Fixed
|
|
53
|
+
|
|
54
|
+
- See `0.4.42`.
|
|
55
|
+
|
|
56
|
+
## [0.5.27]
|
|
57
|
+
|
|
58
|
+
### Fixed
|
|
59
|
+
|
|
60
|
+
- See `0.4.42`.
|
|
61
|
+
|
|
62
|
+
## [0.4.42]
|
|
63
|
+
|
|
64
|
+
### Fixed
|
|
65
|
+
|
|
66
|
+
- OptionPartition did not strip pre-existing quotes when parsing options.
|
|
67
|
+
- Node command outdated did not strip styling from semver in package.json.
|
|
68
|
+
- Git command show did not recognize object names.
|
|
69
|
+
- Docker destination mounts that are not absolute are treated as errors.
|
|
70
|
+
- Docker source mounts for any named volumes or images were inoperable.
|
|
71
|
+
|
|
3
72
|
## [0.8.4] - 2026-09-04
|
|
4
73
|
|
|
5
74
|
### Added
|
|
@@ -38,7 +107,6 @@
|
|
|
38
107
|
### Fixed
|
|
39
108
|
|
|
40
109
|
- Git action grep did not recognize format and max-count.
|
|
41
|
-
- Node command nvm did not quote executable path.
|
|
42
110
|
|
|
43
111
|
## [0.5.26]
|
|
44
112
|
|
|
@@ -59,7 +127,6 @@
|
|
|
59
127
|
|
|
60
128
|
### Fixed
|
|
61
129
|
|
|
62
|
-
- Common prompt method choice did not grep list items.
|
|
63
130
|
- OptionPartition static method strip did not parse flags with dashes.
|
|
64
131
|
- Project base method choice_index did not support multiple selections.
|
|
65
132
|
|
|
@@ -113,7 +180,6 @@
|
|
|
113
180
|
### Changed
|
|
114
181
|
|
|
115
182
|
- OptionPartition method uniq! parameter pass was converted into keyword.
|
|
116
|
-
- Project global ENV for BANNER and STRICT can accept boolean values.
|
|
117
183
|
- Series method exclude? parameter empty was converted into keyword.
|
|
118
184
|
|
|
119
185
|
## [0.7.9] - 2026-07-04
|
|
@@ -621,7 +687,7 @@
|
|
|
621
687
|
|
|
622
688
|
### Fixed
|
|
623
689
|
|
|
624
|
-
- See `0.
|
|
690
|
+
- See `0.4.32`.
|
|
625
691
|
|
|
626
692
|
## [0.4.32]
|
|
627
693
|
|
|
@@ -2087,11 +2153,15 @@
|
|
|
2087
2153
|
|
|
2088
2154
|
- Changelog was created.
|
|
2089
2155
|
|
|
2156
|
+
[0.8.6]: https://github.com/anpham6/squared-ruby/releases/tag/v0.8.6
|
|
2157
|
+
[0.8.5]: https://github.com/anpham6/squared-ruby/releases/tag/v0.8.5
|
|
2090
2158
|
[0.8.4]: https://github.com/anpham6/squared-ruby/releases/tag/v0.8.4
|
|
2091
2159
|
[0.8.3]: https://github.com/anpham6/squared-ruby/releases/tag/v0.8.3
|
|
2092
2160
|
[0.8.2]: https://github.com/anpham6/squared-ruby/releases/tag/v0.8.2
|
|
2093
2161
|
[0.8.1]: https://github.com/anpham6/squared-ruby/releases/tag/v0.8.1
|
|
2094
2162
|
[0.8.0]: https://github.com/anpham6/squared-ruby/releases/tag/v0.8.0
|
|
2163
|
+
[0.7.13]: https://github.com/anpham6/squared-ruby/releases/tag/v0.7.13
|
|
2164
|
+
[0.7.12]: https://github.com/anpham6/squared-ruby/releases/tag/v0.7.12
|
|
2095
2165
|
[0.7.11]: https://github.com/anpham6/squared-ruby/releases/tag/v0.7.11
|
|
2096
2166
|
[0.7.10]: https://github.com/anpham6/squared-ruby/releases/tag/v0.7.10
|
|
2097
2167
|
[0.7.9]: https://github.com/anpham6/squared-ruby/releases/tag/v0.7.9
|
|
@@ -2104,6 +2174,8 @@
|
|
|
2104
2174
|
[0.7.2]: https://github.com/anpham6/squared-ruby/releases/tag/v0.7.2
|
|
2105
2175
|
[0.7.1]: https://github.com/anpham6/squared-ruby/releases/tag/v0.7.1
|
|
2106
2176
|
[0.7.0]: https://github.com/anpham6/squared-ruby/releases/tag/v0.7.0
|
|
2177
|
+
[0.6.20]: https://github.com/anpham6/squared-ruby/releases/tag/v0.6.20
|
|
2178
|
+
[0.6.19]: https://github.com/anpham6/squared-ruby/releases/tag/v0.6.19
|
|
2107
2179
|
[0.6.18]: https://github.com/anpham6/squared-ruby/releases/tag/v0.6.18
|
|
2108
2180
|
[0.6.17]: https://github.com/anpham6/squared-ruby/releases/tag/v0.6.17
|
|
2109
2181
|
[0.6.16]: https://github.com/anpham6/squared-ruby/releases/tag/v0.6.16
|
|
@@ -2123,6 +2195,7 @@
|
|
|
2123
2195
|
[0.6.2]: https://github.com/anpham6/squared-ruby/releases/tag/v0.6.2
|
|
2124
2196
|
[0.6.1]: https://github.com/anpham6/squared-ruby/releases/tag/v0.6.1
|
|
2125
2197
|
[0.6.0]: https://github.com/anpham6/squared-ruby/releases/tag/v0.6.0
|
|
2198
|
+
[0.5.27]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.27
|
|
2126
2199
|
[0.5.26]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.26
|
|
2127
2200
|
[0.5.25]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.25
|
|
2128
2201
|
[0.5.24]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.24
|
|
@@ -2150,6 +2223,7 @@
|
|
|
2150
2223
|
[0.5.2]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.2-ruby
|
|
2151
2224
|
[0.5.1]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.1-ruby
|
|
2152
2225
|
[0.5.0]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.0-ruby
|
|
2226
|
+
[0.4.42]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.42
|
|
2153
2227
|
[0.4.41]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.41
|
|
2154
2228
|
[0.4.40]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.40
|
|
2155
2229
|
[0.4.39]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.39
|
data/README.md
CHANGED
|
@@ -96,19 +96,28 @@ Workspace::Application
|
|
|
96
96
|
apply :clean, ["build/sqd/"] # variable_set (alias)
|
|
97
97
|
end
|
|
98
98
|
.with(:docker, only: ["build", "compose"], hide: [:windows?]) do # When true hide entire group (formerly pass 0.6.0)
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
series(:clean) do
|
|
99
|
+
add("squared", "docker", file: "Dockerfile", context: ".", tag: "latest", registry: "localhost:5000", username: "squared", # compose publish => { oci: "oci://docker.io" }
|
|
100
|
+
args: "--ssh=default",
|
|
101
|
+
client: { config: '/home/user/.docker', tls: true }, # global options
|
|
102
|
+
secrets: ["id=github,env=GITHUB_TOKEN"],
|
|
103
|
+
mounts: ["src=.,dst=/project,ro,bind-propagation=rshared"]) do # Docker
|
|
104
|
+
series(:clean) do # run | depend | doc | lint | test | copy | clean
|
|
105
105
|
File.read(basepath("docker-bake.hcl"))
|
|
106
106
|
.scan(/\btags\s+=\s+\["([^"]+)"\]/)
|
|
107
107
|
.each { |val| image(:rm, tag: val.first) }
|
|
108
108
|
end
|
|
109
109
|
end
|
|
110
110
|
end
|
|
111
|
-
.
|
|
111
|
+
.assign(:ruby) do # Add or override instance methods
|
|
112
|
+
def vmname(bin: false)
|
|
113
|
+
bin ? ['rbenv', '/usr/bin/rbenv'] : 'rbenv'
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
def copy?
|
|
117
|
+
false
|
|
118
|
+
end
|
|
119
|
+
end
|
|
120
|
+
.pass("pull", group: "default") { test? || doc? } # rake pathname:pull optparse:pull
|
|
112
121
|
.style("banner", 255.255) # 256 colors (fg | fg.bg | -0.bg)
|
|
113
122
|
.build(default: "build", parallel: ["pull", "fetch", "rebase", "archive", "clean", /^outdated:/], pass: ["publish"]) do |workspace|
|
|
114
123
|
workspace
|
|
@@ -678,7 +687,7 @@ LOG_LEVEL # See gem "logger"
|
|
|
678
687
|
|
|
679
688
|
### Git
|
|
680
689
|
|
|
681
|
-
* Version: [2.
|
|
690
|
+
* Version: [2.56](https://github.com/git/git/blob/v2.56.0/Documentation/RelNotes/2.56.0.adoc)
|
|
682
691
|
|
|
683
692
|
```sh
|
|
684
693
|
GIT_OPTIONS=q,strategy=ort # all
|
|
@@ -759,6 +768,7 @@ docker build --no-cache --label=v1 --build-arg="NODE_TAG=24" --build-arg="RUBY_V
|
|
|
759
768
|
| compose | run | VERSION=s |
|
|
760
769
|
| compose | publish | TAG=s REGISTRY=s |
|
|
761
770
|
| container | commit | REGISTRY=s PLATFORM=s DISABLE_CONTENT_TRUST=0,1 |
|
|
771
|
+
| container | run | ENTRYPOINT=s |
|
|
762
772
|
| container | -run -create -exec | ALL=1 FILTER=s |
|
|
763
773
|
| | -update -commit | |
|
|
764
774
|
| image | rm | Y=1 |
|
data/lib/squared/common/host.rb
CHANGED
|
@@ -19,6 +19,10 @@ module Squared
|
|
|
19
19
|
!Dir['/.dockerenv', '/docker-*.{sh,d}'].empty?
|
|
20
20
|
end
|
|
21
21
|
|
|
22
|
+
def ci?
|
|
23
|
+
ENV['CI'] == 'true' || ENV.key?('BUILD_NUMBER')
|
|
24
|
+
end
|
|
25
|
+
|
|
22
26
|
def powershell?
|
|
23
27
|
return true if ENV['SHELL']&.end_with?(File.join('', 'pwsh'))
|
|
24
28
|
return false unless windows?
|
|
@@ -91,7 +91,9 @@ module Squared
|
|
|
91
91
|
while (ch = Prompt.reline.readline(msg))
|
|
92
92
|
ch.strip!
|
|
93
93
|
unless ch.empty?
|
|
94
|
-
if
|
|
94
|
+
if ch == '-' && !force
|
|
95
|
+
break
|
|
96
|
+
elsif multiple
|
|
95
97
|
k = if ch == '*'
|
|
96
98
|
(min..max).to_a
|
|
97
99
|
else
|
|
@@ -157,7 +159,7 @@ module Squared
|
|
|
157
159
|
[multiline || (force ? ':' : '?'), '']
|
|
158
160
|
end
|
|
159
161
|
end} "
|
|
160
|
-
ret =
|
|
162
|
+
ret = read.call.to_s.strip
|
|
161
163
|
multiline.each { |val| break if ret.delete_suffix!(val.to_s) } if multiline.is_a?(::Enumerable)
|
|
162
164
|
exit 1 if force && ret.empty?
|
|
163
165
|
ret
|
data/lib/squared/version.rb
CHANGED
|
@@ -403,7 +403,7 @@ module Squared
|
|
|
403
403
|
end
|
|
404
404
|
unless ref.is_a?(Symbol) && (proj = @base.find { |item| item.ref == ref })
|
|
405
405
|
proj = if !ref.is_a?(Class)
|
|
406
|
-
|
|
406
|
+
find_project(ref: ref, path: path)
|
|
407
407
|
elsif Application.extends(ref)
|
|
408
408
|
ref
|
|
409
409
|
end || @kind[name]&.last
|
|
@@ -447,6 +447,16 @@ module Squared
|
|
|
447
447
|
self
|
|
448
448
|
end
|
|
449
449
|
|
|
450
|
+
def assign(ref = @ref, &blk)
|
|
451
|
+
proj = ref && find_project(ref: ref)
|
|
452
|
+
if proj
|
|
453
|
+
proj.class_eval(&blk)
|
|
454
|
+
else
|
|
455
|
+
warn log_message(Logger::ERROR, 'class not found', subject: main, hint: ref)
|
|
456
|
+
end
|
|
457
|
+
self
|
|
458
|
+
end
|
|
459
|
+
|
|
450
460
|
def stage(val, first: false, &blk)
|
|
451
461
|
data = @stage[val]
|
|
452
462
|
if first == true
|
|
@@ -474,7 +484,7 @@ module Squared
|
|
|
474
484
|
obj = begin
|
|
475
485
|
JSON.parse(homepath(obj).read, { symbolize_names: true })
|
|
476
486
|
rescue => e
|
|
477
|
-
warn log_message(Logger::ERROR, e)
|
|
487
|
+
warn log_message(Logger::ERROR, e, subject: main)
|
|
478
488
|
end
|
|
479
489
|
end
|
|
480
490
|
apply_style(data || theme, obj, args, empty: empty) if obj && (!target || data)
|
|
@@ -1082,6 +1092,10 @@ module Squared
|
|
|
1082
1092
|
nil
|
|
1083
1093
|
end
|
|
1084
1094
|
|
|
1095
|
+
def find_project(ref:, path: nil)
|
|
1096
|
+
require_project(ref) || Application.find(ref: ref, path: path)
|
|
1097
|
+
end
|
|
1098
|
+
|
|
1085
1099
|
def root?(path, pass: [])
|
|
1086
1100
|
return false unless path.directory?
|
|
1087
1101
|
|
|
@@ -824,7 +824,7 @@ module Squared
|
|
|
824
824
|
cmd << name
|
|
825
825
|
banner = false if flag == :latest || flag == :where
|
|
826
826
|
end
|
|
827
|
-
success?(run(banner: banner, from: symjoin('asdf', flag)), banner,
|
|
827
|
+
success?(run(banner: banner, from: symjoin('asdf', flag)), banner, %i[set reshim].include?(flag))
|
|
828
828
|
end
|
|
829
829
|
|
|
830
830
|
def first(key, *args, **kwargs, &blk)
|
|
@@ -913,7 +913,7 @@ module Squared
|
|
|
913
913
|
ret = shell_t(*args, name: send, chdir: chdir, exception: exception, timeout: timeout || 0)
|
|
914
914
|
end
|
|
915
915
|
rescue Timeout::Error => e
|
|
916
|
-
print_error(Logger::ERROR,
|
|
916
|
+
print_error(Logger::ERROR, e, subject: name, hint: cmd)
|
|
917
917
|
exit 1 unless exception?(Logger::DEBUG, Logger::INFO)
|
|
918
918
|
rescue => e
|
|
919
919
|
on_error(e, exception: true)
|
|
@@ -1174,10 +1174,20 @@ module Squared
|
|
|
1174
1174
|
ret = basepath(*args)
|
|
1175
1175
|
return ret unless ascend && !ret.exist?
|
|
1176
1176
|
|
|
1177
|
+
case ascend
|
|
1178
|
+
when String, Pathname
|
|
1179
|
+
root = Pathname.new(ascend).cleanpath
|
|
1180
|
+
root = nil unless root.absolute? && root.directory?
|
|
1181
|
+
end
|
|
1177
1182
|
path.parent.ascend.each do |dir|
|
|
1178
1183
|
target = dir.join(*args)
|
|
1179
1184
|
return target if target.exist?
|
|
1180
|
-
|
|
1185
|
+
|
|
1186
|
+
if root
|
|
1187
|
+
break if dir == root
|
|
1188
|
+
elsif workspace.root == dir || parent&.path == dir || (ascend.is_a?(String) && dir.join(ascend).exist?)
|
|
1189
|
+
break
|
|
1190
|
+
end
|
|
1181
1191
|
end
|
|
1182
1192
|
ret
|
|
1183
1193
|
end
|
|
@@ -1365,7 +1375,7 @@ module Squared
|
|
|
1365
1375
|
run(val, var, sync: sync, banner: banner, **kwargs)
|
|
1366
1376
|
end
|
|
1367
1377
|
rescue => e
|
|
1368
|
-
on_error(e, exception:
|
|
1378
|
+
on_error(e, exception: exception?(**kwargs))
|
|
1369
1379
|
end
|
|
1370
1380
|
on :last, from
|
|
1371
1381
|
end
|
|
@@ -2765,7 +2775,9 @@ module Squared
|
|
|
2765
2775
|
workspace.warning
|
|
2766
2776
|
end
|
|
2767
2777
|
|
|
2768
|
-
def exception?(*level)
|
|
2778
|
+
def exception?(*level, **kwargs)
|
|
2779
|
+
return kwargs[:exception] if kwargs.key?(:exception)
|
|
2780
|
+
|
|
2769
2781
|
ret = exception
|
|
2770
2782
|
return ret unless ret.is_a?(Numeric)
|
|
2771
2783
|
|