squared 0.4.38 → 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 +12 -0
- data/lib/squared/common/utils.rb +9 -1
- data/lib/squared/version.rb +1 -1
- data/lib/squared/workspace/application.rb +7 -1
- data/lib/squared/workspace/project/base.rb +10 -6
- data/lib/squared/workspace/project/docker.rb +2 -2
- data/lib/squared/workspace/project/git.rb +15 -9
- metadata +1 -1
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,16 @@
|
|
|
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
|
+
|
|
3
14
|
## [0.4.38] - 2026-06-14
|
|
4
15
|
|
|
5
16
|
### Added
|
|
@@ -1229,6 +1240,7 @@
|
|
|
1229
1240
|
|
|
1230
1241
|
- Changelog was created.
|
|
1231
1242
|
|
|
1243
|
+
[0.4.39]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.39
|
|
1232
1244
|
[0.4.38]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.38
|
|
1233
1245
|
[0.4.37]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.37
|
|
1234
1246
|
[0.4.36]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.36
|
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
|
|
@@ -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, **)
|
|
@@ -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
|
|
|
@@ -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
|
|
@@ -405,7 +405,7 @@ module Squared
|
|
|
405
405
|
end
|
|
406
406
|
end
|
|
407
407
|
append_command(flag, id || tagmain, op.extras)
|
|
408
|
-
when :update
|
|
408
|
+
when :update, :inspect
|
|
409
409
|
raise_error('missing container', hint: flag) if op.empty?
|
|
410
410
|
op.append(escape: true, strip: /^:/)
|
|
411
411
|
when :commit
|
|
@@ -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')
|
|
@@ -1565,7 +1565,7 @@ module Squared
|
|
|
1565
1565
|
{ pat: /^(\*\s+)(\S+)(.*)$/, styles: color(:green), index: 2 },
|
|
1566
1566
|
{ pat: %r{^(\s*)(remotes/\S+)(.*)$}, styles: color(:red), index: 2 }
|
|
1567
1567
|
])
|
|
1568
|
-
list_result(ret, 'branches', from: from)
|
|
1568
|
+
list_result(ret, 'branches', banner: banner, from: from)
|
|
1569
1569
|
return
|
|
1570
1570
|
else
|
|
1571
1571
|
if (head = git_spawn('rev-parse --abbrev-ref HEAD').chomp).empty?
|
|
@@ -1719,7 +1719,7 @@ module Squared
|
|
|
1719
1719
|
out, banner, from = source(io: true)
|
|
1720
1720
|
print_item banner
|
|
1721
1721
|
ret = write_lines(out, grep: op.extras, prefix: "refs/#{flag}/")
|
|
1722
|
-
list_result(ret, flag.to_s,
|
|
1722
|
+
list_result(ret, flag.to_s, grep: op.extras, banner: banner, from: from)
|
|
1723
1723
|
end
|
|
1724
1724
|
|
|
1725
1725
|
def ls_files(flag, opts = [])
|
|
@@ -1729,7 +1729,7 @@ module Squared
|
|
|
1729
1729
|
out, banner, from = source(io: true)
|
|
1730
1730
|
print_item banner
|
|
1731
1731
|
ret = write_lines(out, grep: op.extras)
|
|
1732
|
-
list_result(ret, 'files',
|
|
1732
|
+
list_result(ret, 'files', grep: op.extras, banner: banner, from: from)
|
|
1733
1733
|
end
|
|
1734
1734
|
|
|
1735
1735
|
def git(flag, opts = [])
|
|
@@ -1895,14 +1895,20 @@ module Squared
|
|
|
1895
1895
|
ret += 1
|
|
1896
1896
|
break if first
|
|
1897
1897
|
end
|
|
1898
|
-
|
|
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
|
|
1899
1905
|
ret
|
|
1900
1906
|
end
|
|
1901
1907
|
|
|
1902
|
-
def list_result(size, type, grep: [],
|
|
1908
|
+
def list_result(size, type, action: 'found', grep: [], banner: nil, from: nil)
|
|
1903
1909
|
if size == 0
|
|
1904
1910
|
puts empty_status("No #{type} were #{action}", 'grep', grep.join(', '))
|
|
1905
|
-
elsif stdout?
|
|
1911
|
+
elsif stdout? && (banner.nil? || (banner.is_a?(String) && !banner.empty?))
|
|
1906
1912
|
styles = theme.fetch(:banner, []).reject { |s| s.to_s.end_with?('!') }
|
|
1907
1913
|
styles << :bold if styles.size <= 1
|
|
1908
1914
|
puts print_footer("#{size} #{size == 1 ? type.sub(/(?:(?<!l)e)?s\z/, '') : type}",
|