squared 0.5.21 → 0.5.23

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 422d0fe6f69fab606e4b0a218c2f4faae43fe6bb24a2e66f7e37ef2d0685019a
4
- data.tar.gz: 53761c954112ee12a3f22756a2d140b2a86db9c6a0f6113ea05a3aa32f95f52a
3
+ metadata.gz: 45a01f6cbe5a1aac8bb8569a17d8e1367e2b31bb4cd38ed3be1a406462983f48
4
+ data.tar.gz: 5380204c9a5c8e411448b437b67f037d89ac30a6835158dfbaad3e704bef9739
5
5
  SHA512:
6
- metadata.gz: 46c2e2f4a935003a2a773e157760b928d23445e57a1d2c4663eae322ac02b3f3b96091a1e122457c91621b7693199cb1f15f1ebea0f5349f8f536b1ac4cc3d06
7
- data.tar.gz: 79e1beaddef54cad59db12a5ca864babe97933636f129f9797338d710bc0d928f38c1beb5882028a87670ea6aec217646ffafd6227ca7bd6b106ed77557f8f69
6
+ metadata.gz: 168617a435a76d164f939965060d5e75fe7d3e4195fc09b6dce3870397df137c0760d2a99c599bcb05df65a1d78f184d9bb8e1df6de761a70f9a344c7950ba31
7
+ data.tar.gz: 3c825837cb557a12c4df649833340d26add03f391ebbd382afee1dcbf7d2971f538588af7c08b39494d6b76e2c7202d1e7a974339ba68b4fa4f4720ebab64b79
data/CHANGELOG.md CHANGED
@@ -1,5 +1,48 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.5.23] - 2026-04-29
4
+
5
+ ### Fixed
6
+
7
+ - See `0.4.37`.
8
+
9
+ ## [0.4.37] - 2026-04-29
10
+
11
+ ### Changed
12
+
13
+ - Project base method dependindex replaces private instance variable.
14
+
15
+ ### Fixed
16
+
17
+ - Ruby command version did not abort asdf "Not installed" error.
18
+ - Git command pull action all did not pass option flags to branches.
19
+ - Python command exec did not activate virtual environment.
20
+ - Docker command bake did not reinsert failed check for context directory.
21
+ - Common method shell_quote argument preserve did not bypass requoting.
22
+
23
+ ## [0.5.22] - 2026-03-11
24
+
25
+ ### Fixed
26
+
27
+ - Project base run command was not covered due to lack of type checking.
28
+
29
+ ## [0.4.36] - 2026-03-11
30
+
31
+ ### Added
32
+
33
+ - Python venv initialization installs setuptools when detected.
34
+ - Node task depend adds prod option flags when NODE_ENV=production.
35
+
36
+ ### Changed
37
+
38
+ - Application method with using hide and pass compatibility was implemented.
39
+
40
+ ### Fixed
41
+
42
+ - Docker task clean does not run in parallel without ENV override.
43
+ - OptionPartition methods with escape parameter were reordered.
44
+ - OptionPartition methods with quote parameter were revised.
45
+
3
46
  ## [0.5.21] - 2025-12-31
4
47
 
5
48
  ### Fixed
@@ -1324,7 +1367,7 @@
1324
1367
  - Rake did not set original rakefile when calling itself.
1325
1368
  - Extended tasks were not associated to their supporting class method.
1326
1369
 
1327
- ## [0.1.0] - 2024-12-7
1370
+ ## [0.1.0] - 2024-12-07
1328
1371
 
1329
1372
  ### Added
1330
1373
 
@@ -1345,12 +1388,14 @@
1345
1388
  - Git pull did not display colors for diff bar chart.
1346
1389
  - Git commit did not fetch latest refs before submitting.
1347
1390
 
1348
- ## [0.0.12] - 2024-12-1
1391
+ ## [0.0.12] - 2024-12-01
1349
1392
 
1350
1393
  ### Added
1351
1394
 
1352
1395
  - Changelog was created.
1353
1396
 
1397
+ [0.5.23]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.23
1398
+ [0.5.22]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.22
1354
1399
  [0.5.21]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.21
1355
1400
  [0.5.20]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.20
1356
1401
  [0.5.19]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.19
