squared 0.5.23 → 0.5.25

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: 45a01f6cbe5a1aac8bb8569a17d8e1367e2b31bb4cd38ed3be1a406462983f48
4
- data.tar.gz: 5380204c9a5c8e411448b437b67f037d89ac30a6835158dfbaad3e704bef9739
3
+ metadata.gz: e0cd4ff3d9faafb78e2d7f13560866b4db396f766f06c4dd0def6e228fbb3b28
4
+ data.tar.gz: 8e30a7002e81361a7554a232cee8483f1ecc99e4920431dc60242595ff4b8a15
5
5
  SHA512:
6
- metadata.gz: 168617a435a76d164f939965060d5e75fe7d3e4195fc09b6dce3870397df137c0760d2a99c599bcb05df65a1d78f184d9bb8e1df6de761a70f9a344c7950ba31
7
- data.tar.gz: 3c825837cb557a12c4df649833340d26add03f391ebbd382afee1dcbf7d2971f538588af7c08b39494d6b76e2c7202d1e7a974339ba68b4fa4f4720ebab64b79
6
+ metadata.gz: 3f7a5569c684260af71ced323cc90a4574b291e38c42cd6118811f2f1cbc7c6b6ce3880217260721de122bd742feedc986ff0f147cc248b5b16eb38c6df25f7a
7
+ data.tar.gz: a42bf79be7e6d83776e97c67cef06cdb7a5183db8b788a69fc489e2156d7d366644433ea8ad677126e7ae191d33631b242f96ed0bdf179885e9e15b0462baa70
data/CHANGELOG.md CHANGED
@@ -1,5 +1,48 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.5.25] - 2026-07-04
4
+
5
+ ### Fixed
6
+
7
+ - See `0.4.39`.
8
+
9
+ ## [0.4.39] - 2026-07-04
10
+
11
+ ### Changed
12
+
13
+ - Common global argument OUT with a file separator overrides PIPE.
14
+
15
+ ### Fixed
16
+
17
+ - Git output list results did not hide footer when banner was disabled.
18
+ - Project banners which were empty were being printed.
19
+
20
+ ## [0.5.24] - 2026-06-14
21
+
22
+ ### Fixed
23
+
24
+ - See `0.4.38`.
25
+
26
+ ## [0.4.38] - 2026-06-14
27
+
28
+ ### Added
29
+
30
+ - Application project commands can be defined without a reference.
31
+ - Git command branch action all was implemented.
32
+
33
+ ### Changed
34
+
35
+ - Override alias methods were created for suffix "!" to "\_".
36
+ - Project banners do not display boolean attributes.
37
+ - OptionPartition method append strips single quotes when quoting strings.
38
+
39
+ ### Fixed
40
+
41
+ - Application methods log and exclude were non-functional.
42
+ - Docker command bake action build does not support changing context.
43
+ - Project base method semver did not include prerelease delimiter.
44
+ - Project session cleanup did not compare by reference.
45
+
3
46
  ## [0.5.23] - 2026-04-29
4
47
 
5
48
  ### Fixed
@@ -1394,6 +1437,8 @@
1394
1437
 
1395
1438
  - Changelog was created.
1396
1439
 
1440
+ [0.5.25]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.25
1441
+ [0.5.24]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.24
1397
1442
  [0.5.23]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.23
1398
1443
  [0.5.22]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.22
1399
1444
  [0.5.21]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.21
@@ -1418,6 +1463,8 @@
1418
1463
  [0.5.2]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.2-ruby
1419
1464
  [0.5.1]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.1-ruby
1420
1465
  [0.5.0]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.0-ruby
1466
+ [0.4.39]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.39
1467
+ [0.4.38]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.38
1421
1468
  [0.4.37]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.37
1422
1469
  [0.4.36]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.36
1423
1470
  [0.4.35]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.35
