squared 0.5.15 → 0.5.16

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: bb26d6cf2dfdece4362de8ae2e5748eb11cc05e4158d4d81a43c1c63320764b4
4
- data.tar.gz: 2d01a9695d8953acd20d568be48089424bc1afc23039f372d1125a77562792bd
3
+ metadata.gz: 0a3f9923041ce7530aea68d4f1988908a52262254841860cb48800978faf777a
4
+ data.tar.gz: 331352c83df0aa4e8b6f410a094f8b9c3e78a0f1a6624c820936333055786240
5
5
  SHA512:
6
- metadata.gz: c3f191d7014c93cb20c6ace155e9b3e56561e8d88ad48f67793da484d73b50e7d7fa183ba7f52dfdfc7d434c1acedd1a748d4e95b8726763235fd5e45df893d7
7
- data.tar.gz: f7ce5072078a05a56c850420f17b3923444b8581e7bd06a71d61a13197ac91b05d883edad0774b890c28edd79bd8da597e0accac53559f8bd1da152890d708f9
6
+ metadata.gz: 7b3c510c77ca4761e6e5cc0c27498b32df7fa9f8be94d2560934ad3f436774c0860a6de7fac24de70d4b4ee04b163b587c544261326c34deacc291e7478bdfd4
7
+ data.tar.gz: 734bc751eb03ae220ec4a494e266353f3d8b30382ebc59afcc8271a613d3102b403e912884e938f861bc6b0edab366140a0040b4e44d9d1b48c403a18ea6e85f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.5.16] - 2025-11-14
4
+
5
+ ### Fixed
6
+
7
+ - See `0.4.30`.
8
+
9
+ ## [0.4.30] - 2025-11-14
10
+
11
+ ### Added
12
+
13
+ - Config viewer can read items by index in an Array.
14
+
15
+ ### Fixed
16
+
17
+ - Node command add uses event name "add" and not "depend".
18
+ - Node command add did not include packages with Yarn and PNPM.
19
+ - Git method revbuild did not splat build arguments.
20
+
3
21
  ## [0.5.15] - 2025-11-08
4
22
 
5
23
  ### Fixed
@@ -1229,6 +1247,7 @@
1229
1247
 
1230
1248
  - Changelog was created.
1231
1249
 
1250
+ [0.5.16]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.16
1232
1251
  [0.5.15]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.15
1233
1252
  [0.5.14]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.14
1234
1253
  [0.5.13]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.13
@@ -1245,6 +1264,7 @@
1245
1264
  [0.5.2]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.2-ruby
1246
1265
  [0.5.1]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.1-ruby
1247
1266
  [0.5.0]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.0-ruby
1267
+ [0.4.30]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.30
1248
1268
  [0.4.29]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.29
1249
1269
  [0.4.28]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.28
1250
1270
  [0.4.27]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.27
@@ -225,7 +225,7 @@ module Squared
225
225
  end
226
226
 
227
227
  def emphasize(val, title: nil, footer: nil, right: false, cols: nil, sub: nil, pipe: nil,
228
- border: @theme && @theme[:border])
228
+ border: @theme.is_a?(::Hash) && @theme[:border])
229
229
  n = 0
230
230
  max = ->(a) { n = [n, a.max_by(&:size).size].max }
231
231
  set = ->(s) { Array(s).map(&:to_s).tap { |a| max.call(a) } }
@@ -290,7 +290,7 @@ module Squared
290
290
  else
291
291
  pipe = $stdout unless pipe.respond_to?(:puts)
292
292
  end
293
- pipe.puts out
293
+ pipe.puts(out)
294
294
  else
295
295
  err ? warn(out) : puts(out)
296
296
  end
@@ -55,9 +55,9 @@ module Squared
55
55
  raise_error 'empty selection list' if max == 0
56
56
  min = grep ? 1 : [min, max].min
57
57
  if auto
58
- msg = "#{msg + (force ? ':' : '?')} [#{min}-#{max}#{if (n = multiple)
59
- "|,#{n.is_a?(::Numeric) ? "{#{n}}" : ''}"
60
- end}] "
58
+ msg = "#{msg}: [#{min}-#{max}#{if multiple
59
+ "|,#{multiple.is_a?(::Numeric) ? "{#{multiple}}" : ''}"
60
+ end}] "
61
61
  end
62
62
  end
63
63
  valid = ->(s) { s.match?(/^\d+$/) && s.to_i.between?(min, max) }