@@ -1373,6 +1418,8 @@
1373
1418
  [0.5.2]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.2-ruby
1374
1419
  [0.5.1]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.1-ruby
1375
1420
  [0.5.0]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.0-ruby
1421
+ [0.4.37]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.37
1422
+ [0.4.36]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.36
1376
1423
  [0.4.35]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.35
1377
1424
  [0.4.34]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.34
1378
1425
  [0.4.33]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.33
@@ -188,7 +188,9 @@ module Squared
188
188
  end
189
189
  if hint.nil? ? args.size > 1 : !hint
190
190
  title = log_title(level, color: false)
191
- sub = [pat: /\A(#{Regexp.escape(title)})(.*)\z/m, styles: __get__(:theme)[:logger][log_sym(level)]] if color
191
+ if color
192
+ sub = [{ pat: /\A(#{Regexp.escape(title)})(.*)\z/m, styles: __get__(:theme)[:logger][log_sym(level)] }]
193
+ end
192
194
  emphasize(args, title: title + (subject ? " #{subject}" : ''), sub: sub, pipe: -1)
193
195
  else
194
196
  msg = [log_title(level, color: color)]
@@ -239,6 +241,8 @@ module Squared
239
241
  lines = val.to_s.lines(chomp: true)
240
242
  lines[0] = "#{val.class}: #{lines.first}" if (err = val.is_a?(::StandardError))
241
243
  end
244
+ return if lines.empty?
245
+
242
246
  n = cols || max.call(lines)
243
247
  if $stdout.tty?
244
248
  require 'io/console'
@@ -48,7 +48,7 @@ module Squared
48
48
  end
49
49
  end
50
50
 
51
- def shell_quote(val, option: true, force: true, double: false, preserve: true, override: false)
51
+ def shell_quote(val, option: true, force: true, double: false, preserve: true, pass: false, override: false)
52
52
  val = val.to_s
53
53
  return val if (!force && !val.include?(' ')) || val.empty?
54
54
 
@@ -56,16 +56,16 @@ module Squared
56
56
  pat = /\A(?:-[^=\s-](?:=|\s+)?|(--)?[^=\s-][^=\s]*(?(1)(?:=|\s+)|=))(["']).+\2\z/m
57
57
  return val if val.match?(pat)
58
58
  end
59
- q = ->(s) { s.gsub("'\\\\''", "'") }
60
59
  if val =~ QUOTE_VALUE
61
- return val if $1 == '"' && Rake::Win32.windows? && val.match?(/(?:[#{File::SEPARATOR} ]|\\")/o)
60
+ return val if pass || ($1 == '"' && Rake::Win32.windows? && val.match?(/(?:[#{File::SEPARATOR} ]|\\")/o))
62
61
 
63
62
  base = $2 unless preserve
64
63
  end
64
+ q = -> { (base || val).gsub("'\\\\''", "'") }
65
65
  if double || Rake::Win32.windows? || (ARG[:QUOTE] == '"' && !override)
66
- "\"#{q.call(base || val).gsub(/(?<!\\)"/, '\\"')}\""
66
+ "\"#{q.call.gsub(/(?<!\\)"/, '\\"')}\""
67
67
  else
68
- base ? val : "'#{q.call(val).gsub("'", "'\\\\''")}'"
68
+ "'#{q.call.gsub("'", "'\\\\''")}'"
69
69
  end
70
70
  end
71
71
 
@@ -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 && name == :system
28
+ return ret unless e && !ret
28
29
 
29
30
  raise $?.to_s
30
31
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Squared
4
- VERSION = '0.5.21'
4
+ VERSION = '0.5.23'
5
5
  end
@@ -178,8 +178,25 @@ module Squared
178
178
  self
179
179
  end
180
180
 
181
- def with(*val, pass: false, group: nil, **kwargs, &blk)
182
- return self if pass == true || (pass && as_a(pass, :to_s).any? { |s| respond_to?(s) && __send__(s) rescue nil })
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
@@ -817,7 +834,7 @@ module Squared
817
834
  ' (sync)'
818
835
  end}"
819
836
  emphasize(grp, title: title, cols: [cols, title.size].max, border: theme[:border],
820
- sub: [pat: /\A(Step \d+)(.*)\z/, styles: theme[:header]])
837
+ sub: [{ pat: /\A(Step \d+)(.*)\z/, styles: theme[:header] }])
821
838
  end
822
839
  end
823
840
  end
@@ -499,7 +499,7 @@ module Squared
499
499
  args[0] = instance_eval(&blk) || f
500
500
  return unless args.first
501
501
  end
502
- if args.all? { |val| val.is_a?(Array) }
502
+ if args.all?(Array)
503
503
  cmd = []
504
504
  var = {}
505
505
  args.each do |val|
@@ -886,7 +886,7 @@ module Squared
886
886
  end
887
887
 
888
888
  def run(cmd = @session, var = nil, exception: self.exception, sync: true, from: nil, banner: true, chdir: path,
889
- interactive: nil, hint: nil, series: true, **)
889
+ interactive: nil, hint: nil, series: true, send: :system, **)
890
890
  unless cmd
891
891
  print_error('no command session started', subject: project, hint: from, pass: true)
892
892
  return
@@ -923,7 +923,7 @@ module Squared
923
923
  end
924
924
  end
925
925
  args = var.is_a?(Hash) ? [var, cmd] : [cmd]
926
- ret = shell(*args, chdir: chdir, exception: exception)
926
+ ret = shell(*args, name: send, chdir: chdir, exception: exception)
927
927
  end
928
928
  rescue StandardError => e
929
929
  on_error(e, from, exception: true)
@@ -982,7 +982,7 @@ module Squared
982
982
  run_set(output[0], *args, **kwargs)
983
983
  when :dependfile
984
984
  @dependindex = nil
985
- @dependfile = val.nil? ? nil : basepath(*args)
985
+ @dependfile = (basepath(*args) if val)
986
986
  else
987
987
  instance_variable_set(:"@#{key}", val)
988
988
  end
@@ -1080,7 +1080,7 @@ module Squared
1080
1080
  end
1081
1081
 
1082
1082
  def dependtype(*)
1083
- @dependindex ? @dependindex.succ : 0
1083
+ dependindex&.succ || 0
1084
1084
  end
1085
1085
 
1086
1086
  def log
@@ -1184,6 +1184,8 @@ module Squared
1184
1184
  else
1185
1185
  items = check.call(data[start])
1186
1186
  end
1187
+ return done if items.empty?
1188
+
1187
1189
  if out
1188
1190
  a, b, c, d, e = ARG[:GRAPH]
1189
1191
  f = tag.call(target)
@@ -1950,7 +1952,7 @@ module Squared
1950
1952
  ret = []
1951
1953
  if data[:command]
1952
1954
  ret[0] = data[:command]
1953
- ret[1] = data[:opts] unless diso
1955
+ ret[1] = data[:opts] unless noopt
1954
1956
  ret[3] = data[:args]
1955
1957
  elsif data[:script]
1956
1958
  ret[1] = data[:script]
@@ -1959,12 +1961,12 @@ module Squared
1959
1961
  else
1960
1962
  ret[0] = false
1961
1963
  end
1962
- ret[2] = data[:env] unless dise
1964
+ ret[2] = data[:env] unless noenv
1963
1965
  ret
1964
1966
  end
1965
1967
  case cmd
1966
1968
  when Array
1967
- @output = if cmd.all? { |data| data.is_a?(Hash) }
1969
+ @output = if cmd.all?(Hash)
1968
1970
  noopt = false
1969
1971
  noenv = false
1970
1972
  cmd.map { |data| parse.call(data) }
@@ -2057,10 +2059,21 @@ module Squared
2057
2059
  end
2058
2060
  end
2059
2061
 
2060
- def dependfile_set(list)
2061
- @dependindex = list.index { |file| basepath(file).exist? }.tap do |index|
2062
- @dependfile = basepath(list[index || 0])
2063
- end
2062
+ def dependfile_set(list, default: 0)
2063
+ @dependindex = if @dependname
2064
+ @dependfile = basepath @dependname
2065
+ list.index(@dependname)
2066
+ else
2067
+ list.index { |file| basepath(file).exist? }.tap do |i|
2068
+ @dependfile = basepath(list[i || default])
2069
+ end
2070
+ end || (list unless enabled?)
2071
+ end
2072
+
2073
+ def dependindex
2074
+ dependfile_set @dependindex if @dependindex.is_a?(Array)
2075
+
2076
+ @dependindex unless @dependindex.is_a?(Array)
2064
2077
  end
2065
2078
 
2066
2079
  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|b env-file=p f|file=p parallel=n profile=b progress=b
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
- else
258
- image(:rm, sync: sync)
257
+ elsif sync || option('y', prefix: 'docker')
258
+ image :rm
259
259
  end
260
260
  end
261
261
 
@@ -335,7 +335,7 @@ module Squared
335
335
  if projectpath?(val = args.pop)
336
336
  context = val
337
337
  else
338
- op.push(val)
338
+ args << val
339
339
  end
340
340
  end
341
341
  op.append(args, escape: true, strip: /^:/)
@@ -984,12 +984,8 @@ module Squared
984
984
  printsucc
985
985
  end
986
986
  op = OptionPartition.new(opts, OPT_GIT[:pull], cmd, project: self, no: OPT_GIT[:no][:pull])
987
- reg = if op.empty?
988
- []
989
- else
990
- opts = op.uniq(opts)
991
- matchmap op
992
- end
987
+ opts -= op.extras
988
+ reg = matchmap op
993
989
  session_done op.target
994
990
  heads = []
995
991
  cur = nil
@@ -1187,7 +1183,7 @@ module Squared
1187
1183
  { pat: /^(## )((?~\.{3}))(\.{3})(.+)$/, styles: [nil, g, nil, r], index: -1 }
1188
1184
  ]
1189
1185
  else
1190
- [pat: /^(\t+)([a-z]+: +.+)$/, styles: r, index: 2]
1186
+ [{ pat: /^(\t+)([a-z]+: +.+)$/, styles: r, index: 2 }]
1191
1187
  end
1192
1188
  end
1193
1189
  out, banner, from = source(io: true)
@@ -1910,7 +1906,7 @@ module Squared
1910
1906
  styles = theme.fetch(:banner, []).reject { |s| s.to_s.end_with?('!') }
1911
1907
  styles << :bold if styles.size <= 1
1912
1908
  puts print_footer("#{size} #{size == 1 ? type.sub(/(?:(?<!l)e)?s\z/, '') : type}",
1913
- sub: [pat: /^(\d+)(.+)$/, styles: styles])
1909
+ sub: [{ pat: /^(\d+)(.+)$/, styles: styles }])
1914
1910
  end
1915
1911
  on :last, from
1916
1912
  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=!? loglevel=b workspaces=!? w|workspace=v].freeze,
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,
@@ -435,13 +435,18 @@ module Squared
435
435
 
436
436
  if (yarn = dependtype(:yarn)) > 0
437
437
  cmd = session 'yarn'
438
- if flag == :add
438
+ if !flag && yarn > 1 && prod?
439
+ cmd << 'workspaces focus --all --production'
440
+ elsif flag == :add
439
441
  cmd << 'add'
440
442
  cmd << "--#{save}" unless save == 'prod'
441
443
  cmd << '--exact' if exact
442
444
  else
443
445
  cmd << 'install'
444
- cmd << '--ignore-engines' if yarn == 1 && !option('ignore-engines', equals: '0')
446
+ if yarn == 1
447
+ cmd << '--production' if prod?
448
+ cmd << '--ignore-engines' unless option('ignore-engines', equals: '0')
449
+ end
445
450
  end
446
451
  elsif pnpm?
447
452
  cmd = session 'pnpm'
@@ -451,6 +456,7 @@ module Squared
451
456
  option('allow-build') { |val| cmd << quote_option('allow-build', val) }
452
457
  else
453
458
  cmd << 'install'
459
+ cmd << '--prod' if prod?
454
460
  append_platform
455
461
  end
456
462
  option('public-hoist-pattern') do |val|
@@ -465,6 +471,7 @@ module Squared
465
471
  cmd << "--save-#{save}"
466
472
  cmd << '--save-exact' if exact
467
473
  else
474
+ cmd << '--include=prod' if prod?
468
475
  append_platform
469
476
  end
470
477
  cmd << '--workspaces=false' if env('NODE_WORKSPACES', equals: '0')
@@ -693,8 +700,9 @@ module Squared
693
700
  pwd_set(from: from, dryrun: dryrun) do
694
701
  cmd = session_done cmd
695
702
  Open3.popen2e(cmd) do |_, out|
696
- write_lines(out, banner: format_banner(cmd),
697
- sub: npmnotice + [pat: /^(.+)(Tarball .+)$/, styles: color(:bright_blue), index: 2])
703
+ write_lines(out,
704
+ banner: format_banner(cmd),
705
+ sub: npmnotice + [{ pat: /^(.+)(Tarball .+)$/, styles: color(:bright_blue), index: 2 }])
698
706
  end
699
707
  end
700
708
  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 DEP_PYTHON
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
- shell(cmd, name: :exec, chdir: path)
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(' ')
@@ -896,7 +896,11 @@ module Squared
896
896
  .clear(pass: false)
897
897
  .arg?(/\A-v+\z/)
898
898
  run(op, env, exception: true, banner: banner)
899
- install(:upgrade, ['poetry']) if poetry?
899
+ if poetry?
900
+ install(:upgrade, ['poetry'])
901
+ elsif setuptools?
902
+ install(:upgrade, ['setuptools', 'wheel'])
903
+ end
900
904
  puts(dir.directory? ? "Success: #{dir}" : 'Failed') if banner && !status
901
905
  end
902
906
 
@@ -537,7 +537,7 @@ module Squared
537
537
  `rvm current`[/^\S+/, 0]
538
538
  when 'rbenv'
539
539
  `rbenv version-name`.yield_self do |name|
540
- name.match?(SEM_VER) ? "ruby #{name}" : name
540
+ (name =~ SEM_VER) == 0 ? "ruby #{name}" : name
541
541
  end
542
542
  when 'chruby.sh'
543
543
  chruby = session_output 'source', val
@@ -548,7 +548,8 @@ module Squared
548
548
  ver = '.tool-versions'
549
549
  opt = [@asdf.first]
550
550
  opt.unshift('--no-header') unless @@asdf[1] == 15
551
- `asdf current #{opt.join(' ')}`[/^\S+\s+\S+/, 0].sub(/\s+/, ' ')
551
+ exit 1 unless (cur = `asdf current #{opt.join(' ')}`[/^\S+\s+\S+/, 0])
552
+ cur.sub(/\s+/, ' ')
552
553
  else
553
554
  ver = nil
554
555
  `ruby --version`
@@ -806,7 +807,7 @@ module Squared
806
807
  else
807
808
  op.clear
808
809
  end
809
- elsif (n = op.index { |val| val.match?(/(\A|[a-z])@\d/) })
810
+ elsif (n = op.index { |val| val.match?(/(\A|[\w.-])@\d/) })
810
811
  name = op.delete_at(n)
811
812
  pre, ver = if (n = name.index('@')) == 0
812
813
  [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 quote || val.is_a?(Pathname)
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, quote: true, **kwargs)
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
@@ -427,6 +430,7 @@ module Squared
427
430
  end
428
431
 
429
432
  def add_quote(*args, **kwargs)
433
+ kwargs.delete(:quote)
430
434
  args.compact!
431
435
  merge(args.map! { |val| val == '--' || OptionPartition.opt?(val) ? val : shell_quote(val, **kwargs) })
432
436
  self
@@ -443,10 +447,12 @@ module Squared
443
447
  elsif exclude.first.is_a?(Symbol)
444
448
  partition(&exclude.first)
445
449
  else
450
+ exclude.map! { |pat| Regexp.new(pat) }
446
451
  partition do |val|
447
- next false if pattern && OptionPartition.pattern?(val)
452
+ val = val.to_s
453
+ next if pattern && OptionPartition.pattern?(val)
448
454
 
449
- exclude.none? { |pat| val.match?(Regexp.new(pat)) }
455
+ exclude.none? { |pat| val.match?(pat) }
450
456
  end
451
457
  end
452
458
  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.5.21
4
+ version: 0.5.23
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: 4.0.3
127
+ rubygems_version: 4.0.6
128
128
  specification_version: 4
129
129
  summary: Rake task generator for managing multi-language workspaces.
130
130
  test_files: []