@@ -51,15 +51,22 @@ module Squared
51
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
+ return val if option && val.match?(/\A(?:-[^=\s-](?:=|\s+)?|(--)?[^=\s-][^=\s]*(?(1)(?:=|\s+)|=))(["']).+\2\z/m)
54
55
 
55
- if option
56
- pat = /\A(?:-[^=\s-](?:=|\s+)?|(--)?[^=\s-][^=\s]*(?(1)(?:=|\s+)|=))(["']).+\2\z/m
57
- return val if val.match?(pat)
58
- end
59
56
  if val =~ QUOTE_VALUE
60
- return val if pass || ($1 == '"' && Rake::Win32.windows? && val.match?(/(?:[#{File::SEPARATOR} ]|\\")/o))
61
-
62
- base = $2 unless preserve
57
+ if pass == '"' || pass == "'"
58
+ return val if pass == $1
59
+ elsif pass || ($1 == '"' && Rake::Win32.windows? && val.match?(/(?:[#{File::SEPARATOR} ]|\\")/o))
60
+ return val
61
+ end
62
+ case preserve
63
+ when false
64
+ base = $2
65
+ when '"'
66
+ base = $2 if $1 == "'"
67
+ when "'"
68
+ base = $2 if $1 == '"'
69
+ end
63
70
  end
64
71
  q = -> { (base || val).gsub("'\\\\''", "'") }
65
72
  if double || Rake::Win32.windows? || (ARG[:QUOTE] == '"' && !override)
@@ -150,11 +150,19 @@ module Squared
150
150
  end
151
151
 
152
152
  def env_pipe(key, default = 1, suffix: nil, strict: false, root: nil)
153
+ out = 1
153
154
  case key
154
155
  when ::String
155
156
  case (ret = env_value(key, suffix: suffix, strict: strict))
156
157
  when '0', '1', '2'
157
158
  return ret.to_i
159
+ else
160
+ out = default if default.is_a?(::Numeric)
161
+ if ret.include?(File::SEPARATOR)
162
+ default = ret
163
+ elsif key.include?(File::SEPARATOR)
164
+ default = key
165
+ end
158
166
  end
159
167
  when ::Numeric
160
168
  return key if key.between?(0, 2)
@@ -165,7 +173,7 @@ module Squared
165
173
  (root ? Pathname.new(root) + default : Pathname.new(default)).realdirpath
166
174
  rescue StandardError => e
167
175
  warn e
168
- 1
176
+ out
169
177
  end
170
178
  end
171
179
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Squared
4
- VERSION = '0.5.23'
4
+ VERSION = '0.5.25'
5
5
  end
@@ -95,7 +95,13 @@ module Squared
95
95
  @kind = Support.hashlist
96
96
  @extensions = []
97
97
  @envname = env_key(@main).freeze
98
- @pipe = $DEBUG ? 2 : env_pipe(pipe, (ARG[:OUT] && env(ARG[:OUT])) || 1, root: @home)
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
@@ -844,7 +850,7 @@ module Squared
844
850
  log_console(*args, pipe: kwargs[:pipe] || pipe)
845
851
  end
846
852
 
847
- def script_command(task, val, group, ref, on, &blk)
853
+ def script_command(task, val, group, ref, on = nil, &blk)
848
854
  if block_given?
849
855
  val = Struct::RunData.new(val, blk)
850
856
  elsif !val
@@ -855,7 +861,7 @@ module Squared
855
861
  items = as_a(group, :to_sym)
856
862
  else
857
863
  label = :ref
858
- items = as_a(ref, :to_sym)
864
+ items = as_a(ref || :_, :to_sym)
859
865
  end
860
866
  items.each do |name|
861
867
  @script[label][name][task] = val
@@ -888,6 +894,8 @@ module Squared
888
894
  nil
889
895
  elsif ref && target[:ref].key?(ref)
890
896
  target[:ref][ref]
897
+ else
898
+ target[:ref][:_]
891
899
  end
892
900
  end
893
901
 
@@ -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 asdf].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
@@ -1339,7 +1339,7 @@ module Squared
1339
1339
  return cmd unless cmd.respond_to?(:done)
1340
1340
 
1341
1341
  raise_error('no args added', hint: cmd.first) unless cmd.size > 1
1342
- @session = nil if cmd == @session
1342
+ @session = nil if cmd.equal?(@session)
1343
1343
  cmd.done
1344
1344
  end
1345
1345
 
@@ -1379,7 +1379,7 @@ module Squared
1379
1379
  def print_item(*val, series: true)
1380
1380
  puts unless printfirst?
1381
1381
  printsucc if series
1382
- puts val unless val.empty? || (val.size == 1 && val.first.nil?)
1382
+ puts val unless val.empty? || (val.size == 1 && (!val.first || val.first.empty?))
1383
1383
  end
1384
1384
 
1385
1385
  def print_banner(*lines, client: false, styles: theme[:banner], border: borderstyle, **)
@@ -1475,7 +1475,7 @@ module Squared
1475
1475
  __send__ meth
1476
1476
  end
1477
1477
  end
1478
- val = val.compact.join(s)
1478
+ val = val.reject { |item| !item || item == true }.join(s)
1479
1479
  next unless found && !val.empty?
1480
1480
  elsif (val = __send__(val)).nil?
1481
1481
  next
@@ -1815,12 +1815,16 @@ module Squared
1815
1815
 
1816
1816
  def matchmap(list, prefix = nil)
1817
1817
  list.map do |val|
1818
- if val.is_a?(Regexp)
1819
- val
1820
- else
1821
- val = ".*#{val}" if prefix && !val.sub!(/\A(\^|\\A)/, '')
1822
- Regexp.new("#{prefix}#{val == '*' ? '.+' : val}")
1818
+ next val if val.is_a?(Regexp)
1819
+
1820
+ if prefix
1821
+ a = nil
1822
+ (val = val.dup).sub!(/\A(\^|\\A)/) do |s|
1823
+ a = s
1824
+ nil
1825
+ end
1823
1826
  end
1827
+ Regexp.new("#{a}#{prefix}#{val == '*' ? '.+' : val}")
1824
1828
  end
1825
1829
  end
1826
1830
 
@@ -1847,9 +1851,9 @@ module Squared
1847
1851
 
1848
1852
  a, b = [a.first, b.first].map! do |c|
1849
1853
  d = begin
1850
- Integer(c[5]).to_s
1854
+ Integer(c[6]).to_s
1851
1855
  rescue StandardError
1852
- c[5] ? '-1' : '0'
1856
+ c[6] ? '-1' : '0'
1853
1857
  end
1854
1858
  [c[0], c[2], c[4] || '0', d]
1855
1859
  end
@@ -2124,7 +2128,7 @@ module Squared
2124
2128
  end
2125
2129
 
2126
2130
  def semmajor?(cur, want)
2127
- (cur[0] == '0' && want[0] == '0' ? cur[2] != want[2] : cur[0] != want[0]) && !want[5]
2131
+ (cur[0] == '0' && want[0] == '0' ? cur[2] != want[2] : cur[0] != want[0]) && !want[6]
2128
2132
  end
2129
2133
 
2130
2134
  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
@@ -328,19 +328,8 @@ module Squared
328
328
  append_tag(tag || option('tag', ignore: false) || self.tag)
329
329
  append_context context
330
330
  when :bake
331
- unless op.empty?
332
- args = op.dup
333
- op.reset
334
- if Dir.exist?(args.last)
335
- if projectpath?(val = args.pop)
336
- context = val
337
- else
338
- args << val
339
- end
340
- end
341
- op.append(args, escape: true, strip: /^:/)
342
- contextdir context if context
343
- end
331
+ op.append(escape: true, strip: /^:/, clear: true)
332
+ op.push(context) if context
344
333
  end
345
334
  op.clear(pass: false)
346
335
  run(from: :"buildx:#{flag}")
@@ -373,6 +362,7 @@ module Squared
373
362
  end
374
363
  run(from: :"compose:#{flag}")
375
364
  end
365
+ alias compose_ compose!
376
366
 
377
367
  def container(flag, opts = [], id: nil)
378
368
  cmd, opts = docker_session('container', flag, opts: opts)
@@ -426,7 +416,7 @@ module Squared
426
416
  end
427
417
  end
428
418
  append_command(flag, id || tagmain, op.extras)
429
- when :update
419
+ when :update, :inspect
430
420
  raise_error('missing container', hint: flag) if op.empty?
431
421
  op.append(escape: true, strip: /^:/)
432
422
  when :commit
@@ -342,7 +342,7 @@ module Squared
342
342
  end
343
343
 
344
344
  subtasks({
345
- 'branch' => %i[create track delete move copy list current].freeze,
345
+ 'branch' => %i[create track delete move copy list all current].freeze,
346
346
  'checkout' => %i[commit branch track detach path].freeze,
347
347
  'commit' => %i[add all amend amend-orig fixup].freeze,
348
348
  'diff' => %i[head branch files view between contain].freeze,
@@ -698,12 +698,7 @@ module Squared
698
698
  task flag do |_, args|
699
699
  branch flag, args.to_a
700
700
  end
701
- when :current
702
- format_desc action, flag
703
- task flag do
704
- branch flag
705
- end
706
- else
701
+ when :move, :copy
707
702
  format_desc action, flag, 'branch,oldbranch?'
708
703
  task flag, [:branch, :oldbranch] do |_, args|
709
704
  if (branch = args.branch)
@@ -714,6 +709,11 @@ module Squared
714
709
  end
715
710
  branch(flag, refs: [oldbranch, branch])
716
711
  end
712
+ else
713
+ format_desc action, flag
714
+ task flag do
715
+ branch flag
716
+ end
717
717
  end
718
718
  when 'switch'
719
719
  case flag
@@ -1139,7 +1139,7 @@ module Squared
1139
1139
  op.clear
1140
1140
  out, banner, from = source(io: true)
1141
1141
  print_item banner
1142
- list_result(write_lines(out), 'objects', from: from)
1142
+ list_result(write_lines(out), 'objects', banner: banner, from: from)
1143
1143
  return
1144
1144
  end
1145
1145
  else
@@ -1188,7 +1188,7 @@ module Squared
1188
1188
  end
1189
1189
  out, banner, from = source(io: true)
1190
1190
  ret = write_lines(out, banner: banner, sub: sub)
1191
- list_result(ret, 'files', from: from, action: 'modified')
1191
+ list_result(ret, 'files', action: 'modified', banner: banner, from: from)
1192
1192
  end
1193
1193
 
1194
1194
  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', from: from, grep: op.extras)
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)
@@ -1576,7 +1577,7 @@ module Squared
1576
1577
  { pat: /^(\*\s+)(\S+)(.*)$/, styles: color(:green), index: 2 },
1577
1578
  { pat: %r{^(\s*)(remotes/\S+)(.*)$}, styles: color(:red), index: 2 }
1578
1579
  ])
1579
- list_result(ret, 'branches', from: from)
1580
+ list_result(ret, 'branches', banner: banner, from: from)
1580
1581
  return
1581
1582
  else
1582
1583
  if (head = git_spawn('rev-parse --abbrev-ref HEAD').chomp).empty?
@@ -1723,7 +1724,7 @@ module Squared
1723
1724
  out, banner, from = source(io: true)
1724
1725
  print_item banner
1725
1726
  ret = write_lines(out, grep: op.extras, prefix: "refs/#{flag}/")
1726
- list_result(ret, flag.to_s, from: from, grep: op.extras)
1727
+ list_result(ret, flag.to_s, grep: op.extras, banner: banner, from: from)
1727
1728
  end
1728
1729
 
1729
1730
  def ls_files(flag, opts = [])
@@ -1733,7 +1734,7 @@ module Squared
1733
1734
  out, banner, from = source(io: true)
1734
1735
  print_item banner
1735
1736
  ret = write_lines(out, grep: op.extras)
1736
- list_result(ret, 'files', from: from, grep: op.extras)
1737
+ list_result(ret, 'files', grep: op.extras, banner: banner, from: from)
1737
1738
  end
1738
1739
 
1739
1740
  def git(flag, opts = [])
@@ -1805,6 +1806,10 @@ module Squared
1805
1806
 
1806
1807
  def source(cmd = @session, exception: true, io: false, sync: true, stdout: false, stderr: false, banner: true,
1807
1808
  multiple: false, hint: nil, from: nil, send: :system, **kwargs)
1809
+ unless cmd
1810
+ print_error('no git session started', subject: project, hint: from, pass: true)
1811
+ return
1812
+ end
1808
1813
  cmd = cmd.target if cmd.is_a?(OptionPartition)
1809
1814
  if io && banner == false
1810
1815
  from = nil
@@ -1895,14 +1900,20 @@ module Squared
1895
1900
  ret += 1
1896
1901
  break if first
1897
1902
  end
1898
- print_item banner, out if banner && (ret > 0 || (!pass && !first))
1903
+ if banner && (ret > 0 || (!pass && !first))
1904
+ if banner.empty?
1905
+ print_item(*out)
1906
+ else
1907
+ print_item(banner, *out)
1908
+ end
1909
+ end
1899
1910
  ret
1900
1911
  end
1901
1912
 
1902
- def list_result(size, type, grep: [], action: 'found', from: nil)
1913
+ def list_result(size, type, action: 'found', grep: [], banner: nil, from: nil)
1903
1914
  if size == 0
1904
1915
  puts empty_status("No #{type} were #{action}", 'grep', grep.join(', '))
1905
- elsif stdout?
1916
+ elsif stdout? && (banner.nil? || (banner.is_a?(String) && !banner.empty?))
1906
1917
  styles = theme.fetch(:banner, []).reject { |s| s.to_s.end_with?('!') }
1907
1918
  styles << :bold if styles.size <= 1
1908
1919
  puts print_footer("#{size} #{size == 1 ? type.sub(/(?:(?<!l)e)?s\z/, '') : type}",
@@ -1991,7 +2002,7 @@ module Squared
1991
2002
  end
1992
2003
  op << '--verbose' if (flag || from == :fetch) && stdout? && !op.arg?('quiet')
1993
2004
  if remote
1994
- op.append(remote, delim: true)
2005
+ op.append(remote)
1995
2006
  if (val = option('refspec', target: target, strict: true))
1996
2007
  op.append(*split_escape(val))
1997
2008
  else
@@ -560,7 +560,7 @@ module Squared
560
560
  when :patch
561
561
  upgrade = a == c && b == d && f[4] != w[4]
562
562
  end
563
- if upgrade && !w[5]
563
+ if upgrade && !w[6]
564
564
  next if file == want
565
565
 
566
566
  found << [key, file, want, if a != c
@@ -176,11 +176,11 @@ module Squared
176
176
  end
177
177
  break
178
178
  end
179
- unless found.anybits?(1)
180
- puts log_message(found == 0 ? Logger::INFO : Logger.WARN,
181
- "no scripts #{found == 0 ? 'found' : 'executed'}",
182
- subject: name, hint: pyprojectfile)
183
- end
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*'
@@ -525,6 +525,7 @@ module Squared
525
525
  op.clear
526
526
  run(from: :"#{flag}:build")
527
527
  end
528
+ alias build_ build!
528
529
 
529
530
  def publish(flag, opts = [], test: false)
530
531
  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? 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
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
@@ -530,7 +530,7 @@ module Squared
530
530
  .each do |val|
531
531
  next unless val.empty? || File.exist?(val.sub('$HOME', Dir.home))
532
532
 
533
- trim = ->(s) { s[/\A\D+\d+\.\d+(?:\.\S+)?/, 0].sub(/\A([a-z]+)-/i, '\1 ') }
533
+ trim = ->(s) { s =~ /^\D+\d+\.\d+(?:\.\S+)?/ ? $&.sub(/^([a-z]+)-/i, '\1 ') : s }
534
534
  ver = '.ruby-version'
535
535
  out << trim.call(case (cmd = File.basename(val))
536
536
  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.5.23
4
+ version: 0.5.25
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.6
127
+ rubygems_version: 4.0.10
128
128
  specification_version: 4
129
129
  summary: Rake task generator for managing multi-language workspaces.
130
130
  test_files: []