squared 0.6.10 → 0.6.11
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 +27 -2
- data/lib/squared/version.rb +1 -1
- data/lib/squared/workspace/project/base.rb +10 -10
- data/lib/squared/workspace/project/git.rb +9 -11
- data/lib/squared/workspace/project/node.rb +29 -21
- data/lib/squared/workspace/project/python.rb +5 -1
- data/lib/squared/workspace/project/ruby.rb +2 -2
- data/lib/squared/workspace/project/support/class.rb +1 -1
- data/lib/squared/workspace/project/support/optionpartition.rb +15 -13
- 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: e9559cf340c4a95816cc2853417bfb3c43053cf59cdd4e4b38fac0c074f41264
|
|
4
|
+
data.tar.gz: 60d6c5b20aa58e9606402745283948393253363ed38d5f15322be5d7cbfde7d5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0b34a0a55c607060040c027b19bc16b5ad93ba1403d753c45a75edadb3086f179b1e533b4d5058787b544012e0eda60d5e1b70ed9ff26c5fda65d55fd74b5513
|
|
7
|
+
data.tar.gz: 65478734cb5d093f3abb96022479ba3aec90b7b08741f0f924c348b06466dedb0a8db9d19e7d78e2d0f7cd26c874f7ff56d387323b943baa969097f2c97f37c5
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.6.11] - 2026-03-11
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
- Git internal data calls do not write to logs.
|
|
8
|
+
|
|
9
|
+
## [0.5.22] - 2026-03-11
|
|
10
|
+
|
|
11
|
+
- Project base run command was not covered due to lack of type checking.
|
|
12
|
+
|
|
13
|
+
## [0.4.36] - 2026-03-11
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
- Python venv initialization installs setuptools when detected.
|
|
18
|
+
- Node task depend adds prod option flags when NODE_ENV=production.
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
21
|
+
|
|
22
|
+
- OptionPartition methods with escape parameter were reordered.
|
|
23
|
+
- OptionPartition methods with quote parameter were revised.
|
|
24
|
+
|
|
3
25
|
## [0.6.10] - 2025-02-23
|
|
4
26
|
|
|
5
27
|
### Added
|
|
@@ -1586,7 +1608,7 @@
|
|
|
1586
1608
|
- Rake did not set original rakefile when calling itself.
|
|
1587
1609
|
- Extended tasks were not associated to their supporting class method.
|
|
1588
1610
|
|
|
1589
|
-
## [0.1.0] - 2024-12-
|
|
1611
|
+
## [0.1.0] - 2024-12-07
|
|
1590
1612
|
|
|
1591
1613
|
### Added
|
|
1592
1614
|
|
|
@@ -1607,12 +1629,13 @@
|
|
|
1607
1629
|
- Git pull did not display colors for diff bar chart.
|
|
1608
1630
|
- Git commit did not fetch latest refs before submitting.
|
|
1609
1631
|
|
|
1610
|
-
## [0.0.12] - 2024-12-
|
|
1632
|
+
## [0.0.12] - 2024-12-01
|
|
1611
1633
|
|
|
1612
1634
|
### Added
|
|
1613
1635
|
|
|
1614
1636
|
- Changelog was created.
|
|
1615
1637
|
|
|
1638
|
+
[0.6.11]: https://github.com/anpham6/squared-ruby/releases/tag/v0.6.11
|
|
1616
1639
|
[0.6.10]: https://github.com/anpham6/squared-ruby/releases/tag/v0.6.10
|
|
1617
1640
|
[0.6.9]: https://github.com/anpham6/squared-ruby/releases/tag/v0.6.9
|
|
1618
1641
|
[0.6.8]: https://github.com/anpham6/squared-ruby/releases/tag/v0.6.8
|
|
@@ -1624,6 +1647,7 @@
|
|
|
1624
1647
|
[0.6.2]: https://github.com/anpham6/squared-ruby/releases/tag/v0.6.2
|
|
1625
1648
|
[0.6.1]: https://github.com/anpham6/squared-ruby/releases/tag/v0.6.1
|
|
1626
1649
|
[0.6.0]: https://github.com/anpham6/squared-ruby/releases/tag/v0.6.0
|
|
1650
|
+
[0.5.22]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.22
|
|
1627
1651
|
[0.5.21]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.21
|
|
1628
1652
|
[0.5.20]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.20
|
|
1629
1653
|
[0.5.19]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.19
|
|
@@ -1646,6 +1670,7 @@
|
|
|
1646
1670
|
[0.5.2]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.2-ruby
|
|
1647
1671
|
[0.5.1]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.1-ruby
|
|
1648
1672
|
[0.5.0]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.0-ruby
|
|
1673
|
+
[0.4.36]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.36
|
|
1649
1674
|
[0.4.35]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.35
|
|
1650
1675
|
[0.4.34]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.34
|
|
1651
1676
|
[0.4.33]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.33
|
data/lib/squared/version.rb
CHANGED
|
@@ -251,7 +251,7 @@ module Squared
|
|
|
251
251
|
print_error e
|
|
252
252
|
end
|
|
253
253
|
log[:progname] ||= @name
|
|
254
|
-
env('LOG_LEVEL', ignore: false) { |
|
|
254
|
+
env('LOG_LEVEL', ignore: false) { |s| log[:level] = s.start_with?(/\d/) ? log_sym(s.to_i) : s }
|
|
255
255
|
log.delete(:file)
|
|
256
256
|
@log = [file, log]
|
|
257
257
|
end
|
|
@@ -521,7 +521,7 @@ module Squared
|
|
|
521
521
|
args[0] = instance_eval(&blk) || f
|
|
522
522
|
return unless args.first
|
|
523
523
|
end
|
|
524
|
-
if args.all?
|
|
524
|
+
if args.all?(Array)
|
|
525
525
|
cmd = []
|
|
526
526
|
var = {}
|
|
527
527
|
args.each do |val|
|
|
@@ -841,7 +841,7 @@ module Squared
|
|
|
841
841
|
ensure
|
|
842
842
|
if dir
|
|
843
843
|
remove_entry dir
|
|
844
|
-
elsif delete && file
|
|
844
|
+
elsif delete && file.exist?
|
|
845
845
|
file.unlink
|
|
846
846
|
end
|
|
847
847
|
end
|
|
@@ -1323,17 +1323,17 @@ module Squared
|
|
|
1323
1323
|
s += "#{indent || (last && data[final].last == context) ? ' ' : a} "
|
|
1324
1324
|
k += 1
|
|
1325
1325
|
end
|
|
1326
|
-
s
|
|
1326
|
+
s + "#{j ? d : c}#{b * 3} #{tag.call(proj)}"
|
|
1327
1327
|
end
|
|
1328
1328
|
end
|
|
1329
1329
|
if order
|
|
1330
1330
|
n = order.size
|
|
1331
1331
|
order[name] ||= if proj.parent
|
|
1332
|
-
if order[
|
|
1333
|
-
order[
|
|
1332
|
+
if order[key = proj.parent.name]
|
|
1333
|
+
order[key] += 1
|
|
1334
1334
|
n.pred
|
|
1335
1335
|
else
|
|
1336
|
-
order[
|
|
1336
|
+
order[key] = n.succ
|
|
1337
1337
|
n
|
|
1338
1338
|
end
|
|
1339
1339
|
else
|
|
@@ -2260,7 +2260,7 @@ module Squared
|
|
|
2260
2260
|
ret = []
|
|
2261
2261
|
if data[:command]
|
|
2262
2262
|
ret[0] = data[:command]
|
|
2263
|
-
ret[1] = data[:opts] unless
|
|
2263
|
+
ret[1] = data[:opts] unless noopt
|
|
2264
2264
|
ret[3] = data[:args]
|
|
2265
2265
|
elsif data[:script]
|
|
2266
2266
|
ret[1] = data[:script]
|
|
@@ -2269,7 +2269,7 @@ module Squared
|
|
|
2269
2269
|
else
|
|
2270
2270
|
ret[0] = false
|
|
2271
2271
|
end
|
|
2272
|
-
ret[2] = data[:env] unless
|
|
2272
|
+
ret[2] = data[:env] unless noenv
|
|
2273
2273
|
ret
|
|
2274
2274
|
end
|
|
2275
2275
|
self.global = global
|
|
@@ -2277,7 +2277,7 @@ module Squared
|
|
|
2277
2277
|
when Hash
|
|
2278
2278
|
@output = parse.call(data)
|
|
2279
2279
|
when Enumerable
|
|
2280
|
-
@output = if cmd.all?
|
|
2280
|
+
@output = if cmd.all?(Hash)
|
|
2281
2281
|
noopt = false
|
|
2282
2282
|
noenv = false
|
|
2283
2283
|
cmd.map { |data| parse.call(data) }
|
|
@@ -426,7 +426,7 @@ module Squared
|
|
|
426
426
|
end
|
|
427
427
|
if squash
|
|
428
428
|
found = false
|
|
429
|
-
git_spawn(
|
|
429
|
+
git_spawn('log --format=%h', stdout: false).each do |val|
|
|
430
430
|
if found
|
|
431
431
|
squash = val.chomp
|
|
432
432
|
break
|
|
@@ -1888,22 +1888,22 @@ module Squared
|
|
|
1888
1888
|
if io && banner == false
|
|
1889
1889
|
from = nil
|
|
1890
1890
|
banner = nil
|
|
1891
|
+
args = false
|
|
1891
1892
|
else
|
|
1892
|
-
if banner
|
|
1893
|
-
banner = nil unless banner? && !multiple
|
|
1894
|
-
args = true
|
|
1895
|
-
end
|
|
1896
1893
|
if from == false
|
|
1897
1894
|
from = nil
|
|
1898
1895
|
elsif !from && cmd.respond_to?(:drop)
|
|
1899
1896
|
from = cmd.drop(1).find { |val| val.match?(/\A[a-z]{1,2}[a-z-]*\z/) }
|
|
1900
1897
|
from &&= :"git:#{from}"
|
|
1901
1898
|
end
|
|
1902
|
-
|
|
1899
|
+
if banner
|
|
1900
|
+
banner = cmd.temp { |val| val.start_with?(/--(work-tree|git-dir)/) } if cmd.respond_to?(:temp)
|
|
1901
|
+
args = true
|
|
1902
|
+
end
|
|
1903
1903
|
end
|
|
1904
1904
|
cmd = session_done cmd
|
|
1905
|
-
log&.info cmd
|
|
1906
|
-
banner = if banner
|
|
1905
|
+
log&.info cmd unless args == false
|
|
1906
|
+
banner = if banner && banner? && !multiple
|
|
1907
1907
|
format_banner(banner.is_a?(String) ? banner : cmd, hint: hint, strip: true)
|
|
1908
1908
|
end
|
|
1909
1909
|
on :first, from
|
|
@@ -2122,9 +2122,7 @@ module Squared
|
|
|
2122
2122
|
|
|
2123
2123
|
def append_message(val = nil, target: @session)
|
|
2124
2124
|
val = messageopt if val.to_s.empty?
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
target << quote_option('message', val)
|
|
2125
|
+
target << quote_option('message', val) if val
|
|
2128
2126
|
end
|
|
2129
2127
|
|
|
2130
2128
|
def append_head(val = nil, target: @session)
|
|
@@ -529,31 +529,36 @@ module Squared
|
|
|
529
529
|
run(target.temp(*remove).sub!(/ (?:add|install) /, ' remove '), from: :remove, sync: sync)
|
|
530
530
|
end
|
|
531
531
|
if (yarn = dependtype(:yarn)) > 0
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
if yarn == 1
|
|
535
|
-
cmd << '--ignore-engines' unless option('ignore-engines', equals: '0')
|
|
536
|
-
cmd << '--ignore-scripts' if option('ignore-scripts')
|
|
537
|
-
cmd << '--force' if option('force')
|
|
532
|
+
if !flag && yarn > 1 && prod?
|
|
533
|
+
cmd = session 'yarn', 'workspaces focus --all --production'
|
|
538
534
|
else
|
|
539
|
-
cmd
|
|
540
|
-
cmd << '--check-cache' if !flag && option('force')
|
|
541
|
-
end
|
|
542
|
-
if nolockfile?('yarn')
|
|
543
|
-
cmd << '--no-lockfile'
|
|
544
|
-
elsif option('ci')
|
|
535
|
+
cmd = session('yarn', flag || 'install')
|
|
545
536
|
if yarn == 1
|
|
546
|
-
cmd << '--
|
|
547
|
-
|
|
548
|
-
cmd << '--
|
|
537
|
+
cmd << '--production' if prod?
|
|
538
|
+
cmd << '--ignore-engines' unless option('ignore-engines', equals: '0')
|
|
539
|
+
cmd << '--ignore-scripts' if option('ignore-scripts')
|
|
540
|
+
cmd << '--force' if option('force')
|
|
541
|
+
else
|
|
542
|
+
cmd << '--mode=skip-build' if option('ignore-scripts')
|
|
543
|
+
cmd << '--check-cache' if !flag && option('force')
|
|
544
|
+
end
|
|
545
|
+
if nolockfile?('yarn')
|
|
546
|
+
cmd << '--no-lockfile'
|
|
547
|
+
elsif option('ci')
|
|
548
|
+
if yarn == 1
|
|
549
|
+
cmd << '--frozen-lockfile'
|
|
550
|
+
elsif !flag
|
|
551
|
+
cmd << '--immutable' << '--refresh-lockfile'
|
|
552
|
+
end
|
|
553
|
+
end
|
|
554
|
+
if add
|
|
555
|
+
cmd << '-W' if yarn == 1 && !option('w', 'ignore-workspace-root-check', equals: '0')
|
|
556
|
+
rm.call(cmd)
|
|
557
|
+
om.call(cmd)
|
|
558
|
+
cmd << '--exact' if exact
|
|
549
559
|
end
|
|
550
560
|
end
|
|
551
|
-
|
|
552
|
-
cmd << '-W' if yarn == 1 && !option('w', 'ignore-workspace-root-check', equals: '0')
|
|
553
|
-
rm.call(cmd)
|
|
554
|
-
om.call(cmd)
|
|
555
|
-
cmd << '--exact' if exact
|
|
556
|
-
end
|
|
561
|
+
append_loglevel
|
|
557
562
|
elsif pnpm?
|
|
558
563
|
cmd = session('pnpm', flag || 'install')
|
|
559
564
|
append_nocolor
|
|
@@ -564,6 +569,7 @@ module Squared
|
|
|
564
569
|
cmd << '--save-exact' if exact
|
|
565
570
|
option('allow-build') { |val| cmd << quote_option('allow-build', val) }
|
|
566
571
|
else
|
|
572
|
+
cmd << '--prod' if prod?
|
|
567
573
|
append_platform
|
|
568
574
|
end
|
|
569
575
|
option('public-hoist-pattern') do |val|
|
|
@@ -588,6 +594,8 @@ module Squared
|
|
|
588
594
|
if omit
|
|
589
595
|
cmd << "--omit=#{save || omit}"
|
|
590
596
|
save = nil
|
|
597
|
+
elsif !add && prod?
|
|
598
|
+
cmd << '--include=prod'
|
|
591
599
|
end
|
|
592
600
|
unless ci
|
|
593
601
|
if add
|
|
@@ -1074,7 +1074,11 @@ module Squared
|
|
|
1074
1074
|
.clear(pass: false)
|
|
1075
1075
|
.arg?(/\A-v+\z/)
|
|
1076
1076
|
ret = run(op, env, exception: true, banner: banner)
|
|
1077
|
-
|
|
1077
|
+
if poetry?
|
|
1078
|
+
pip(:install, 'poetry', banner: false)
|
|
1079
|
+
elsif setuptools?
|
|
1080
|
+
pip(:install, 'setuptools', 'wheel', banner: false)
|
|
1081
|
+
end
|
|
1078
1082
|
success?(ret, banner, !status) { |out| puts(out && dir.directory? ? "Success: #{dir}" : 'Failed') }
|
|
1079
1083
|
end
|
|
1080
1084
|
|
|
@@ -812,7 +812,7 @@ module Squared
|
|
|
812
812
|
`rvm current`[/^\S+/, 0]
|
|
813
813
|
when 'rbenv'
|
|
814
814
|
name = `rbenv version-name`
|
|
815
|
-
name
|
|
815
|
+
(name =~ SEM_VER) == 0 ? "ruby #{name}" : name
|
|
816
816
|
when 'chruby.sh'
|
|
817
817
|
chruby = session_output 'source', val
|
|
818
818
|
`#{chruby.with('ruby --version')}`
|
|
@@ -1654,7 +1654,7 @@ module Squared
|
|
|
1654
1654
|
def unpack_get(tag, ext)
|
|
1655
1655
|
return super unless ext == 'gem'
|
|
1656
1656
|
|
|
1657
|
-
"https://rubygems.org/downloads/#{
|
|
1657
|
+
"https://rubygems.org/downloads/#{tag.sub_ext('.gem')}"
|
|
1658
1658
|
end
|
|
1659
1659
|
|
|
1660
1660
|
def preopts
|
|
@@ -27,7 +27,7 @@ module Squared
|
|
|
27
27
|
def multiple=(val)
|
|
28
28
|
case val
|
|
29
29
|
when Enumerable
|
|
30
|
-
@multiple.concat(val.to_a.map { |
|
|
30
|
+
@multiple.concat(val.to_a.map { |pat| pat.is_a?(Regexp) ? pat : pat.to_s })
|
|
31
31
|
when String, Symbol, Pathname
|
|
32
32
|
@multiple << val.to_s
|
|
33
33
|
when Regexp
|
|
@@ -48,10 +48,10 @@ module Squared
|
|
|
48
48
|
ret.map! do |val|
|
|
49
49
|
next val if opt?(val)
|
|
50
50
|
|
|
51
|
-
if
|
|
52
|
-
shell_quote(val, force: force, double: double)
|
|
53
|
-
elsif escape
|
|
51
|
+
if !(pa = val.is_a?(Pathname)) && escape
|
|
54
52
|
shell_escape(val, quote: quote, double: double)
|
|
53
|
+
elsif quote || pa
|
|
54
|
+
shell_quote(val, force: force, double: double)
|
|
55
55
|
else
|
|
56
56
|
val
|
|
57
57
|
end
|
|
@@ -336,7 +336,7 @@ module Squared
|
|
|
336
336
|
push opt
|
|
337
337
|
skip = true if args
|
|
338
338
|
end
|
|
339
|
-
skip = true if first&.any? { |
|
|
339
|
+
skip = true if first&.any? { |pat| pat.is_a?(Regexp) ? opt.match?(pat) : !opt.include?(pat) }
|
|
340
340
|
end
|
|
341
341
|
end
|
|
342
342
|
@values = @values.empty? ? /\A\s+\z/ : /\A(#{@values.join('|')})#{sep}(.+)\z/m
|
|
@@ -361,7 +361,8 @@ module Squared
|
|
|
361
361
|
self
|
|
362
362
|
end
|
|
363
363
|
|
|
364
|
-
def append_any(*args, escape: false,
|
|
364
|
+
def append_any(*args, escape: false, **kwargs)
|
|
365
|
+
quote = kwargs.fetch(:quote, true)
|
|
365
366
|
(args.empty? ? extras : args.flatten).each do |val|
|
|
366
367
|
if block_given?
|
|
367
368
|
temp = val
|
|
@@ -369,7 +370,7 @@ module Squared
|
|
|
369
370
|
if val.is_a?(Array)
|
|
370
371
|
found << temp
|
|
371
372
|
k, v, q = val
|
|
372
|
-
add_option(k, v, escape: escape,
|
|
373
|
+
add_option(k, v, escape: escape, double: q == '"', merge: q == true, **kwargs)
|
|
373
374
|
next
|
|
374
375
|
end
|
|
375
376
|
end
|
|
@@ -377,10 +378,10 @@ module Squared
|
|
|
377
378
|
|
|
378
379
|
if exist?(val)
|
|
379
380
|
add_path(val, **kwargs)
|
|
380
|
-
elsif quote
|
|
381
|
-
add_quote(val, **kwargs)
|
|
382
381
|
elsif escape
|
|
383
382
|
add shell_escape(val, **kwargs)
|
|
383
|
+
elsif quote
|
|
384
|
+
add_quote(val, **kwargs)
|
|
384
385
|
else
|
|
385
386
|
add val
|
|
386
387
|
end
|
|
@@ -494,7 +495,7 @@ module Squared
|
|
|
494
495
|
|
|
495
496
|
def add_path(*args, option: nil, force: true, double: false, **kwargs)
|
|
496
497
|
if args.empty?
|
|
497
|
-
args =
|
|
498
|
+
args = grep(String)
|
|
498
499
|
found.concat(args)
|
|
499
500
|
args.map! { |val| path + val } if path
|
|
500
501
|
append(args, force: force, **kwargs)
|
|
@@ -510,6 +511,7 @@ module Squared
|
|
|
510
511
|
end
|
|
511
512
|
|
|
512
513
|
def add_quote(*args, **kwargs)
|
|
514
|
+
kwargs.delete(:quote)
|
|
513
515
|
merge(args.compact
|
|
514
516
|
.map! { |val| val == '--' || OptionPartition.opt?(val) ? val : shell_quote(val, **kwargs) })
|
|
515
517
|
self
|
|
@@ -520,8 +522,8 @@ module Squared
|
|
|
520
522
|
self
|
|
521
523
|
end
|
|
522
524
|
|
|
523
|
-
def add_first(fallback = nil, prefix: nil, path: false, escape: false,
|
|
524
|
-
|
|
525
|
+
def add_first(fallback = nil, prefix: nil, path: false, escape: false, reverse: false, expect: false,
|
|
526
|
+
**kwargs)
|
|
525
527
|
val = (reverse ? pop : shift) || fallback
|
|
526
528
|
if val
|
|
527
529
|
temp = val
|
|
@@ -529,10 +531,10 @@ module Squared
|
|
|
529
531
|
unless block_given? && !(val = yield val).is_a?(String)
|
|
530
532
|
if path
|
|
531
533
|
add_path(val, **kwargs)
|
|
532
|
-
elsif quote
|
|
533
|
-
add_quote(val, **kwargs)
|
|
534
534
|
elsif escape
|
|
535
535
|
add shell_escape(val, **kwargs)
|
|
536
|
+
elsif kwargs[:quote]
|
|
537
|
+
add_quote(val, **kwargs)
|
|
536
538
|
else
|
|
537
539
|
add val
|
|
538
540
|
end
|