squared 0.4.37 → 0.4.39
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 +33 -0
- data/lib/squared/common/shell.rb +14 -7
- data/lib/squared/common/utils.rb +9 -1
- data/lib/squared/version.rb +1 -1
- data/lib/squared/workspace/application.rb +11 -3
- data/lib/squared/workspace/project/base.rb +17 -13
- data/lib/squared/workspace/project/docker.rb +5 -15
- data/lib/squared/workspace/project/git.rb +28 -17
- data/lib/squared/workspace/project/node.rb +1 -1
- data/lib/squared/workspace/project/python.rb +6 -5
- data/lib/squared/workspace/project/ruby.rb +2 -2
- data/lib/squared/workspace/project/support/class.rb +5 -5
- 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: ba521fe28499cd80a453a06d45ad6e7f3561fbeb7e346731b3c90a570e5d1d8c
|
|
4
|
+
data.tar.gz: 3f1a4dc8c680f53bb44ba3e48560858ead77a61dbb4d962e8be7f26e123d9abb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a783109febd933dda7e85b97196e4085910b28067946c07fefe565c7bfe2f728acfe7bc88b1ac6b99ae1cd8c76ec3cfef9635f74e7c7fe9c3e2e4fd4ec77e117
|
|
7
|
+
data.tar.gz: 2cb847e0e72dc274b567b37a4f6e91f21a850c0ecc4c787fecfa022d2f858fcc9a67d0a0d75a6788c551abe02e8409c8ba4e429b274a9069d5dc6b5e18d27ea4
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.4.39] - 2026-07-04
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
- Common global argument OUT with a file separator overrides PIPE.
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- Git output list results did not hide footer when banner was disabled.
|
|
12
|
+
- Project banners which were empty were being printed.
|
|
13
|
+
|
|
14
|
+
## [0.4.38] - 2026-06-14
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- Application project commands can be defined without a reference.
|
|
19
|
+
- Git command branch action all was implemented.
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
|
|
23
|
+
- Override alias methods were created for suffix "!" to "\_".
|
|
24
|
+
- Project banners do not display boolean attributes.
|
|
25
|
+
- OptionPartition method append strips single quotes when quoting strings.
|
|
26
|
+
|
|
27
|
+
### Fixed
|
|
28
|
+
|
|
29
|
+
- Application methods log and exclude were non-functional.
|
|
30
|
+
- Docker command bake action build does not support changing context.
|
|
31
|
+
- Project base method semver did not include prerelease delimiter.
|
|
32
|
+
- Project session cleanup did not compare by reference.
|
|
33
|
+
|
|
3
34
|
## [0.4.37] - 2026-04-29
|
|
4
35
|
|
|
5
36
|
### Changed
|
|
@@ -1209,6 +1240,8 @@
|
|
|
1209
1240
|
|
|
1210
1241
|
- Changelog was created.
|
|
1211
1242
|
|
|
1243
|
+
[0.4.39]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.39
|
|
1244
|
+
[0.4.38]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.38
|
|
1212
1245
|
[0.4.37]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.37
|
|
1213
1246
|
[0.4.36]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.36
|
|
1214
1247
|
[0.4.35]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.35
|
data/lib/squared/common/shell.rb
CHANGED
|
@@ -49,15 +49,22 @@ module Squared
|
|
|
49
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
|
+
return val if option && val.match?(/\A(?:-[^=\s-](?:=|\s+)?|(--)?[^=\s-][^=\s]*(?(1)(?:=|\s+)|=))(["']).+\2\z/m)
|
|
52
53
|
|
|
53
|
-
if option
|
|
54
|
-
pat = /\A(?:-[^=\s-](?:=|\s+)?|(--)?[^=\s-][^=\s]*(?(1)(?:=|\s+)|=))(["']).+\2\z/m
|
|
55
|
-
return val if val.match?(pat)
|
|
56
|
-
end
|
|
57
54
|
if val =~ QUOTE_VALUE
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
55
|
+
if pass == '"' || pass == "'"
|
|
56
|
+
return val if pass == $1
|
|
57
|
+
elsif pass || ($1 == '"' && Rake::Win32.windows? && val.match?(/(?:[#{File::SEPARATOR} ]|\\")/o))
|
|
58
|
+
return val
|
|
59
|
+
end
|
|
60
|
+
case preserve
|
|
61
|
+
when false
|
|
62
|
+
base = $2
|
|
63
|
+
when '"'
|
|
64
|
+
base = $2 if $1 == "'"
|
|
65
|
+
when "'"
|
|
66
|
+
base = $2 if $1 == '"'
|
|
67
|
+
end
|
|
61
68
|
end
|
|
62
69
|
q = -> { (base || val).gsub("'\\\\''", "'") }
|
|
63
70
|
if double || Rake::Win32.windows? || (ARG[:QUOTE] == '"' && !override)
|
data/lib/squared/common/utils.rb
CHANGED
|
@@ -159,11 +159,19 @@ module Squared
|
|
|
159
159
|
end
|
|
160
160
|
|
|
161
161
|
def env_pipe(key, default = 1, suffix: nil, strict: false, root: nil)
|
|
162
|
+
out = 1
|
|
162
163
|
case key
|
|
163
164
|
when ::String
|
|
164
165
|
case (ret = env_value(key, suffix: suffix, strict: strict))
|
|
165
166
|
when '0', '1', '2'
|
|
166
167
|
return ret.to_i
|
|
168
|
+
else
|
|
169
|
+
out = default if default.is_a?(::Numeric)
|
|
170
|
+
if ret.include?(File::SEPARATOR)
|
|
171
|
+
default = ret
|
|
172
|
+
elsif key.include?(File::SEPARATOR)
|
|
173
|
+
default = key
|
|
174
|
+
end
|
|
167
175
|
end
|
|
168
176
|
when ::Numeric
|
|
169
177
|
return key if key.between?(0, 2)
|
|
@@ -174,7 +182,7 @@ module Squared
|
|
|
174
182
|
(root ? Pathname.new(root) + default : Pathname.new(default)).realdirpath
|
|
175
183
|
rescue StandardError => e
|
|
176
184
|
warn e
|
|
177
|
-
|
|
185
|
+
out
|
|
178
186
|
end
|
|
179
187
|
end
|
|
180
188
|
|
data/lib/squared/version.rb
CHANGED
|
@@ -95,7 +95,13 @@ module Squared
|
|
|
95
95
|
@kind = Support.hashlist
|
|
96
96
|
@extensions = []
|
|
97
97
|
@envname = env_key(@main).freeze
|
|
98
|
-
@pipe = $DEBUG
|
|
98
|
+
@pipe = if $DEBUG
|
|
99
|
+
2
|
|
100
|
+
elsif (out = ARG[:OUT]) && out.include?(File::SEPARATOR)
|
|
101
|
+
env_pipe(out, pipe, root: home)
|
|
102
|
+
else
|
|
103
|
+
env_pipe(pipe, (out && env(out)) || 1, root: home)
|
|
104
|
+
end
|
|
99
105
|
@exception = env_bool exception
|
|
100
106
|
@verbose = if $VERBOSE.nil?
|
|
101
107
|
false
|
|
@@ -837,7 +843,7 @@ module Squared
|
|
|
837
843
|
log_console(*args, pipe: kwargs[:pipe] || pipe)
|
|
838
844
|
end
|
|
839
845
|
|
|
840
|
-
def script_command(task, val, group, ref, on, &blk)
|
|
846
|
+
def script_command(task, val, group, ref, on = nil, &blk)
|
|
841
847
|
if block_given?
|
|
842
848
|
val = Struct::RunData.new(val, blk)
|
|
843
849
|
elsif !val
|
|
@@ -848,7 +854,7 @@ module Squared
|
|
|
848
854
|
items = as_a(group, :to_sym)
|
|
849
855
|
else
|
|
850
856
|
label = :ref
|
|
851
|
-
items = as_a(ref, :to_sym)
|
|
857
|
+
items = as_a(ref || :_, :to_sym)
|
|
852
858
|
end
|
|
853
859
|
items.each do |name|
|
|
854
860
|
@script[label][name][task] = val
|
|
@@ -881,6 +887,8 @@ module Squared
|
|
|
881
887
|
nil
|
|
882
888
|
elsif ref && target[:ref].key?(ref)
|
|
883
889
|
target[:ref][ref]
|
|
890
|
+
else
|
|
891
|
+
target[:ref][:_]
|
|
884
892
|
end
|
|
885
893
|
end
|
|
886
894
|
|
|
@@ -20,7 +20,7 @@ module Squared
|
|
|
20
20
|
VAR_SET = %i[parent global script index envname desc dependfile dependindex theme archive env dev prod graph
|
|
21
21
|
pass only exclude].freeze
|
|
22
22
|
BLK_SET = %i[run depend doc lint test copy clean].freeze
|
|
23
|
-
SEM_VER = /\b(\d+)(?:(\.)(\d+))?(?:(\.)(\d+))?[-.]?(\S+)?\b/.freeze
|
|
23
|
+
SEM_VER = /\b(\d+)(?:(\.)(\d+))?(?:(\.)(\d+))?(?:([-.])?(\S+))?\b/.freeze
|
|
24
24
|
URI_SCHEME = %r{\A([a-z][a-z\d+-.]*)://[^@:\[\]\\^<>|\s]}i.freeze
|
|
25
25
|
TASK_METADATA = Rake::TaskManager.record_task_metadata
|
|
26
26
|
private_constant :VAR_SET, :BLK_SET, :SEM_VER, :URI_SCHEME, :TASK_METADATA
|
|
@@ -818,7 +818,7 @@ module Squared
|
|
|
818
818
|
def run(cmd = @session, var = nil, exception: self.exception, sync: true, from: nil, banner: true, chdir: path,
|
|
819
819
|
interactive: nil, hint: nil, send: :system, **)
|
|
820
820
|
unless cmd
|
|
821
|
-
print_error('no command session started', subject: project, hint: from
|
|
821
|
+
print_error('no command session started', subject: project, hint: from, pass: true)
|
|
822
822
|
return
|
|
823
823
|
end
|
|
824
824
|
cmd = cmd.target if cmd.is_a?(OptionPartition)
|
|
@@ -1268,7 +1268,7 @@ module Squared
|
|
|
1268
1268
|
return cmd unless cmd.respond_to?(:done)
|
|
1269
1269
|
|
|
1270
1270
|
raise_error('no args added', hint: cmd.first) unless cmd.size > 1
|
|
1271
|
-
@session = nil if cmd
|
|
1271
|
+
@session = nil if cmd.equal?(@session)
|
|
1272
1272
|
cmd.done
|
|
1273
1273
|
end
|
|
1274
1274
|
|
|
@@ -1312,7 +1312,7 @@ module Squared
|
|
|
1312
1312
|
def print_item(*val)
|
|
1313
1313
|
puts unless printfirst?
|
|
1314
1314
|
printsucc
|
|
1315
|
-
puts val unless val.empty? || (val.size == 1 && val.first.
|
|
1315
|
+
puts val unless val.empty? || (val.size == 1 && (!val.first || val.first.empty?))
|
|
1316
1316
|
end
|
|
1317
1317
|
|
|
1318
1318
|
def print_banner(*lines, client: false, styles: theme[:banner], border: borderstyle, **)
|
|
@@ -1409,7 +1409,7 @@ module Squared
|
|
|
1409
1409
|
__send__(meth)
|
|
1410
1410
|
end
|
|
1411
1411
|
end
|
|
1412
|
-
val = val.
|
|
1412
|
+
val = val.reject { |item| !item || item == true }.join(s)
|
|
1413
1413
|
next unless found && !val.empty?
|
|
1414
1414
|
elsif (val = __send__(val)).nil?
|
|
1415
1415
|
next
|
|
@@ -1757,12 +1757,16 @@ module Squared
|
|
|
1757
1757
|
|
|
1758
1758
|
def matchmap(list, prefix = nil)
|
|
1759
1759
|
list.map do |val|
|
|
1760
|
-
if val.is_a?(Regexp)
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1760
|
+
next val if val.is_a?(Regexp)
|
|
1761
|
+
|
|
1762
|
+
if prefix
|
|
1763
|
+
a = nil
|
|
1764
|
+
(val = val.dup).sub!(/\A(\^|\\A)/) do |s|
|
|
1765
|
+
a = s
|
|
1766
|
+
nil
|
|
1767
|
+
end
|
|
1765
1768
|
end
|
|
1769
|
+
Regexp.new("#{a}#{prefix}#{val == '*' ? '.+' : val}")
|
|
1766
1770
|
end
|
|
1767
1771
|
end
|
|
1768
1772
|
|
|
@@ -1790,9 +1794,9 @@ module Squared
|
|
|
1790
1794
|
|
|
1791
1795
|
a, b = [a.first, b.first].map! do |c|
|
|
1792
1796
|
begin
|
|
1793
|
-
d = Integer(c[
|
|
1797
|
+
d = Integer(c[6]).to_s
|
|
1794
1798
|
rescue StandardError
|
|
1795
|
-
d = c[
|
|
1799
|
+
d = c[6] ? '-1' : '0'
|
|
1796
1800
|
end
|
|
1797
1801
|
[c[0], c[2], c[4] || '0', d]
|
|
1798
1802
|
end
|
|
@@ -2077,7 +2081,7 @@ module Squared
|
|
|
2077
2081
|
end
|
|
2078
2082
|
|
|
2079
2083
|
def semmajor?(cur, want)
|
|
2080
|
-
(cur[0] == '0' && want[0] == '0' ? cur[2] != want[2] : cur[0] != want[0]) && !want[
|
|
2084
|
+
(cur[0] == '0' && want[0] == '0' ? cur[2] != want[2] : cur[0] != want[0]) && !want[6]
|
|
2081
2085
|
end
|
|
2082
2086
|
|
|
2083
2087
|
def printfirst?
|
|
@@ -207,7 +207,7 @@ module Squared
|
|
|
207
207
|
end
|
|
208
208
|
end
|
|
209
209
|
else
|
|
210
|
-
format_desc action, flag, "opts*,id/name#{flag == :update ? '+' : '*'}"
|
|
210
|
+
format_desc action, flag, "opts*,id/name#{flag == :update || flag == :inspect ? '+' : '*'}"
|
|
211
211
|
task flag do |_, args|
|
|
212
212
|
container flag, args.to_a
|
|
213
213
|
end
|
|
@@ -330,19 +330,8 @@ module Squared
|
|
|
330
330
|
append_tag(tag || option('tag', ignore: false) || self.tag)
|
|
331
331
|
append_context context
|
|
332
332
|
when :bake
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
op.reset
|
|
336
|
-
if Dir.exist?(args.last)
|
|
337
|
-
if projectpath?(val = args.pop)
|
|
338
|
-
context = val
|
|
339
|
-
else
|
|
340
|
-
args << val
|
|
341
|
-
end
|
|
342
|
-
end
|
|
343
|
-
op.append(args, escape: true, strip: /^:/)
|
|
344
|
-
contextdir context if context
|
|
345
|
-
end
|
|
333
|
+
op.append(escape: true, strip: /^:/, clear: true)
|
|
334
|
+
op.push(context) if context
|
|
346
335
|
end
|
|
347
336
|
op.clear(pass: false)
|
|
348
337
|
run(from: :"buildx:#{flag}")
|
|
@@ -362,6 +351,7 @@ module Squared
|
|
|
362
351
|
end
|
|
363
352
|
run(from: :"compose:#{flag}")
|
|
364
353
|
end
|
|
354
|
+
alias compose_ compose!
|
|
365
355
|
|
|
366
356
|
def container(flag, opts = [], id: nil)
|
|
367
357
|
cmd, opts = docker_session('container', flag, opts: opts)
|
|
@@ -415,7 +405,7 @@ module Squared
|
|
|
415
405
|
end
|
|
416
406
|
end
|
|
417
407
|
append_command(flag, id || tagmain, op.extras)
|
|
418
|
-
when :update
|
|
408
|
+
when :update, :inspect
|
|
419
409
|
raise_error('missing container', hint: flag) if op.empty?
|
|
420
410
|
op.append(escape: true, strip: /^:/)
|
|
421
411
|
when :commit
|
|
@@ -339,7 +339,7 @@ module Squared
|
|
|
339
339
|
end
|
|
340
340
|
|
|
341
341
|
subtasks({
|
|
342
|
-
'branch' => %i[create track delete move copy list current].freeze,
|
|
342
|
+
'branch' => %i[create track delete move copy list all current].freeze,
|
|
343
343
|
'checkout' => %i[commit branch track detach path].freeze,
|
|
344
344
|
'commit' => %i[add all amend amend-orig fixup].freeze,
|
|
345
345
|
'diff' => %i[head branch files view between contain].freeze,
|
|
@@ -697,12 +697,7 @@ module Squared
|
|
|
697
697
|
task flag do |_, args|
|
|
698
698
|
branch flag, args.to_a
|
|
699
699
|
end
|
|
700
|
-
when :
|
|
701
|
-
format_desc action, flag
|
|
702
|
-
task flag do
|
|
703
|
-
branch flag
|
|
704
|
-
end
|
|
705
|
-
else
|
|
700
|
+
when :move, :copy
|
|
706
701
|
format_desc action, flag, 'branch,oldbranch?'
|
|
707
702
|
task flag, [:branch, :oldbranch] do |_, args|
|
|
708
703
|
if (branch = args.branch)
|
|
@@ -713,6 +708,11 @@ module Squared
|
|
|
713
708
|
end
|
|
714
709
|
branch(flag, refs: [oldbranch, branch])
|
|
715
710
|
end
|
|
711
|
+
else
|
|
712
|
+
format_desc action, flag
|
|
713
|
+
task flag do
|
|
714
|
+
branch flag
|
|
715
|
+
end
|
|
716
716
|
end
|
|
717
717
|
when 'switch'
|
|
718
718
|
case flag
|
|
@@ -1133,7 +1133,7 @@ module Squared
|
|
|
1133
1133
|
op.clear
|
|
1134
1134
|
out, banner, from = source(io: true)
|
|
1135
1135
|
print_item banner
|
|
1136
|
-
list_result(write_lines(out), 'objects', from: from)
|
|
1136
|
+
list_result(write_lines(out), 'objects', banner: banner, from: from)
|
|
1137
1137
|
return
|
|
1138
1138
|
end
|
|
1139
1139
|
else
|
|
@@ -1182,7 +1182,7 @@ module Squared
|
|
|
1182
1182
|
end
|
|
1183
1183
|
out, banner, from = source(io: true)
|
|
1184
1184
|
ret = write_lines(out, banner: banner, sub: sub)
|
|
1185
|
-
list_result(ret, 'files',
|
|
1185
|
+
list_result(ret, 'files', action: 'modified', banner: banner, from: from)
|
|
1186
1186
|
end
|
|
1187
1187
|
|
|
1188
1188
|
def revbuild(flag = nil, opts = [], sync: nil, **kwargs)
|
|
@@ -1334,7 +1334,7 @@ module Squared
|
|
|
1334
1334
|
out, banner, from = source(io: true)
|
|
1335
1335
|
print_item banner
|
|
1336
1336
|
ret = write_lines(out, grep: op.extras)
|
|
1337
|
-
list_result(ret, 'tags',
|
|
1337
|
+
list_result(ret, 'tags', grep: op.extras, banner: banner, from: from)
|
|
1338
1338
|
return
|
|
1339
1339
|
end
|
|
1340
1340
|
remote ||= option('remote')
|
|
@@ -1357,6 +1357,7 @@ module Squared
|
|
|
1357
1357
|
append_pathspec op.extras
|
|
1358
1358
|
source(exception: false)
|
|
1359
1359
|
end
|
|
1360
|
+
alias log_ log!
|
|
1360
1361
|
|
|
1361
1362
|
def diff(flag, opts = [], refs: [], branch: nil, range: [], index: [])
|
|
1362
1363
|
cmd, opts = git_session('diff', opts: opts)
|
|
@@ -1564,7 +1565,7 @@ module Squared
|
|
|
1564
1565
|
{ pat: /^(\*\s+)(\S+)(.*)$/, styles: color(:green), index: 2 },
|
|
1565
1566
|
{ pat: %r{^(\s*)(remotes/\S+)(.*)$}, styles: color(:red), index: 2 }
|
|
1566
1567
|
])
|
|
1567
|
-
list_result(ret, 'branches', from: from)
|
|
1568
|
+
list_result(ret, 'branches', banner: banner, from: from)
|
|
1568
1569
|
return
|
|
1569
1570
|
else
|
|
1570
1571
|
if (head = git_spawn('rev-parse --abbrev-ref HEAD').chomp).empty?
|
|
@@ -1718,7 +1719,7 @@ module Squared
|
|
|
1718
1719
|
out, banner, from = source(io: true)
|
|
1719
1720
|
print_item banner
|
|
1720
1721
|
ret = write_lines(out, grep: op.extras, prefix: "refs/#{flag}/")
|
|
1721
|
-
list_result(ret, flag.to_s,
|
|
1722
|
+
list_result(ret, flag.to_s, grep: op.extras, banner: banner, from: from)
|
|
1722
1723
|
end
|
|
1723
1724
|
|
|
1724
1725
|
def ls_files(flag, opts = [])
|
|
@@ -1728,7 +1729,7 @@ module Squared
|
|
|
1728
1729
|
out, banner, from = source(io: true)
|
|
1729
1730
|
print_item banner
|
|
1730
1731
|
ret = write_lines(out, grep: op.extras)
|
|
1731
|
-
list_result(ret, 'files',
|
|
1732
|
+
list_result(ret, 'files', grep: op.extras, banner: banner, from: from)
|
|
1732
1733
|
end
|
|
1733
1734
|
|
|
1734
1735
|
def git(flag, opts = [])
|
|
@@ -1800,6 +1801,10 @@ module Squared
|
|
|
1800
1801
|
|
|
1801
1802
|
def source(cmd = @session, exception: true, io: false, sync: true, stdout: false, stderr: false, banner: true,
|
|
1802
1803
|
multiple: false, hint: nil, from: nil, send: :system, **kwargs)
|
|
1804
|
+
unless cmd
|
|
1805
|
+
print_error('no git session started', subject: project, hint: from, pass: true)
|
|
1806
|
+
return
|
|
1807
|
+
end
|
|
1803
1808
|
cmd = cmd.target if cmd.is_a?(OptionPartition)
|
|
1804
1809
|
if io && banner == false
|
|
1805
1810
|
from = nil
|
|
@@ -1890,14 +1895,20 @@ module Squared
|
|
|
1890
1895
|
ret += 1
|
|
1891
1896
|
break if first
|
|
1892
1897
|
end
|
|
1893
|
-
|
|
1898
|
+
if banner && (ret > 0 || (!pass && !first))
|
|
1899
|
+
if banner.empty?
|
|
1900
|
+
print_item(*out)
|
|
1901
|
+
else
|
|
1902
|
+
print_item(banner, *out)
|
|
1903
|
+
end
|
|
1904
|
+
end
|
|
1894
1905
|
ret
|
|
1895
1906
|
end
|
|
1896
1907
|
|
|
1897
|
-
def list_result(size, type, grep: [],
|
|
1908
|
+
def list_result(size, type, action: 'found', grep: [], banner: nil, from: nil)
|
|
1898
1909
|
if size == 0
|
|
1899
1910
|
puts empty_status("No #{type} were #{action}", 'grep', grep.join(', '))
|
|
1900
|
-
elsif stdout?
|
|
1911
|
+
elsif stdout? && (banner.nil? || (banner.is_a?(String) && !banner.empty?))
|
|
1901
1912
|
styles = theme.fetch(:banner, []).reject { |s| s.to_s.end_with?('!') }
|
|
1902
1913
|
styles << :bold if styles.size <= 1
|
|
1903
1914
|
puts print_footer("#{size} #{size == 1 ? type.sub(/(?:(?<!l)e)?s\z/, '') : type}",
|
|
@@ -1986,7 +1997,7 @@ module Squared
|
|
|
1986
1997
|
end
|
|
1987
1998
|
op << '--verbose' if (flag || from == :fetch) && stdout? && !op.arg?('quiet')
|
|
1988
1999
|
if remote
|
|
1989
|
-
op.append(remote
|
|
2000
|
+
op.append(remote)
|
|
1990
2001
|
if (val = option('refspec', target: target, strict: true))
|
|
1991
2002
|
op.append(*split_escape(val))
|
|
1992
2003
|
else
|
|
@@ -176,11 +176,11 @@ module Squared
|
|
|
176
176
|
end
|
|
177
177
|
break
|
|
178
178
|
end
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
179
|
+
next if found.anybits?(1)
|
|
180
|
+
|
|
181
|
+
puts log_message(found == 0 ? Logger::INFO : Logger::WARN,
|
|
182
|
+
"no scripts #{found == 0 ? 'found' : 'executed'}",
|
|
183
|
+
subject: name, hint: pyprojectfile)
|
|
184
184
|
end
|
|
185
185
|
when 'exec'
|
|
186
186
|
format_desc action, nil, 'command|:,args*'
|
|
@@ -516,6 +516,7 @@ module Squared
|
|
|
516
516
|
op.clear
|
|
517
517
|
run(from: :"#{flag}:build")
|
|
518
518
|
end
|
|
519
|
+
alias build_ build!
|
|
519
520
|
|
|
520
521
|
def publish(flag, opts = [])
|
|
521
522
|
case flag
|
|
@@ -7,7 +7,7 @@ module Squared
|
|
|
7
7
|
GEMFILE = %w[Gemfile Gemfile.lock gem.deps.rb gems.rb Isolate].freeze
|
|
8
8
|
DIR_RUBY = (GEMFILE + Rake::Application::DEFAULT_RAKEFILES + ['README.rdoc']).freeze
|
|
9
9
|
OPT_RUBY = {
|
|
10
|
-
ruby: %w[0=im?
|
|
10
|
+
ruby: %w[a c l n p s S w 0=im? C=pm e=q E=bm F=qm i=bm? I=pm r=bm W=bm? x=pm? d|debug jit rjit verbose
|
|
11
11
|
y|yydebug backtrace-limit=i crash-report=q disable=q dump=q enable=q encoding=b external-encoding=b
|
|
12
12
|
internal-encoding=b parser=b].freeze,
|
|
13
13
|
rake: %w[A|all B|build-all comments n|dry-run m|multitask P|prereqs q|quiet X|no-deprecation-warnings
|
|
@@ -496,7 +496,7 @@ module Squared
|
|
|
496
496
|
].each do |val|
|
|
497
497
|
next unless val.empty? || File.exist?(val.sub('$HOME', Dir.home))
|
|
498
498
|
|
|
499
|
-
trim = ->(s) { s
|
|
499
|
+
trim = ->(s) { s =~ /^\D+\d+\.\d+(?:\.\S+)?/ ? $&.sub(/^([a-z]+)-/i, '\1 ') : s }
|
|
500
500
|
ver = '.ruby-version'
|
|
501
501
|
out << trim.call(case (cmd = File.basename(val))
|
|
502
502
|
when 'rvm'
|
|
@@ -21,7 +21,7 @@ module Squared
|
|
|
21
21
|
include Prompt
|
|
22
22
|
|
|
23
23
|
def append(target, *args, delim: false, escape: false, quote: true, strip: nil, force: true, double: false,
|
|
24
|
-
**)
|
|
24
|
+
preserve: true, **)
|
|
25
25
|
return if (ret = args.flatten).empty?
|
|
26
26
|
|
|
27
27
|
target << '--' if delim && !target.include?('--')
|
|
@@ -35,7 +35,7 @@ module Squared
|
|
|
35
35
|
if !(pa = val.is_a?(Pathname)) && escape
|
|
36
36
|
shell_escape(val, quote: quote, double: double)
|
|
37
37
|
elsif quote || pa
|
|
38
|
-
shell_quote(val, force: force, double: double)
|
|
38
|
+
shell_quote(val, force: force, double: double, preserve: preserve)
|
|
39
39
|
else
|
|
40
40
|
val
|
|
41
41
|
end
|
|
@@ -294,9 +294,9 @@ module Squared
|
|
|
294
294
|
self
|
|
295
295
|
end
|
|
296
296
|
|
|
297
|
-
def append(*args, **kwargs)
|
|
298
|
-
args = extras if args.empty?
|
|
299
|
-
OptionPartition.append(target, *args, **kwargs)
|
|
297
|
+
def append(*args, clear: false, preserve: '"', **kwargs)
|
|
298
|
+
args = clear ? extras.dup.tap { extras.clear } : extras if args.empty?
|
|
299
|
+
OptionPartition.append(target, *args, preserve: preserve, **kwargs)
|
|
300
300
|
self
|
|
301
301
|
end
|
|
302
302
|
|
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.39
|
|
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.10
|
|
129
129
|
specification_version: 4
|
|
130
130
|
summary: Rake task generator for managing multi-language workspaces.
|
|
131
131
|
test_files: []
|