squared 0.4.35 → 0.4.37
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 +36 -2
- data/lib/squared/common/format.rb +5 -1
- data/lib/squared/common/shell.rb +5 -5
- data/lib/squared/common/system.rb +2 -1
- data/lib/squared/version.rb +1 -1
- data/lib/squared/workspace/application.rb +20 -3
- data/lib/squared/workspace/project/base.rb +25 -12
- data/lib/squared/workspace/project/docker.rb +4 -4
- data/lib/squared/workspace/project/git.rb +4 -8
- data/lib/squared/workspace/project/node.rb +13 -5
- data/lib/squared/workspace/project/python.rb +8 -4
- data/lib/squared/workspace/project/ruby.rb +4 -3
- data/lib/squared/workspace/project/support/class.rb +12 -6
- 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: 3717cf9c708b4a265d919790f7713bc6c35187c7229d956411d2dcf80ab7dfab
|
|
4
|
+
data.tar.gz: 1659d367915ab16c72c148ddc3ea95312664afe5c92a7b77e31158318f0d1f3b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 330278fdc20d09076437c13530569ab1b09174ba7133558f7f5decdf8da25bff8ee22e0c9054c564f15c80f3a0dae79c859099d875aad2613bd14a244519ebf0
|
|
7
|
+
data.tar.gz: f83310b3557945985db8a70b2f283bd2376b44e50fba64f5a1dc267c3f753bee4aab328906a66b9b888f042a533e75ec74a3c8c3a8147ad444a2e215549a87a2
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.4.37] - 2026-04-29
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
- Project base method dependindex replaces private instance variable.
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- Ruby command version did not abort asdf "Not installed" error.
|
|
12
|
+
- Git command pull action all did not pass option flags to branches.
|
|
13
|
+
- Python command exec did not activate virtual environment.
|
|
14
|
+
- Docker command bake did not reinsert failed check for context directory.
|
|
15
|
+
- Common method shell_quote argument preserve did not bypass requoting.
|
|
16
|
+
|
|
17
|
+
## [0.4.36] - 2026-03-11
|
|
18
|
+
|
|
19
|
+
### Added
|
|
20
|
+
|
|
21
|
+
- Python venv initialization installs setuptools when detected.
|
|
22
|
+
- Node task depend adds prod option flags when NODE_ENV=production.
|
|
23
|
+
|
|
24
|
+
### Changed
|
|
25
|
+
|
|
26
|
+
- Application method with using hide and pass compatibility was implemented.
|
|
27
|
+
|
|
28
|
+
### Fixed
|
|
29
|
+
|
|
30
|
+
- Docker task clean does not run in parallel without ENV override.
|
|
31
|
+
- OptionPartition methods with escape parameter were reordered.
|
|
32
|
+
- OptionPartition methods with quote parameter were revised.
|
|
33
|
+
- Project base run command was not covered due to lack of communication.
|
|
34
|
+
|
|
3
35
|
## [0.4.35] - 2025-12-31
|
|
4
36
|
|
|
5
37
|
### Changed
|
|
@@ -1150,7 +1182,7 @@
|
|
|
1150
1182
|
- Rake did not set original rakefile when calling itself.
|
|
1151
1183
|
- Extended tasks were not associated to their supporting class method.
|
|
1152
1184
|
|
|
1153
|
-
## [0.1.0] - 2024-12-
|
|
1185
|
+
## [0.1.0] - 2024-12-07
|
|
1154
1186
|
|
|
1155
1187
|
### Added
|
|
1156
1188
|
|
|
@@ -1171,12 +1203,14 @@
|
|
|
1171
1203
|
- Git pull did not display colors for diff bar chart.
|
|
1172
1204
|
- Git commit did not fetch latest refs before submitting.
|
|
1173
1205
|
|
|
1174
|
-
## [0.0.12] - 2024-12-
|
|
1206
|
+
## [0.0.12] - 2024-12-01
|
|
1175
1207
|
|
|
1176
1208
|
### Added
|
|
1177
1209
|
|
|
1178
1210
|
- Changelog was created.
|
|
1179
1211
|
|
|
1212
|
+
[0.4.37]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.37
|
|
1213
|
+
[0.4.36]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.36
|
|
1180
1214
|
[0.4.35]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.35
|
|
1181
1215
|
[0.4.34]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.34
|
|
1182
1216
|
[0.4.33]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.33
|
|
@@ -186,7 +186,9 @@ module Squared
|
|
|
186
186
|
end
|
|
187
187
|
if hint.nil? ? args.size > 1 : !hint
|
|
188
188
|
title = log_title(level, color: false)
|
|
189
|
-
|
|
189
|
+
if color
|
|
190
|
+
sub = [{ pat: /\A(#{Regexp.escape(title)})(.*)\z/m, styles: __get__(:theme)[:logger][log_sym(level)] }]
|
|
191
|
+
end
|
|
190
192
|
emphasize(args, title: title + (subject ? " #{subject}" : ''), sub: sub, pipe: -1)
|
|
191
193
|
else
|
|
192
194
|
msg = [log_title(level, color: color)]
|
|
@@ -237,6 +239,8 @@ module Squared
|
|
|
237
239
|
lines = val.to_s.lines(chomp: true)
|
|
238
240
|
lines[0] = "#{val.class}: #{lines.first}" if (err = val.is_a?(::StandardError))
|
|
239
241
|
end
|
|
242
|
+
return if lines.empty?
|
|
243
|
+
|
|
240
244
|
n = cols || max.call(lines)
|
|
241
245
|
if $stdout.tty?
|
|
242
246
|
require 'io/console'
|
data/lib/squared/common/shell.rb
CHANGED
|
@@ -46,7 +46,7 @@ module Squared
|
|
|
46
46
|
end
|
|
47
47
|
end
|
|
48
48
|
|
|
49
|
-
def shell_quote(val, option: true, force: true, double: false, preserve: true, override: false)
|
|
49
|
+
def shell_quote(val, option: true, force: true, double: false, preserve: true, pass: false, override: false)
|
|
50
50
|
val = val.to_s
|
|
51
51
|
return val if (!force && !val.include?(' ')) || val.empty?
|
|
52
52
|
|
|
@@ -54,16 +54,16 @@ module Squared
|
|
|
54
54
|
pat = /\A(?:-[^=\s-](?:=|\s+)?|(--)?[^=\s-][^=\s]*(?(1)(?:=|\s+)|=))(["']).+\2\z/m
|
|
55
55
|
return val if val.match?(pat)
|
|
56
56
|
end
|
|
57
|
-
q = ->(s) { s.gsub("'\\\\''", "'") }
|
|
58
57
|
if val =~ QUOTE_VALUE
|
|
59
|
-
return val if $1 == '"' && Rake::Win32.windows? && val.match?(/(?:[#{File::SEPARATOR} ]|\\")/o)
|
|
58
|
+
return val if pass || ($1 == '"' && Rake::Win32.windows? && val.match?(/(?:[#{File::SEPARATOR} ]|\\")/o))
|
|
60
59
|
|
|
61
60
|
base = $2 unless preserve
|
|
62
61
|
end
|
|
62
|
+
q = -> { (base || val).gsub("'\\\\''", "'") }
|
|
63
63
|
if double || Rake::Win32.windows? || (ARG[:QUOTE] == '"' && !override)
|
|
64
|
-
"\"#{q.call
|
|
64
|
+
"\"#{q.call.gsub(/(?<!\\)"/, '\\"')}\""
|
|
65
65
|
else
|
|
66
|
-
|
|
66
|
+
"'#{q.call.gsub("'", "'\\\\''")}'"
|
|
67
67
|
end
|
|
68
68
|
end
|
|
69
69
|
|
|
@@ -9,6 +9,7 @@ module Squared
|
|
|
9
9
|
module_function
|
|
10
10
|
|
|
11
11
|
def shell(*args, name: :system, **kwargs)
|
|
12
|
+
kwargs.delete(:exception) unless name == :system
|
|
12
13
|
if RUBY_ENGINE == 'jruby' && Rake::Win32.windows?
|
|
13
14
|
e = kwargs[:exception]
|
|
14
15
|
if (dir = kwargs[:chdir]) && ((pwd = Dir.pwd) != dir)
|
|
@@ -24,7 +25,7 @@ module Squared
|
|
|
24
25
|
else
|
|
25
26
|
return Kernel.send(name, *args, **kwargs)
|
|
26
27
|
end
|
|
27
|
-
return ret unless e && !ret
|
|
28
|
+
return ret unless e && !ret
|
|
28
29
|
|
|
29
30
|
raise $?.to_s
|
|
30
31
|
end
|
data/lib/squared/version.rb
CHANGED
|
@@ -178,8 +178,25 @@ module Squared
|
|
|
178
178
|
self
|
|
179
179
|
end
|
|
180
180
|
|
|
181
|
-
def with(*val,
|
|
182
|
-
|
|
181
|
+
def with(*val, hide: nil, group: nil, **kwargs, &blk)
|
|
182
|
+
if hide.nil? && kwargs.key?(:pass)
|
|
183
|
+
pass = kwargs[:pass]
|
|
184
|
+
case pass
|
|
185
|
+
when true, false
|
|
186
|
+
hide = pass
|
|
187
|
+
kwargs.delete(:pass)
|
|
188
|
+
else
|
|
189
|
+
hide, pass = Array(pass).partition { |s| respond_to?(s) || s.to_s.end_with?('?') }
|
|
190
|
+
if pass.empty?
|
|
191
|
+
kwargs.delete(:pass)
|
|
192
|
+
elsif hide.empty?
|
|
193
|
+
hide = nil
|
|
194
|
+
else
|
|
195
|
+
kwargs[:pass] = pass
|
|
196
|
+
end
|
|
197
|
+
end
|
|
198
|
+
end
|
|
199
|
+
return self if hide == true || (hide && Array(hide).any? { |s| respond_to?(s) && __send__(s) rescue nil })
|
|
183
200
|
|
|
184
201
|
@group = nil
|
|
185
202
|
@ref = nil
|
|
@@ -810,7 +827,7 @@ module Squared
|
|
|
810
827
|
' (sync)'
|
|
811
828
|
end}"
|
|
812
829
|
emphasize(grp, title: title, cols: [cols, title.size].max, border: theme[:border],
|
|
813
|
-
sub: [pat: /\A(Step \d+)(.*)\z/, styles: theme[:header]])
|
|
830
|
+
sub: [{ pat: /\A(Step \d+)(.*)\z/, styles: theme[:header] }])
|
|
814
831
|
end
|
|
815
832
|
end
|
|
816
833
|
end
|
|
@@ -456,7 +456,7 @@ module Squared
|
|
|
456
456
|
args[0] = instance_eval(&blk) || f
|
|
457
457
|
return unless args.first
|
|
458
458
|
end
|
|
459
|
-
if args.all?
|
|
459
|
+
if args.all?(Array)
|
|
460
460
|
cmd = []
|
|
461
461
|
var = {}
|
|
462
462
|
args.each do |val|
|
|
@@ -816,7 +816,7 @@ module Squared
|
|
|
816
816
|
end
|
|
817
817
|
|
|
818
818
|
def run(cmd = @session, var = nil, exception: self.exception, sync: true, from: nil, banner: true, chdir: path,
|
|
819
|
-
interactive: nil, hint: nil, **)
|
|
819
|
+
interactive: nil, hint: nil, send: :system, **)
|
|
820
820
|
unless cmd
|
|
821
821
|
print_error('no command session started', subject: project, hint: from || 'unknown', pass: true)
|
|
822
822
|
return
|
|
@@ -854,7 +854,7 @@ module Squared
|
|
|
854
854
|
end
|
|
855
855
|
end
|
|
856
856
|
args = var.is_a?(Hash) ? [var, cmd] : [cmd]
|
|
857
|
-
ret = shell(*args, chdir: chdir, exception: exception)
|
|
857
|
+
ret = shell(*args, name: send, chdir: chdir, exception: exception)
|
|
858
858
|
end
|
|
859
859
|
rescue StandardError => e
|
|
860
860
|
on_error(e, from, exception: true)
|
|
@@ -904,7 +904,7 @@ module Squared
|
|
|
904
904
|
run_set(output[0], *args, **kwargs)
|
|
905
905
|
when :dependfile
|
|
906
906
|
@dependindex = nil
|
|
907
|
-
@dependfile =
|
|
907
|
+
@dependfile = (basepath(*args) if val)
|
|
908
908
|
else
|
|
909
909
|
if block_given?
|
|
910
910
|
if blocks.include?(key)
|
|
@@ -1009,7 +1009,7 @@ module Squared
|
|
|
1009
1009
|
end
|
|
1010
1010
|
|
|
1011
1011
|
def dependtype(*)
|
|
1012
|
-
|
|
1012
|
+
dependindex&.succ || 0
|
|
1013
1013
|
end
|
|
1014
1014
|
|
|
1015
1015
|
def log
|
|
@@ -1113,6 +1113,8 @@ module Squared
|
|
|
1113
1113
|
else
|
|
1114
1114
|
items = check.call(data[start])
|
|
1115
1115
|
end
|
|
1116
|
+
return done if items.empty?
|
|
1117
|
+
|
|
1116
1118
|
if out
|
|
1117
1119
|
a, b, c, d, e = ARG[:GRAPH]
|
|
1118
1120
|
f = tag.call(target)
|
|
@@ -1910,7 +1912,7 @@ module Squared
|
|
|
1910
1912
|
ret = []
|
|
1911
1913
|
if data[:command]
|
|
1912
1914
|
ret[0] = data[:command]
|
|
1913
|
-
ret[1] = data[:opts] unless
|
|
1915
|
+
ret[1] = data[:opts] unless noopt
|
|
1914
1916
|
ret[3] = data[:args]
|
|
1915
1917
|
elsif data[:script]
|
|
1916
1918
|
ret[1] = data[:script]
|
|
@@ -1919,12 +1921,12 @@ module Squared
|
|
|
1919
1921
|
else
|
|
1920
1922
|
ret[0] = false
|
|
1921
1923
|
end
|
|
1922
|
-
ret[2] = data[:env] unless
|
|
1924
|
+
ret[2] = data[:env] unless noenv
|
|
1923
1925
|
ret
|
|
1924
1926
|
end
|
|
1925
1927
|
case cmd
|
|
1926
1928
|
when Array
|
|
1927
|
-
@output = if cmd.all?
|
|
1929
|
+
@output = if cmd.all?(Hash)
|
|
1928
1930
|
noopt = false
|
|
1929
1931
|
noenv = false
|
|
1930
1932
|
cmd.map { |data| parse.call(data) }
|
|
@@ -2010,10 +2012,21 @@ module Squared
|
|
|
2010
2012
|
end
|
|
2011
2013
|
end
|
|
2012
2014
|
|
|
2013
|
-
def dependfile_set(list)
|
|
2014
|
-
@dependindex =
|
|
2015
|
-
|
|
2016
|
-
|
|
2015
|
+
def dependfile_set(list, default: 0)
|
|
2016
|
+
@dependindex = if @dependname
|
|
2017
|
+
@dependfile = basepath @dependname
|
|
2018
|
+
list.index(@dependname)
|
|
2019
|
+
else
|
|
2020
|
+
list.index { |file| basepath(file).exist? }.tap do |i|
|
|
2021
|
+
@dependfile = basepath(list[i || default])
|
|
2022
|
+
end
|
|
2023
|
+
end || (list unless enabled?)
|
|
2024
|
+
end
|
|
2025
|
+
|
|
2026
|
+
def dependindex
|
|
2027
|
+
dependfile_set @dependindex if @dependindex.is_a?(Array)
|
|
2028
|
+
|
|
2029
|
+
@dependindex unless @dependindex.is_a?(Array)
|
|
2017
2030
|
end
|
|
2018
2031
|
|
|
2019
2032
|
def as_get(val, from)
|
|
@@ -20,7 +20,7 @@ module Squared
|
|
|
20
20
|
sbom=q].freeze
|
|
21
21
|
}.freeze,
|
|
22
22
|
compose: {
|
|
23
|
-
common: %w[all-resources compatibility dry-run ansi
|
|
23
|
+
common: %w[all-resources compatibility dry-run ansi=b env-file=p f|file=p parallel=n profile=b progress=b
|
|
24
24
|
project-directory=p p|project-name=e].freeze,
|
|
25
25
|
build: %w[check no-cache print pull push with-dependencies q|quiet build-arg=qq builder=b m|memory=b
|
|
26
26
|
provenance=q sbom=q ssh=qq].freeze,
|
|
@@ -254,8 +254,8 @@ module Squared
|
|
|
254
254
|
def clean(*, sync: invoked_sync?('clean'), **)
|
|
255
255
|
if runnable?(@clean)
|
|
256
256
|
super
|
|
257
|
-
|
|
258
|
-
image
|
|
257
|
+
elsif sync || option('y', prefix: 'docker')
|
|
258
|
+
image :rm
|
|
259
259
|
end
|
|
260
260
|
end
|
|
261
261
|
|
|
@@ -337,7 +337,7 @@ module Squared
|
|
|
337
337
|
if projectpath?(val = args.pop)
|
|
338
338
|
context = val
|
|
339
339
|
else
|
|
340
|
-
|
|
340
|
+
args << val
|
|
341
341
|
end
|
|
342
342
|
end
|
|
343
343
|
op.append(args, escape: true, strip: /^:/)
|
|
@@ -983,12 +983,8 @@ module Squared
|
|
|
983
983
|
printsucc
|
|
984
984
|
end
|
|
985
985
|
op = OptionPartition.new(opts, OPT_GIT[:pull], cmd, project: self, no: OPT_GIT[:no][:pull])
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
else
|
|
989
|
-
opts = op.uniq(opts)
|
|
990
|
-
matchmap op
|
|
991
|
-
end
|
|
986
|
+
opts -= op.extras
|
|
987
|
+
reg = matchmap op
|
|
992
988
|
session_done op.target
|
|
993
989
|
heads = []
|
|
994
990
|
cur = nil
|
|
@@ -1181,7 +1177,7 @@ module Squared
|
|
|
1181
1177
|
{ pat: /^(## )(.+?)(\.{3})(.+)$/, styles: [nil, g, nil, r], index: -1 }
|
|
1182
1178
|
]
|
|
1183
1179
|
else
|
|
1184
|
-
[pat: /^(\t+)([a-z]+: +.+)$/, styles: r, index: 2]
|
|
1180
|
+
[{ pat: /^(\t+)([a-z]+: +.+)$/, styles: r, index: 2 }]
|
|
1185
1181
|
end
|
|
1186
1182
|
end
|
|
1187
1183
|
out, banner, from = source(io: true)
|
|
@@ -1905,7 +1901,7 @@ module Squared
|
|
|
1905
1901
|
styles = theme.fetch(:banner, []).reject { |s| s.to_s.end_with?('!') }
|
|
1906
1902
|
styles << :bold if styles.size <= 1
|
|
1907
1903
|
puts print_footer("#{size} #{size == 1 ? type.sub(/(?:(?<!l)e)?s\z/, '') : type}",
|
|
1908
|
-
sub: [pat: /^(\d+)(.+)$/, styles: styles])
|
|
1904
|
+
sub: [{ pat: /^(\d+)(.+)$/, styles: styles }])
|
|
1909
1905
|
end
|
|
1910
1906
|
on :last, from
|
|
1911
1907
|
end
|
|
@@ -5,7 +5,7 @@ module Squared
|
|
|
5
5
|
module Project
|
|
6
6
|
class Node < Git
|
|
7
7
|
OPT_NPM = {
|
|
8
|
-
common: %w[dry-run=!? include-workspace-root=!?
|
|
8
|
+
common: %w[dry-run=!? force=!? loglevel=b include-workspace-root=!? workspaces=!? w|workspace=v].freeze,
|
|
9
9
|
install: %w[package-lock-only=!? prefer-dedupe=!? E|save-exact=!? before=q cpu=b libc=b os=b].freeze,
|
|
10
10
|
install_base: %w[audit=! bin-links=! foreground-scripts=!? fund=! ignore-scripts=!? install-links=!?
|
|
11
11
|
package-lock=! strict-peer-deps=!? include=b install-strategy=b omit=b].freeze,
|
|
@@ -427,13 +427,18 @@ module Squared
|
|
|
427
427
|
|
|
428
428
|
if (yarn = dependtype(:yarn)) > 0
|
|
429
429
|
cmd = session 'yarn'
|
|
430
|
-
if flag
|
|
430
|
+
if !flag && yarn > 1 && prod?
|
|
431
|
+
cmd << 'workspaces focus --all --production'
|
|
432
|
+
elsif flag == :add
|
|
431
433
|
cmd << 'add'
|
|
432
434
|
cmd << "--#{save}" unless save == 'prod'
|
|
433
435
|
cmd << '--exact' if exact
|
|
434
436
|
else
|
|
435
437
|
cmd << 'install'
|
|
436
|
-
|
|
438
|
+
if yarn == 1
|
|
439
|
+
cmd << '--production' if prod?
|
|
440
|
+
cmd << '--ignore-engines' unless option('ignore-engines', equals: '0')
|
|
441
|
+
end
|
|
437
442
|
end
|
|
438
443
|
elsif pnpm?
|
|
439
444
|
cmd = session 'pnpm'
|
|
@@ -443,6 +448,7 @@ module Squared
|
|
|
443
448
|
option('allow-build') { |val| cmd << quote_option('allow-build', val) }
|
|
444
449
|
else
|
|
445
450
|
cmd << 'install'
|
|
451
|
+
cmd << '--prod' if prod?
|
|
446
452
|
append_platform
|
|
447
453
|
end
|
|
448
454
|
if (val = option('public-hoist-pattern'))
|
|
@@ -457,6 +463,7 @@ module Squared
|
|
|
457
463
|
cmd << "--save-#{save}"
|
|
458
464
|
cmd << '--save-exact' if exact
|
|
459
465
|
else
|
|
466
|
+
cmd << '--include=prod' if prod?
|
|
460
467
|
append_platform
|
|
461
468
|
end
|
|
462
469
|
cmd << '--workspaces=false' if env('NODE_WORKSPACES', equals: '0')
|
|
@@ -685,8 +692,9 @@ module Squared
|
|
|
685
692
|
pwd_set(from: from, dryrun: dryrun) do
|
|
686
693
|
cmd = session_done cmd
|
|
687
694
|
Open3.popen2e(cmd) do |_, out|
|
|
688
|
-
write_lines(out,
|
|
689
|
-
|
|
695
|
+
write_lines(out,
|
|
696
|
+
banner: format_banner(cmd),
|
|
697
|
+
sub: npmnotice + [{ pat: /^(.+)(Tarball .+)$/, styles: color(:bright_blue), index: 2 }])
|
|
690
698
|
end
|
|
691
699
|
end
|
|
692
700
|
on :last, from
|
|
@@ -87,7 +87,7 @@ module Squared
|
|
|
87
87
|
initialize_build(Python.ref, **kwargs)
|
|
88
88
|
initialize_env(**kwargs)
|
|
89
89
|
end
|
|
90
|
-
dependfile_set
|
|
90
|
+
dependfile_set(DEP_PYTHON, default: 2)
|
|
91
91
|
editable_set editable
|
|
92
92
|
venv_set kwargs[:venv]
|
|
93
93
|
end
|
|
@@ -196,7 +196,7 @@ module Squared
|
|
|
196
196
|
end
|
|
197
197
|
args.join(' ')
|
|
198
198
|
end
|
|
199
|
-
|
|
199
|
+
run(cmd, send: :exec, banner: false)
|
|
200
200
|
end
|
|
201
201
|
end
|
|
202
202
|
else
|
|
@@ -228,7 +228,7 @@ module Squared
|
|
|
228
228
|
if args.empty?
|
|
229
229
|
args = readline('Enter command', force: true).split(' ', 2)
|
|
230
230
|
elsif args.size == 1 && !option('interactive', prefix: 'venv', equals: '0')
|
|
231
|
-
args << readline('Enter arguments', force: false)
|
|
231
|
+
args << readline('Enter arguments', force: false) unless args.first.include?(' ')
|
|
232
232
|
end
|
|
233
233
|
venv_init
|
|
234
234
|
run args.join(' ')
|
|
@@ -875,7 +875,11 @@ module Squared
|
|
|
875
875
|
.clear(pass: false)
|
|
876
876
|
status = op.arg?(/\A-v+\z/)
|
|
877
877
|
run(op, env, exception: true, banner: banner)
|
|
878
|
-
|
|
878
|
+
if poetry?
|
|
879
|
+
install(:upgrade, ['poetry'])
|
|
880
|
+
elsif setuptools?
|
|
881
|
+
install(:upgrade, ['setuptools', 'wheel'])
|
|
882
|
+
end
|
|
879
883
|
puts(dir.directory? ? "Success: #{dir}" : 'Failed') if banner && !status
|
|
880
884
|
end
|
|
881
885
|
|
|
@@ -503,13 +503,14 @@ module Squared
|
|
|
503
503
|
`rvm current`[/^\S+/, 0]
|
|
504
504
|
when 'rbenv'
|
|
505
505
|
name = `rbenv version-name`
|
|
506
|
-
name =~ SEM_VER ? "ruby #{name}" : name
|
|
506
|
+
(name =~ SEM_VER) == 0 ? "ruby #{name}" : name
|
|
507
507
|
when 'chruby.sh'
|
|
508
508
|
chruby = session_output 'source', val
|
|
509
509
|
`#{chruby.with('ruby --version')}`
|
|
510
510
|
when 'install'
|
|
511
511
|
ver = '.tool-versions'
|
|
512
|
-
`asdf current ruby`[/ruby\s+\S+/, 0]
|
|
512
|
+
exit 1 unless (cur = `asdf current ruby`[/ruby\s+\S+/, 0])
|
|
513
|
+
cur.sub(/\s+/, ' ')
|
|
513
514
|
else
|
|
514
515
|
ver = nil
|
|
515
516
|
`ruby --version`
|
|
@@ -768,7 +769,7 @@ module Squared
|
|
|
768
769
|
else
|
|
769
770
|
op.clear
|
|
770
771
|
end
|
|
771
|
-
elsif (n = op.index { |val| val.match?(/(\A|[
|
|
772
|
+
elsif (n = op.index { |val| val.match?(/(\A|[\w.-])@\d/) })
|
|
772
773
|
name = op.delete_at(n)
|
|
773
774
|
pre, ver = if (n = name.index('@')) == 0
|
|
774
775
|
[gemname, name[1..-1]]
|
|
@@ -32,10 +32,10 @@ module Squared
|
|
|
32
32
|
ret.map! do |val|
|
|
33
33
|
next val if opt?(val)
|
|
34
34
|
|
|
35
|
-
if
|
|
36
|
-
shell_quote(val, force: force, double: double)
|
|
37
|
-
elsif escape
|
|
35
|
+
if !(pa = val.is_a?(Pathname)) && escape
|
|
38
36
|
shell_escape(val, quote: quote, double: double)
|
|
37
|
+
elsif quote || pa
|
|
38
|
+
shell_quote(val, force: force, double: double)
|
|
39
39
|
else
|
|
40
40
|
val
|
|
41
41
|
end
|
|
@@ -300,10 +300,13 @@ module Squared
|
|
|
300
300
|
self
|
|
301
301
|
end
|
|
302
302
|
|
|
303
|
-
def append_any(*args,
|
|
303
|
+
def append_any(*args, escape: false, **kwargs)
|
|
304
|
+
quote = kwargs.fetch(:quote, true)
|
|
304
305
|
(args.empty? ? extras : args.flatten).each do |val|
|
|
305
306
|
if exist?(val)
|
|
306
307
|
add_path(val, **kwargs)
|
|
308
|
+
elsif escape
|
|
309
|
+
add shell_escape(val, **kwargs)
|
|
307
310
|
elsif quote
|
|
308
311
|
add_quote(val, **kwargs)
|
|
309
312
|
else
|
|
@@ -395,6 +398,7 @@ module Squared
|
|
|
395
398
|
end
|
|
396
399
|
|
|
397
400
|
def add_quote(*args, **kwargs)
|
|
401
|
+
kwargs.delete(:quote)
|
|
398
402
|
args.compact!
|
|
399
403
|
merge(args.map! { |val| val == '--' || OptionPartition.opt?(val) ? val : shell_quote(val, **kwargs) })
|
|
400
404
|
self
|
|
@@ -411,10 +415,12 @@ module Squared
|
|
|
411
415
|
elsif exclude.first.is_a?(Symbol)
|
|
412
416
|
partition(&exclude.first)
|
|
413
417
|
else
|
|
418
|
+
exclude.map! { |pat| Regexp.new(pat) }
|
|
414
419
|
partition do |val|
|
|
415
|
-
|
|
420
|
+
val = val.to_s
|
|
421
|
+
next if pattern && OptionPartition.pattern?(val)
|
|
416
422
|
|
|
417
|
-
exclude.none? { |pat| val.match?(
|
|
423
|
+
exclude.none? { |pat| val.match?(pat) }
|
|
418
424
|
end
|
|
419
425
|
end
|
|
420
426
|
unless temp.empty?
|
|
@@ -16,7 +16,7 @@ module Squared
|
|
|
16
16
|
attr_reader :manifest_url, :manifest
|
|
17
17
|
|
|
18
18
|
def repo(url, manifest = 'latest', run: nil, script: nil, args: nil, dev: nil, prod: nil,
|
|
19
|
-
ref: @ref, group: @group)
|
|
19
|
+
ref: @ref, group: @group, **)
|
|
20
20
|
@home = if (val = env('REPO_HOME'))
|
|
21
21
|
path = Pathname.new(val)
|
|
22
22
|
if main == path.basename.to_s
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: squared
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.37
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- An Pham
|
|
@@ -125,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
125
125
|
- !ruby/object:Gem::Version
|
|
126
126
|
version: '0'
|
|
127
127
|
requirements: []
|
|
128
|
-
rubygems_version: 4.0.
|
|
128
|
+
rubygems_version: 4.0.6
|
|
129
129
|
specification_version: 4
|
|
130
130
|
summary: Rake task generator for managing multi-language workspaces.
|
|
131
131
|
test_files: []
|