squared 0.5.8 → 0.5.9
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 +26 -0
- data/lib/squared/version.rb +1 -1
- data/lib/squared/workspace/project/base.rb +3 -3
- data/lib/squared/workspace/project/docker.rb +5 -3
- data/lib/squared/workspace/project/git.rb +9 -6
- data/lib/squared/workspace/project/node.rb +38 -26
- data/lib/squared/workspace/project/ruby.rb +9 -9
- data/lib/squared/workspace/project/support/class.rb +16 -4
- 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: fb4a8d7a97fde66c49f38e36f6f4ae0325f7bf54b7e73e6c14febb5b01814cc4
|
4
|
+
data.tar.gz: 64385a46e4260b50fd1a7dbc4c69558cb9ba15324b3263a2f3d7fd4c48a23322
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8a6195350bf86b98c5dda0509b57304e69f7f2d04ebb2d16b4bc7a59f26bedd1d0f53adca066768101273270f10dac31f90c069ea9379f30ca437acaa73a134
|
7
|
+
data.tar.gz: dad1693756f55833558187af4a8d51864ca2b6387c51955720146425c58f2416102f3d0e119269c095dd159801c8a9d850a9b5c879016ba44fbd7d1766ce5cee
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,29 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [0.5.9] - 2025-10-08
|
4
|
+
|
5
|
+
### Fixed
|
6
|
+
|
7
|
+
- Git command commit did not always show files being pushed.
|
8
|
+
|
9
|
+
## [0.4.22] - 2025-10-08
|
10
|
+
|
11
|
+
### Added
|
12
|
+
|
13
|
+
- Node package managers support ENV platform options.
|
14
|
+
|
15
|
+
### Changed
|
16
|
+
|
17
|
+
- User installed Ruby is detected before system installed Ruby.
|
18
|
+
|
19
|
+
### Fixed
|
20
|
+
|
21
|
+
- Yarn classic package installs did not recognize dedupe flag.
|
22
|
+
- Node command outdated option prune called undefined method.
|
23
|
+
- OptionPartition method exist? called undefined method.
|
24
|
+
- Ruby method copy? did not perform Hash property override check.
|
25
|
+
- OptionPartition static method arg? did not detect single values.
|
26
|
+
|
3
27
|
## [0.5.8] - 2025-10-01
|
4
28
|
|
5
29
|
### Fixed
|
@@ -1083,6 +1107,7 @@
|
|
1083
1107
|
|
1084
1108
|
- Changelog was created.
|
1085
1109
|
|
1110
|
+
[0.5.9]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.9
|
1086
1111
|
[0.5.8]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.8
|
1087
1112
|
[0.5.7]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.7
|
1088
1113
|
[0.5.6]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.6
|
@@ -1092,6 +1117,7 @@
|
|
1092
1117
|
[0.5.2]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.2-ruby
|
1093
1118
|
[0.5.1]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.1-ruby
|
1094
1119
|
[0.5.0]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.0-ruby
|
1120
|
+
[0.4.22]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.22
|
1095
1121
|
[0.4.21]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.21
|
1096
1122
|
[0.4.20]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.20
|
1097
1123
|
[0.4.19]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.19
|
data/lib/squared/version.rb
CHANGED
@@ -1355,7 +1355,7 @@ module Squared
|
|
1355
1355
|
puts val unless val.empty? || (val.size == 1 && val.first.nil?)
|
1356
1356
|
end
|
1357
1357
|
|
1358
|
-
def print_banner(*lines, styles: theme[:banner], border: borderstyle,
|
1358
|
+
def print_banner(*lines, client: false, styles: theme[:banner], border: borderstyle, **)
|
1359
1359
|
pad = 0
|
1360
1360
|
if styles
|
1361
1361
|
if styles.any? { |s| s.to_s.end_with?('!') }
|
@@ -1379,14 +1379,14 @@ module Squared
|
|
1379
1379
|
(lines << sub_style(ARG[:BORDER][1] * n, styles: border)).join("\n")
|
1380
1380
|
end
|
1381
1381
|
|
1382
|
-
def print_footer(*lines, sub: nil, reverse: false, right: false, **
|
1382
|
+
def print_footer(*lines, sub: nil, reverse: false, right: false, border: borderstyle, **)
|
1383
1383
|
n = line_width lines
|
1384
1384
|
lines.map! do |val|
|
1385
1385
|
s = right ? val.rjust(n) : val.ljust(n)
|
1386
1386
|
sub&.each { |h| s = sub_style(s, **h) }
|
1387
1387
|
s
|
1388
1388
|
end
|
1389
|
-
ret = [sub_style(ARG[:BORDER][1] * n, styles:
|
1389
|
+
ret = [sub_style(ARG[:BORDER][1] * n, styles: border), *lines]
|
1390
1390
|
ret.reverse! if reverse
|
1391
1391
|
ret.join("\n")
|
1392
1392
|
end
|
@@ -251,9 +251,11 @@ module Squared
|
|
251
251
|
end
|
252
252
|
|
253
253
|
def clean(*, sync: invoked_sync?('clean'), **)
|
254
|
-
|
255
|
-
|
256
|
-
|
254
|
+
if runnable?(@clean)
|
255
|
+
super
|
256
|
+
else
|
257
|
+
image(:rm, sync: sync)
|
258
|
+
end
|
257
259
|
end
|
258
260
|
|
259
261
|
def compose(opts, flags = nil, script: false, args: nil, from: :run, **)
|
@@ -162,7 +162,7 @@ module Squared
|
|
162
162
|
add: %w[A|all e|edit f|force ignore-errors ignore-missing ignore-removal i|interactive no-all
|
163
163
|
no-ignore-removal n|dry-run p|patch pathspec-file-nul renormalize sparse u|update v|verbose
|
164
164
|
chmod=b pathspec-from-file=p].freeze,
|
165
|
-
branch: %w[a|all create-reflog i|ignore-case omit-empty q|quiet r|remotes v|verbose
|
165
|
+
branch: %w[a|all create-reflog i|ignore-case omit-empty q|quiet r|remotes v|verbose abbrev=i color=b
|
166
166
|
column=b contains=b format=q merged=b no-contains=b no-merged=b points-at=b u|set-upstream-to=b
|
167
167
|
sort=q t|track=b].freeze,
|
168
168
|
checkout: %w[l d|detach f|force ignore-other-worktrees ignore-skip-worktree-bits m|merge p|patch
|
@@ -1472,8 +1472,11 @@ module Squared
|
|
1472
1472
|
pu << '--force-with-lease' if amend
|
1473
1473
|
pu.merge(repotrack(origin, branch))
|
1474
1474
|
puts if pass
|
1475
|
+
adding = git_spawn 'diff --name-only --no-color'
|
1475
1476
|
source op
|
1476
|
-
|
1477
|
+
cached = git_spawn 'diff --cached --name-only --no-color'
|
1478
|
+
if amend || !cached.empty? || dryrun?
|
1479
|
+
puts cached if adding.empty? && !cached.empty? && banner?
|
1477
1480
|
source co
|
1478
1481
|
source pu
|
1479
1482
|
elsif banner?
|
@@ -1755,7 +1758,7 @@ module Squared
|
|
1755
1758
|
else
|
1756
1759
|
append_commit(*op.extras)
|
1757
1760
|
end
|
1758
|
-
when :add
|
1761
|
+
when :add
|
1759
1762
|
if flag == :add && !op.arg?('pathspec-from-file')
|
1760
1763
|
grep, list = op.partition { |val| OptionPartition.pattern?(val) }
|
1761
1764
|
unless grep.empty? && !list.empty?
|
@@ -1782,8 +1785,8 @@ module Squared
|
|
1782
1785
|
refs = projectmap op.extras
|
1783
1786
|
raise_error 'no source/destination' unless refs.size > 1
|
1784
1787
|
op.merge(refs)
|
1785
|
-
when :rm
|
1786
|
-
append_pathspec(op.extras, expect:
|
1788
|
+
when :rm, :clean
|
1789
|
+
append_pathspec(op.extras, expect: flag == :rm)
|
1787
1790
|
end
|
1788
1791
|
source(sync: false, stderr: true)
|
1789
1792
|
end
|
@@ -2139,7 +2142,7 @@ module Squared
|
|
2139
2142
|
end
|
2140
2143
|
|
2141
2144
|
def matchpathspec
|
2142
|
-
[/\A[^a-z\d-]+/i, %r{\A[^=\\/*]*[\\/*]}]
|
2145
|
+
[/\A[^a-z\d-]+/i, %r{\A[^=\\/*]*[\\/*]}, /\A--\z/]
|
2143
2146
|
end
|
2144
2147
|
|
2145
2148
|
def messageopt
|
@@ -6,33 +6,33 @@ module Squared
|
|
6
6
|
class Node < Git
|
7
7
|
OPT_NPM = {
|
8
8
|
common: %w[dry-run=!? include-workspace-root=!? loglevel=b workspaces=!? w|workspace=v].freeze,
|
9
|
-
install: %w[
|
10
|
-
|
11
|
-
|
12
|
-
install-strategy=b].freeze,
|
9
|
+
install: %w[package-lock-only=!? prefer-dedupe=!? cpu=b libc=b os=b].freeze,
|
10
|
+
install_base: %w[audit=! bin-links=! fund=! ignore-scripts=!? install-links=!? package-lock=!
|
11
|
+
strict-peer-deps=!? include=b install-strategy=b omit=b].freeze,
|
13
12
|
install_no: %w[audit bin-links fund package-lock].freeze,
|
14
|
-
install_as: %w[no-save save-bundle save-dev save-optional save-peer save-prod foreground-scripts=!?
|
13
|
+
install_as: %w[no-save save-bundle save-dev save-optional save-peer save-prod before=q foreground-scripts=!?
|
15
14
|
g|global=!? S|save=!? E|save-exact=!?].freeze,
|
16
15
|
run: %w[foreground-scripts=!? if-present=!? ignore-scripts=!? script-shell=p].freeze,
|
17
16
|
exec: %w[c|call=q package=b].freeze,
|
18
|
-
pack: %w[json=!? pack-destination=p].freeze
|
17
|
+
pack: %w[ignore-scripts=!? json=!? pack-destination=p].freeze
|
19
18
|
}.freeze
|
20
19
|
OPT_PNPM = {
|
21
20
|
common: %w[aggregate-output color no-color stream use-stderr C|dir=p loglevel=b w|workspace-root].freeze,
|
21
|
+
cpu: %w[cpu=b libc=b os=b].freeze,
|
22
22
|
filter: %w[fail-if-no-match changed-files-ignore-pattern=q filter=q filter-prod=q test-pattern=q].freeze,
|
23
23
|
install: %w[fix-lockfile force ignore-pnpmfile ignore-workspace lockfile-only merge-git-branch-lockfiles
|
24
|
-
no-hoist no-lockfile no-optional prefer-frozen-lockfile resolution-only
|
25
|
-
side-effects-cache side-effects-cache-readonly s|silent strict-peer-dependencies
|
24
|
+
optimistic-repeat-install no-hoist no-lockfile no-optional prefer-frozen-lockfile resolution-only
|
25
|
+
shamefully-hoist side-effects-cache side-effects-cache-readonly s|silent strict-peer-dependencies
|
26
26
|
use-running-store-server use-store-server child-concurrency=i hoist-pattern=q lockfile-dir=p
|
27
27
|
modules-dir=p network-concurrency=i package-import-method=b public-hoist-pattern=q
|
28
28
|
reporter=b].freeze,
|
29
29
|
install_base: %w[global-dir ignore-scripts offline prefer-offline store-dir=p virtual-store-dir=p].freeze,
|
30
30
|
install_no: %w[frozen-lockfile verify-store-integrity].freeze,
|
31
31
|
install_as: %w[D|dev global-dir no-optional P|prod r|recursive].freeze,
|
32
|
-
update: %w[global interactive latest depth=i].freeze,
|
32
|
+
update: %w[g|global i|interactive L|latest depth=i].freeze,
|
33
33
|
dedupe: %w[check].freeze,
|
34
|
-
run: %w[if-present no-bail parallel r|recursive report-summary reporter-hide-prefix resume-from
|
35
|
-
|
34
|
+
run: %w[if-present no-bail parallel r|recursive report-summary reporter-hide-prefix resume-from
|
35
|
+
sequential].freeze,
|
36
36
|
exec: %w[no-reporter-hide-prefix parallel r|recursive report-summary resume-from c|shell-mode].freeze,
|
37
37
|
pack: %w[json pack-destination=p pack-gzip-level=i].freeze
|
38
38
|
}.freeze
|
@@ -232,7 +232,7 @@ module Squared
|
|
232
232
|
flags.each do |flag|
|
233
233
|
case action
|
234
234
|
when 'outdated'
|
235
|
-
format_desc(action, flag, %w[
|
235
|
+
format_desc(action, flag, %w[update interactive dry-run], arg: 'opts?')
|
236
236
|
task flag do |_, args|
|
237
237
|
outdated flag, args.to_a
|
238
238
|
end
|
@@ -460,6 +460,7 @@ module Squared
|
|
460
460
|
cmd << '--save-exact' if exact
|
461
461
|
else
|
462
462
|
cmd << 'install'
|
463
|
+
append_platform
|
463
464
|
end
|
464
465
|
option('public-hoist-pattern', ignore: false) do |val|
|
465
466
|
split_escape(val).each { |opt| cmd << shell_option('public-hoist-pattern', opt) }
|
@@ -472,6 +473,8 @@ module Squared
|
|
472
473
|
cmd << "--save-#{save}"
|
473
474
|
cmd << '--save-exact' if exact
|
474
475
|
cmd.merge(packages.map { |pkg| shell_quote(pkg) })
|
476
|
+
else
|
477
|
+
append_platform
|
475
478
|
end
|
476
479
|
cmd << '--workspaces=false' if env('NODE_WORKSPACES', equals: '0')
|
477
480
|
cmd << '--package-lock=false' if option('package-lock', equals: '0')
|
@@ -621,10 +624,13 @@ module Squared
|
|
621
624
|
footer.call(modified, found.size)
|
622
625
|
elsif modified > 0
|
623
626
|
modified = -1
|
624
|
-
footer.call(0, found.size)
|
625
627
|
File.write(dependfile, doc)
|
628
|
+
if opts.include?('update') || opts.include?('u') || option('update')
|
629
|
+
update
|
630
|
+
else
|
631
|
+
footer.call(0, found.size)
|
632
|
+
end
|
626
633
|
commit(:add, refs: ['package.json'], pass: true)
|
627
|
-
install if opts.include?('prune') || opts.include?('p')
|
628
634
|
end
|
629
635
|
elsif !avail.empty?
|
630
636
|
col1 = size_col.call(avail, 0) + 4
|
@@ -650,7 +656,7 @@ module Squared
|
|
650
656
|
end
|
651
657
|
|
652
658
|
def update(*)
|
653
|
-
package(
|
659
|
+
package(:update, from: :update)
|
654
660
|
end
|
655
661
|
|
656
662
|
def publish(flag = nil, *, sync: invoked_sync?('publish', flag), otp: nil, tag: nil, access: nil, dryrun: nil)
|
@@ -694,15 +700,16 @@ module Squared
|
|
694
700
|
workspace.rev_clear(name)
|
695
701
|
if (yarn = dependtype(:yarn)) > 0
|
696
702
|
cmd = session 'yarn', if flag == :update
|
697
|
-
|
703
|
+
yarn == 1 ? 'upgrade' : 'up'
|
698
704
|
else
|
699
|
-
flag
|
705
|
+
yarn == 1 && flag == :dedupe ? 'install' : flag
|
700
706
|
end
|
701
707
|
op = OptionPartition.new(opts, if yarn == 1
|
702
|
-
OPT_YARN.fetch(flag, []) + OPT_YARN[:common]
|
708
|
+
OPT_YARN.fetch(flag == :dedupe ? :install : flag, []) + OPT_YARN[:common]
|
703
709
|
else
|
704
710
|
OPT_BERRY[flag]
|
705
711
|
end, cmd, project: self)
|
712
|
+
op << '--ignore-engines' if yarn == 1 && !option('ignore-engines', equals: '0')
|
706
713
|
op.clear
|
707
714
|
append_loglevel
|
708
715
|
else
|
@@ -710,13 +717,13 @@ module Squared
|
|
710
717
|
cmd = session 'pnpm', flag
|
711
718
|
list = OPT_PNPM[:install_base] + OPT_PNPM.fetch(flag, []) + OPT_PNPM[:common]
|
712
719
|
list.concat(OPT_PNPM[:install_as] + OPT_PNPM[:filter]) unless flag == :dedupe
|
720
|
+
list.concat(OPT_PNPM[:cpu]) unless flag == :update
|
713
721
|
no = OPT_PNPM[:"#{flag}_no"]
|
714
722
|
else
|
715
723
|
cmd = session 'npm', flag
|
716
724
|
list = OPT_NPM[:install_base] + OPT_NPM.fetch(flag, []) + OPT_NPM[:common]
|
717
725
|
list.concat(OPT_NPM[:install_as]) unless flag == :dedupe
|
718
726
|
no = OPT_NPM[:install_no]
|
719
|
-
cmd << '--save=true' if option('save')
|
720
727
|
end
|
721
728
|
op = OptionPartition.new(opts, list, cmd, no: no, project: self)
|
722
729
|
op.each do |opt|
|
@@ -732,12 +739,13 @@ module Squared
|
|
732
739
|
end
|
733
740
|
end
|
734
741
|
op.swap
|
742
|
+
append_platform if flag == :install
|
735
743
|
append_nocolor
|
736
744
|
append_loglevel
|
737
745
|
if flag == :dedupe
|
738
746
|
op.clear
|
739
747
|
else
|
740
|
-
op.append(
|
748
|
+
op.append(quote: true)
|
741
749
|
end
|
742
750
|
op.clear(errors: true)
|
743
751
|
end
|
@@ -933,6 +941,14 @@ module Squared
|
|
933
941
|
respond_to?(meth) && __send__(meth) ? @pm[prog] : 0
|
934
942
|
end
|
935
943
|
|
944
|
+
def dependbin
|
945
|
+
if yarn?
|
946
|
+
'yarn'
|
947
|
+
else
|
948
|
+
pnpm? ? 'pnpm' : 'npm'
|
949
|
+
end
|
950
|
+
end
|
951
|
+
|
936
952
|
def version
|
937
953
|
@version ||= read_packagemanager(:version)
|
938
954
|
end
|
@@ -1008,12 +1024,8 @@ module Squared
|
|
1008
1024
|
end
|
1009
1025
|
end
|
1010
1026
|
|
1011
|
-
def
|
1012
|
-
|
1013
|
-
'yarn'
|
1014
|
-
else
|
1015
|
-
pnpm? ? 'pnpm' : 'npm'
|
1016
|
-
end
|
1027
|
+
def append_platform(target: @session)
|
1028
|
+
%w[cpu os libc].each { |name| option(name) { |val| target << basic_option(name, val) } }
|
1017
1029
|
end
|
1018
1030
|
|
1019
1031
|
def dependext
|
@@ -7,8 +7,8 @@ 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? a c e=q E=bm F=qm i=bm? I=pm l n p r=bm s S w W=bm? x=pm? d|debug jit rjit verbose
|
11
|
-
backtrace-limit=i crash-report=q disable=q dump=q enable=q encoding=b external-encoding=b
|
10
|
+
ruby: %w[0=im? a c C=pm e=q E=bm F=qm i=bm? I=pm l n p r=bm s S w W=bm? x=pm? d|debug jit rjit verbose
|
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
|
14
14
|
N|no-search G|no-system nosearch nosystem rules s|silent g|system v|verbose backtrace=b?
|
@@ -472,7 +472,7 @@ module Squared
|
|
472
472
|
when :version
|
473
473
|
pwd_set do
|
474
474
|
out = []
|
475
|
-
order = { '
|
475
|
+
order = { 'rbenv' => -1, 'rvm' => -1, 'asdf' => -1, 'chruby' => -1 }
|
476
476
|
ENV.fetch('PATH', '').split(':').each_with_index do |val, index|
|
477
477
|
order.each_key do |key|
|
478
478
|
if val.match?(%r{[/.]#{key}/})
|
@@ -482,14 +482,14 @@ module Squared
|
|
482
482
|
end
|
483
483
|
end
|
484
484
|
paths = [
|
485
|
+
"#{ENV.fetch('RBENV_ROOT', '$HOME/.rbenv')}/bin/rbenv",
|
485
486
|
'$HOME/.rvm/bin/rvm',
|
487
|
+
@asdf ? "#{ENV.fetch('ASDF_DATA_DIR', '$HOME/.asdf')}/installs/#{@asdf.first}" : nil,
|
488
|
+
'/usr/bin/rbenv',
|
486
489
|
'/usr/local/rvm/bin/rvm',
|
487
490
|
'/usr/share/rvm/bin/rvm',
|
488
|
-
"#{ENV.fetch('RBENV_ROOT', '$HOME/.rbenv')}/bin/rbenv",
|
489
|
-
'/usr/bin/rbenv',
|
490
491
|
'/usr/local/share/chruby/chruby.sh'
|
491
|
-
]
|
492
|
-
paths << "#{ENV.fetch('ASDF_DATA_DIR', '$HOME/.asdf')}/installs/#{@asdf.first}" if @asdf
|
492
|
+
].compact
|
493
493
|
paths.sort do |a, b|
|
494
494
|
c = -1
|
495
495
|
d = -1
|
@@ -877,7 +877,7 @@ module Squared
|
|
877
877
|
end
|
878
878
|
|
879
879
|
def copy?
|
880
|
-
return true if
|
880
|
+
return true if @copy.is_a?(Hash) ? copy[:into] : super
|
881
881
|
return gemdir? if @gemdir
|
882
882
|
|
883
883
|
if version
|
@@ -1069,7 +1069,7 @@ module Squared
|
|
1069
1069
|
|
1070
1070
|
@gemfile = [project, name].map! { |val| basepath("#{val}.gemspec") }
|
1071
1071
|
.concat(path.glob('*.gemspec'))
|
1072
|
-
.find
|
1072
|
+
.find(&:exist?) || false
|
1073
1073
|
end
|
1074
1074
|
|
1075
1075
|
def gemlib
|
@@ -19,7 +19,8 @@ module Squared
|
|
19
19
|
include Shell
|
20
20
|
include Prompt
|
21
21
|
|
22
|
-
def append(target, *args, delim: false, escape: false, quote: true, strip: nil,
|
22
|
+
def append(target, *args, delim: false, escape: false, quote: true, strip: nil, force: true, double: false,
|
23
|
+
**)
|
23
24
|
return if (ret = args.flatten).empty?
|
24
25
|
|
25
26
|
target << '--' if delim && !target.include?('--')
|
@@ -27,7 +28,15 @@ module Squared
|
|
27
28
|
pat, s = Array(strip)
|
28
29
|
ret.map! { |val| val.gsub(pat, s || '') }
|
29
30
|
end
|
30
|
-
|
31
|
+
if escape || quote
|
32
|
+
ret.map! do |val|
|
33
|
+
if escape
|
34
|
+
shell_escape(val, quote: quote, double: double)
|
35
|
+
else
|
36
|
+
shell_quote(val, force: force, double: double)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
31
40
|
if target.is_a?(Set)
|
32
41
|
target.merge(ret)
|
33
42
|
else
|
@@ -92,7 +101,10 @@ module Squared
|
|
92
101
|
end
|
93
102
|
|
94
103
|
def matchopts(list, value = false)
|
95
|
-
a, b = list.partition { |val| val.size == 1 || val.match?(OPT_SINGLE) }
|
104
|
+
a, b = Array(list).partition { |val| val.size == 1 || val.match?(OPT_SINGLE) }
|
105
|
+
return /\A#{shortopt(*a)}}/ if b.empty?
|
106
|
+
return /\A#{longopt(*b, value)}/ if a.empty?
|
107
|
+
|
96
108
|
/\A(?:#{shortopt(*a)}|#{longopt(*b, value)})/
|
97
109
|
end
|
98
110
|
|
@@ -471,7 +483,7 @@ module Squared
|
|
471
483
|
path.join(val).exist?.tap do |ret|
|
472
484
|
next unless add && ret
|
473
485
|
|
474
|
-
|
486
|
+
add_path(first ? shift : pop)
|
475
487
|
end
|
476
488
|
else
|
477
489
|
each_with_index do |val, index|
|
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.5.
|
4
|
+
version: 0.5.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- An Pham
|
@@ -124,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
124
124
|
- !ruby/object:Gem::Version
|
125
125
|
version: '0'
|
126
126
|
requirements: []
|
127
|
-
rubygems_version: 3.
|
127
|
+
rubygems_version: 3.7.2
|
128
128
|
specification_version: 4
|
129
129
|
summary: Rake task generator for managing multi-language workspaces.
|
130
130
|
test_files: []
|