@@ -29,7 +29,7 @@ module Squared
29
29
  r[7]
30
30
  end
31
31
  r[1] + (data ? data[2] : r[2]) + r[4] + shell_quote(opt, force: force, double: double, override: override)
32
- elsif option && val =~ /\A(-{0,2}[^\[\]=\s-][^\[\]=\s]*)=(.+)\z/m
32
+ elsif option && val =~ /\A(-{0,2}[^=\s-][^=\s]*)=(.+)\z/m
33
33
  return val if $2.match?(QUOTE_VALUE)
34
34
 
35
35
  "#{$1}=%s" % if $2.include?(' ')
@@ -53,7 +53,7 @@ module Squared
53
53
  return val if (!force && !val.include?(' ')) || val.empty?
54
54
 
55
55
  if option
56
- pat = /\A(?:-[^\[\]=\s-](?:=|\s+)?|(--)?[^\[\]=\s-][^\[\]=\s]*(?(1)(?:=|\s+)|=))(["']).+\2\z/m
56
+ pat = /\A(?:-[^=\s-](?:=|\s+)?|(--)?[^=\s-][^=\s]*(?(1)(?:=|\s+)|=))(["']).+\2\z/m
57
57
  return val if val.match?(pat)
58
58
  end
59
59
  q = ->(s) { s.gsub("'\\\\''", "'") }
@@ -119,6 +119,7 @@ module Squared
119
119
  end
120
120
 
121
121
  def fill_option(val, **kwargs)
122
+ return val unless val.is_a?(::String)
122
123
  return "-#{val}" if val.match?(/\A(?:[a-z]\d*|\d)\z/i)
123
124
 
124
125
  shell_escape(val.start_with?('-') ? val : "--#{val}", **kwargs)
@@ -12,15 +12,14 @@ module Squared
12
12
  include Rake::DSL
13
13
 
14
14
  class << self
15
- def parse(gem, namespace, ext = [pkg])
15
+ def parse(gem, namespace, ext = [gem])
16
16
  require gem
17
- obj = eval namespace
18
- Array(ext).each { |val| @@mime_obj[val] = [obj, ext] }
17
+ [eval(namespace), Array(ext)].tap do |data|
18
+ data.last.each { |key| @@mime_obj[key] = data }
19
+ end
19
20
  rescue LoadError, NameError => e
20
21
  warn e
21
22
  nil
22
- else
23
- @@mime_obj[ext.first]
24
23
  end
25
24
 
26
25
  def link(project, main = project.dependfile.basename, name = nil, **kwargs, &blk)
@@ -246,7 +245,7 @@ module Squared
246
245
  { pat: /\A((?~: ): )(-?[\d.]+)(\s*)\z/m, styles: theme[:number],
247
246
  index: 2 },
248
247
  { pat: /\A((?~: ): ")(.+)("\s*)\z/m, styles: theme[:string], index: 2 },
249
- { pat: /\A((?~: ): \{)(.+)(\}\s*)\z/m, styles: theme[:hash], index: 2 },
248
+ { pat: /\A((?~: ): \{)(.+)(}\s*)\z/m, styles: theme[:hash], index: 2 },
250
249
  { pat: /\A((?~: ): \[)(.+)(\]\s*)\z/m, styles: theme[:array],
251
250
  index: 2 },
252
251
  { pat: /\A((?~: ): )(true|false)(\s*)\z/m, styles: theme[:boolean],
@@ -263,7 +262,7 @@ module Squared
263
262
  symbolize = opts[:symbolize_names]
264
263
  keys.each do |key|
265
264
  begin
266
- items = key.split('.')
265
+ items = key.split('.').flat_map { |name| name =~ /^(.+)\[(\d+)\]$/ ? [$1, $2.to_i] : name }
267
266
  items = items.map(&:to_sym) if symbolize
268
267
  val = data.dig(*items)
269
268
  if val.nil?
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Squared
4
- VERSION = '0.5.15'
4
+ VERSION = '0.5.16'
5
5
  end
@@ -386,7 +386,6 @@ module Squared
386
386
  case flag
387
387
  when :run, :create, :exec
388
388
  if rc && !op.arg?('mount')
389
- run = VAL_DOCKER[:run]
390
389
  all = collect_hash VAL_DOCKER[:run]
391
390
  delim = Regexp.new(",\\s*(?=#{all.join('|')})")
392
391
  Array(@mounts).each do |val|
@@ -403,8 +402,8 @@ module Squared
403
402
  end
404
403
  elsif all.include?(k)
405
404
  unless type
406
- run.each_pair do |key, val|
407
- next unless val.include?(k)
405
+ VAL_DOCKER[:run].each_pair do |key, a|
406
+ next unless a.include?(k)
408
407
 
409
408
  type = key.to_s unless key == :common
410
409
  break
@@ -822,7 +821,7 @@ module Squared
822
821
  end
823
822
  cmd.merge(Array(out).map! { |val| parse.call(val) })
824
823
  cmd << args
825
- print_success if success?(run(cmd), ctx.start_with?(/(?:network|tag|save)/))
824
+ print_success if success?(run(cmd), ctx.start_with?(/network|tag|save/))
826
825
  end
827
826
  end
828
827
 
@@ -675,7 +675,7 @@ module Squared
675
675
  branch(flag, target: target, ref: ref, remote: remote)
676
676
  end
677
677
  when :delete
678
- format_desc action, flag, '(^~)name*,:?'
678
+ format_desc action, flag, '[^~]name*,:?'
679
679
  task flag do |_, args|
680
680
  refs = args.to_a
681
681
  if refs.empty? || (r = refs.last == ':')
@@ -1238,7 +1238,7 @@ module Squared
1238
1238
  end
1239
1239
  end
1240
1240
  start = time_epoch
1241
- build(@output, sync: sync, from: :'git:revbuild')
1241
+ build(*@output, sync: sync, from: :'git:revbuild')
1242
1242
  rescue StandardError => e
1243
1243
  print_error(e, pass: true)
1244
1244
  else
@@ -1447,7 +1447,6 @@ module Squared
1447
1447
  end
1448
1448
  origin = readline('Enter an upstream', force: true)
1449
1449
  end
1450
- raise_error('missing remote name', hint: origin) unless origin.include?('/')
1451
1450
  upstream = true
1452
1451
  end
1453
1452
  break
@@ -2123,7 +2122,9 @@ module Squared
2123
2122
  end
2124
2123
 
2125
2124
  def repotrack(origin, branch, quote: true)
2126
- i = origin.index('/')
2125
+ unless origin && branch && (i = origin.index('/'))
2126
+ raise_error(ArgumentError, "missing #{origin ? 'branch' : 'remote'} name", hint: origin)
2127
+ end
2127
2128
  branch = "#{branch}:#{origin[(i + 1)..-1]}" unless origin.end_with?("/#{branch}")
2128
2129
  [origin[0..(i - 1)], branch].tap { |ret| ret.map! { |val| shell_quote(val) } if quote }
2129
2130
  end
@@ -6,18 +6,19 @@ 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[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,
9
+ install: %w[package-lock-only=!? prefer-dedupe=!? E|save-exact=!? before=q cpu=b libc=b os=b].freeze,
10
+ install_base: %w[audit=! bin-links=! foreground-scripts=!? fund=! ignore-scripts=!? install-links=!?
11
+ package-lock=! strict-peer-deps=!? include=b install-strategy=b omit=b].freeze,
12
12
  install_no: %w[audit bin-links fund package-lock].freeze,
13
- install_as: %w[no-save save-bundle save-dev save-optional save-peer save-prod before=q foreground-scripts=!?
14
- g|global=!? S|save=!? E|save-exact=!?].freeze,
13
+ install_as: %w[no-save B|save-bundle D|save-dev O|save-optional save-peer P|save-prod g|global=!?
14
+ S|save=!?].freeze,
15
15
  run: %w[foreground-scripts=!? if-present=!? ignore-scripts=!? script-shell=p].freeze,
16
16
  exec: %w[c|call=q package=b].freeze,
17
17
  pack: %w[ignore-scripts=!? json=!? pack-destination=p].freeze
18
18
  }.freeze
19
19
  OPT_PNPM = {
20
- common: %w[aggregate-output color no-color stream use-stderr C|dir=p loglevel=b w|workspace-root].freeze,
20
+ common: %w[aggregate-output color ignore-workspace-root-check no-color stream use-stderr C|dir=p loglevel=b
21
+ r|recursive w|workspace-root].freeze,
21
22
  cpu: %w[cpu=b libc=b os=b].freeze,
22
23
  filter: %w[fail-if-no-match changed-files-ignore-pattern=q filter=q filter-prod=q test-pattern=q].freeze,
23
24
  install: %w[fix-lockfile force ignore-pnpmfile ignore-workspace lockfile-only merge-git-branch-lockfiles
@@ -28,12 +29,12 @@ module Squared
28
29
  reporter=b].freeze,
29
30
  install_base: %w[global-dir ignore-scripts offline prefer-offline store-dir=p virtual-store-dir=p].freeze,
30
31
  install_no: %w[frozen-lockfile verify-store-integrity].freeze,
31
- install_as: %w[D|dev global-dir no-optional P|prod r|recursive].freeze,
32
+ install_as: %w[D|dev no-optional P|prod].freeze,
32
33
  update: %w[g|global i|interactive L|latest depth=i].freeze,
33
34
  dedupe: %w[check].freeze,
34
- run: %w[if-present no-bail parallel r|recursive report-summary reporter-hide-prefix resume-from
35
+ run: %w[if-present no-bail parallel report-summary reporter-hide-prefix resume-from
35
36
  sequential].freeze,
36
- exec: %w[no-reporter-hide-prefix parallel r|recursive report-summary resume-from c|shell-mode].freeze,
37
+ exec: %w[no-reporter-hide-prefix parallel report-summary resume-from c|shell-mode].freeze,
37
38
  pack: %w[json pack-destination=p pack-gzip-level=i].freeze
38
39
  }.freeze
39
40
  OPT_YARN = {
@@ -445,11 +446,12 @@ module Squared
445
446
  if flag == :add
446
447
  cmd << 'add' << "--save-#{save}"
447
448
  cmd << '--save-exact' if exact
449
+ option('allow-build') { |val| cmd << quote_option('allow-build', val) }
448
450
  else
449
451
  cmd << 'install'
450
452
  append_platform
451
453
  end
452
- option('public-hoist-pattern', ignore: false) do |val|
454
+ option('public-hoist-pattern') do |val|
453
455
  split_escape(val).each { |opt| cmd << shell_option('public-hoist-pattern', opt) }
454
456
  end
455
457
  cmd << '--ignore-workspace' if env('NODE_WORKSPACES', equals: '0')
@@ -459,7 +461,6 @@ module Squared
459
461
  if flag == :add
460
462
  cmd << "--save-#{save}"
461
463
  cmd << '--save-exact' if exact
462
- cmd.merge(packages.map { |pkg| shell_quote(pkg) })
463
464
  else
464
465
  append_platform
465
466
  end
@@ -468,7 +469,8 @@ module Squared
468
469
  append_nocolor
469
470
  end
470
471
  append_loglevel
471
- run(from: :depend, sync: sync)
472
+ cmd.merge(packages.map { |pkg| shell_quote(pkg) }) if flag == :add
473
+ run(from: flag || :depend, sync: sync)
472
474
  end
473
475
  end
474
476
 
@@ -721,7 +723,7 @@ module Squared
721
723
  else
722
724
  cmd = session 'npm', flag
723
725
  list = OPT_NPM[:install_base] + OPT_NPM.fetch(flag, []) + OPT_NPM[:common]
724
- list.concat(OPT_NPM[:install_as]) unless flag == :dedupe
726
+ list.concat(OPT_NPM[:install_as]) if flag == :install || flag == :update
725
727
  no = OPT_NPM[:install_no]
726
728
  end
727
729
  op = OptionPartition.new(opts, list, cmd, no: no, project: self)
@@ -741,13 +743,13 @@ module Squared
741
743
  append_platform if flag == :install
742
744
  append_nocolor
743
745
  append_loglevel
744
- if flag == :dedupe
746
+ if flag == :dedupe || pnpm?
745
747
  op.clear
746
748
  else
747
749
  op.append(quote: true)
748
750
  end
749
- op.clear(errors: true)
750
751
  end
752
+ op.clear(errors: true)
751
753
  run(from: from || :"package:#{flag}")
752
754
  end
753
755
 
@@ -1040,7 +1042,7 @@ module Squared
1040
1042
 
1041
1043
  def append_loglevel(target: @session)
1042
1044
  level = env('NODE_LOGLEVEL')
1043
- silent = !verbose || level == 'silent'
1045
+ silent = verbosetype == 0 || level == 'silent'
1044
1046
  return unless silent || level
1045
1047
 
1046
1048
  if yarn?
@@ -601,7 +601,6 @@ module Squared
601
601
  when :install, :update
602
602
  list.concat(OPT_GEM[:install_base])
603
603
  end
604
- cmd.merge(preopts)
605
604
  op = OptionPartition.new(opts, list, cmd, project: self, no: OPT_GEM[:no][flag])
606
605
  op.each do |opt|
607
606
  if !opt.match?(/\A[A-Za-z\d][A-Za-z\d_.-]*\z/) && %i[install uninstall update pristine].include?(flag)
@@ -997,18 +996,11 @@ module Squared
997
996
  end
998
997
 
999
998
  def gem_session(*cmd, **kwargs)
1000
- ret = session('gem', *cmd, **kwargs)
1001
- return ret if cmd.empty?
1002
-
1003
- ret.merge(preopts)
999
+ session('gem', *cmd, *preopts, **kwargs)
1004
1000
  end
1005
1001
 
1006
1002
  def bundle_session(*cmd, **kwargs)
1007
- ret = session('bundle', *cmd, **kwargs)
1008
- return ret if cmd.empty?
1009
-
1010
- append_nocolor
1011
- ret.merge(preopts)
1003
+ session('bundle', *cmd, *preopts, **kwargs).tap { append_nocolor }
1012
1004
  end
1013
1005
 
1014
1006
  def rake_session(*cmd, **kwargs)
@@ -1054,7 +1046,7 @@ module Squared
1054
1046
  end
1055
1047
 
1056
1048
  def preopts
1057
- verbosetype > 1 && !session_arg?('quiet') ? ['--verbose'] : []
1049
+ verbosetype > 1 ? ['--verbose'] : []
1058
1050
  end
1059
1051
 
1060
1052
  def variables
@@ -1103,8 +1095,7 @@ module Squared
1103
1095
  end
1104
1096
 
1105
1097
  def gemlib
1106
- @gemlib ||= begin
1107
- lib = Set.new(['lib'])
1098
+ @gemlib ||= Set.new(['lib']).yield_self do |lib|
1108
1099
  if (spec = gemspec)
1109
1100
  lib.merge(spec.require_paths || [])
1110
1101
  end
@@ -1117,7 +1108,9 @@ module Squared
1117
1108
  end
1118
1109
 
1119
1110
  def gemdir?
1120
- !@gemdir.nil? && @gemdir.exist? && !@gemdir.empty?
1111
+ return false unless @gemdir
1112
+
1113
+ @gemdir.exist? && !@gemdir.empty?
1121
1114
  end
1122
1115
  end
1123
1116
 
@@ -10,9 +10,9 @@ module Squared
10
10
  include Common::Shell
11
11
  extend Forwardable
12
12
 
13
- OPT_NAME = /\A(?:(--)|-)((?(1)[^\[\]=\s-][^\[\]=\s]*|[^\[\]=\s-]))\z/
14
- OPT_VALUE = /\A-{0,2}([^\[\]=\s-][^\[\]=\s]*)(?:=|\s+)(\S.*)\z/
15
- OPT_SINGLE = /\A-([^\[\]=\s-])(.+)\z/
13
+ OPT_NAME = /\A(?:(--)|-)((?(1)[^=\s-][^=\s]*|[^=\s-]))\z/
14
+ OPT_VALUE = /\A-{0,2}([^=\s-][^=\s]*)(?:=|\s+)(\S.*)\z/
15
+ OPT_SINGLE = /\A-([^=\s-])(.+)\z/
16
16
  private_constant :OPT_NAME, :OPT_VALUE, :OPT_SINGLE
17
17
 
18
18
  class << self
@@ -103,7 +103,7 @@ module Squared
103
103
  end
104
104
 
105
105
  def pattern?(val)
106
- val.match?(/(?:\A\^|\$\z)/) || val.match?(/(?:\.[*+]|\(\?:|\\[dsw]|\[.+\]|\{\d+,?\d*\})/)
106
+ val.match?(/(?:\A\^|\$\z)/) || val.match?(/(?:\.[*+]|\(\?:|\\[dsw]|\[.+\]|\{\d+,?\d*})/)
107
107
  end
108
108
 
109
109
  private
@@ -134,7 +134,7 @@ module Squared
134
134
  attr_reader :target, :extras, :found, :errors, :values, :project, :path
135
135
 
136
136
  def_delegators :@target, :+, :-, :<<, :any?, :none?, :include?, :add, :add?, :find, :find_all, :find_index,
137
- :merge, :delete, :delete?, :delete_if, :grep, :grep_v, :inspect, :to_a, :to_s
137
+ :merge, :compact, :delete, :delete?, :delete_if, :grep, :grep_v, :inspect, :to_a, :to_s
138
138
  def_delegators :@extras, :empty?, :each, :each_with_index, :partition, :dup, :first, :last, :shift, :unshift,
139
139
  :pop, :push, :concat, :index, :join, :map, :map!, :detect, :select, :select!, :reject, :size,
140
140
  :delete_at
@@ -374,7 +374,7 @@ module Squared
374
374
 
375
375
  def adjoin(*args, with: nil, start: false)
376
376
  i = -1
377
- temp = to_a
377
+ temp = compact
378
378
  if with
379
379
  pat = case with
380
380
  when String, Symbol
@@ -393,11 +393,11 @@ module Squared
393
393
  else
394
394
  temp.each_with_index do |val, index|
395
395
  if i == 0
396
- next unless val.start_with?('-')
396
+ next unless val.is_a?(String) && val.start_with?('-')
397
397
 
398
398
  i = index
399
399
  break
400
- elsif index > 0 && !val.start_with?('-')
400
+ elsif index > 0 && !val.to_s.start_with?('-')
401
401
  if start
402
402
  i = index + (start.is_a?(Numeric) ? start : 1)
403
403
  break
@@ -526,6 +526,7 @@ module Squared
526
526
  end
527
527
 
528
528
  def windows?
529
+ require 'rake'
529
530
  Rake::Win32.windows?
530
531
  end
531
532
  end
@@ -539,7 +540,7 @@ module Squared
539
540
 
540
541
  attr_reader :delim, :extras
541
542
 
542
- def initialize(data = [], delim: ' ', partition: '--', uniq: /\A--?[^\[\]=\s-][^\[\]=\s]*(?:=|\s+)\S/)
543
+ def initialize(data = [], delim: ' ', partition: '--', uniq: /\A--?[^=\s-][^=\s]*(?:=|\s+)\S/)
543
544
  @delim = delim
544
545
  @partition = partition
545
546
  @uniq = uniq
@@ -547,13 +548,17 @@ module Squared
547
548
  super(data.compact)
548
549
  end
549
550
 
551
+ def compact
552
+ to_ary.map!(&:to_s).reject(&:empty?)
553
+ end
554
+
550
555
  def last(val, pat)
551
556
  (@last ||= []).append([val, pat, $1]) if val =~ pat
552
557
  self << val
553
558
  end
554
559
 
555
560
  def pass(&blk)
556
- ret = to_ary.map!(&:to_s).reject(&:empty?)
561
+ ret = compact
557
562
  @last&.each do |val, pat, key|
558
563
  i = []
559
564
  j = nil
@@ -132,20 +132,20 @@ module Squared
132
132
  task 'all' do |_, args|
133
133
  stage ||= 'all'
134
134
  ns['sync'].invoke(*args.to_a)
135
- next if (stage = env('REPO_STAGE')) == '1'
135
+ next if (n = env('REPO_STAGE')) == '1'
136
136
 
137
137
  @project.select do |_, proj|
138
138
  next unless proj.enabled?(proj.workspace.baseref) && proj.global
139
139
 
140
140
  proj.depend(sync: true) if proj.depend?
141
- next if stage == '2'
141
+ next if n == '2'
142
142
 
143
143
  proj.build?
144
144
  end
145
145
  .each_value do |proj|
146
146
  proj.build(sync: true)
147
- next if stage == '3'
148
- next unless proj.copy? && (proj.dev? || stage == '4')
147
+ next if n == '3'
148
+ next unless proj.copy? && (proj.dev? || n == '4')
149
149
 
150
150
  if (ws = proj.workspace).task_defined?(target = task_join(proj.name, 'copy'))
151
151
  task_invoke(target, **ws.invokeargs)
@@ -251,7 +251,9 @@ module Squared
251
251
  end
252
252
 
253
253
  def repo?
254
- !manifest_url.nil? && (repo_install? || @repo_override == true)
254
+ return false unless manifest_url
255
+
256
+ repo_install? || @repo_override == true
255
257
  end
256
258
 
257
259
  def repo_submodules?(val = false)
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.15
4
+ version: 0.5.16
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.6.9
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: []