squared 0.4.28 → 0.4.30

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: 2a433a8034032658be9c9ce5068904a993c964f01d63ca4ec4a017a742a6802e
4
- data.tar.gz: 805ef86bf61d4da1854a766402377b67cc129dca8537a87ffea966019516f17b
3
+ metadata.gz: ec34e9b4cff5c76d921c742e1d3f476814756fee0a4766b7433c0cef64987826
4
+ data.tar.gz: d1dacfbcc7293efc614a220d7476ce63a641adaf6863c4dec0ba29575182b56b
5
5
  SHA512:
6
- metadata.gz: c7e2e78c6040f77f509419580938f3b501171bded0454eff7b3e2fb9317dacd402cb610b76d513399af23c05c935ad1cd4baffaaa1c601058d808881bb606774
7
- data.tar.gz: b2c810eccf3fb6cdb614dad59ee846dafb13f223ab8b37b612ab0eacdc443f2383679905e697ffc54415355eafcad71e81586f635618960d6414904361ada790
6
+ metadata.gz: aaef815c281e7fb8ac3dae919218ca38e0a4af7815db58315e0221baf35cffbfb28ee8398d8ccabd16ef3888030b825055b1b69ee96d0c1b6632bca41ef60b59
7
+ data.tar.gz: e4934cf825627079d4f6f536b4b86b96b51724415fe316af4b2c900268e284b98600224263faa090c4249db3fafca6eebcb3390fd27a0f0d94c027b616fbcd78
data/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.4.30] - 2025-11-14
4
+
5
+ ### Added
6
+
7
+ - Config viewer can read items by index in an Array.
8
+
9
+ ### Fixed
10
+
11
+ - Node command add uses event name "add" and not "depend".
12
+ - Node command add did not include packages with Yarn and PNPM.
13
+ - Git method revbuild did not splat build arguments.
14
+
15
+ ## [0.4.29] - 2025-11-08
16
+
17
+ ### Fixed
18
+
19
+ - OptionPartition was created by mistake and is unreliable in every way.
20
+
3
21
  ## [0.4.28] - 2025-11-08
4
22
 
5
23
  ### Fixed
@@ -1085,6 +1103,8 @@
1085
1103
 
1086
1104
  - Changelog was created.
1087
1105
 
1106
+ [0.4.30]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.30
1107
+ [0.4.29]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.29
1088
1108
  [0.4.28]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.28
1089
1109
  [0.4.27]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.27
1090
1110
  [0.4.26]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.26
@@ -42,7 +42,7 @@ module Squared
42
42
 
43
43
  attr_reader :delim, :extras
44
44
 
45
- def initialize(data = [], delim: ' ', partition: '--', uniq: /\A--?[^\[\]=\s-][^\[\]=\s]*(?:=|\s+)\S/)
45
+ def initialize(data = [], delim: ' ', partition: '--', uniq: /\A--?[^=\s-][^=\s]*(?:=|\s+)\S/)
46
46
  @delim = delim
47
47
  @partition = partition
48
48
  @uniq = uniq
@@ -50,13 +50,17 @@ module Squared
50
50
  super(data.compact)
51
51
  end
52
52
 
53
+ def compact
54
+ to_ary.map!(&:to_s).reject(&:empty?)
55
+ end
56
+
53
57
  def last(val, pat)
54
58
  (@last ||= []).push([val, pat, $1]) if val =~ pat
55
59
  self << val
56
60
  end
57
61
 
58
62
  def pass(&blk)
59
- ret = to_ary.map!(&:to_s).reject(&:empty?)
63
+ ret = compact
60
64
  @last&.each do |val, pat, key|
61
65
  i = []
62
66
  j = nil
@@ -223,7 +223,7 @@ module Squared
223
223
  end
224
224
 
225
225
  def emphasize(val, title: nil, footer: nil, right: false, cols: nil, sub: nil, pipe: nil,
226
- border: @theme && @theme[:border])
226
+ border: @theme.is_a?(::Hash) && @theme[:border])
227
227
  n = 0
228
228
  max = ->(a) { n = [n, a.max_by(&:size).size].max }
229
229
  set = ->(s) { Array(s).map(&:to_s).tap { |a| max.call(a) } }
@@ -288,7 +288,7 @@ module Squared
288
288
  else
289
289
  pipe = $stdout unless pipe.respond_to?(:puts)
290
290
  end
291
- pipe.puts out
291
+ pipe.puts(out)
292
292
  else
293
293
  err ? warn(out) : puts(out)
294
294
  end
@@ -49,9 +49,9 @@ module Squared
49
49
  raise_error 'empty selection list' if max == 0
50
50
  min = grep ? 1 : [min, max].min
51
51
  if auto
52
- msg = "#{msg + (force ? ':' : '?')} [#{min}-#{max}#{if (n = multiple)
53
- "|,#{n.is_a?(::Numeric) ? "{#{n}}" : ''}"
54
- end}] "
52
+ msg = "#{msg}: [#{min}-#{max}#{if multiple
53
+ "|,#{multiple.is_a?(::Numeric) ? "{#{multiple}}" : ''}"
54
+ end}] "
55
55
  end
56
56
  end
57
57
  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?(' ')
@@ -51,7 +51,7 @@ module Squared
51
51
  return val if (!force && !val.include?(' ')) || val.empty?
52
52
 
53
53
  if option
54
- pat = /\A(?:-[^\[\]=\s-](?:=|\s+)?|(--)?[^\[\]=\s-][^\[\]=\s]*(?(1)(?:=|\s+)|=))(["']).+\2\z/m
54
+ pat = /\A(?:-[^=\s-](?:=|\s+)?|(--)?[^=\s-][^=\s]*(?(1)(?:=|\s+)|=))(["']).+\2\z/m
55
55
  return val if val.match?(pat)
56
56
  end
57
57
  q = ->(s) { s.gsub("'\\\\''", "'") }
@@ -112,6 +112,7 @@ module Squared
112
112
  end
113
113
 
114
114
  def fill_option(val, **kwargs)
115
+ return val unless val.is_a?(::String)
115
116
  return "-#{val}" if val.match?(/\A(?:[a-z]\d*|\d)\z/i)
116
117
 
117
118
  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], index: 2 },
251
250
  { pat: /\A(.+ : )(true|false)(\s*)\z/m, styles: theme[:boolean],
252
251
  index: 2 },
@@ -262,7 +261,7 @@ module Squared
262
261
  symbolize = opts[:symbolize_names]
263
262
  keys.each do |key|
264
263
  begin
265
- items = key.split('.')
264
+ items = key.split('.').flat_map { |name| name =~ /^(.+)\[(\d+)\]$/ ? [$1, $2.to_i] : name }
266
265
  items = items.map(&:to_sym) if symbolize
267
266
  val = data.dig(*items)
268
267
  if val.nil?
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Squared
4
- VERSION = '0.4.28'
4
+ VERSION = '0.4.30'
5
5
  end
@@ -375,7 +375,6 @@ module Squared
375
375
  case flag
376
376
  when :run, :create, :exec
377
377
  if rc && !op.arg?('mount')
378
- run = VAL_DOCKER[:run]
379
378
  all = collect_hash VAL_DOCKER[:run]
380
379
  delim = Regexp.new(",\\s*(?=#{all.join('|')})")
381
380
  Array(@mounts).each do |val|
@@ -392,8 +391,8 @@ module Squared
392
391
  end
393
392
  elsif all.include?(k)
394
393
  unless type
395
- run.each_pair do |key, val|
396
- next unless val.include?(k)
394
+ VAL_DOCKER[:run].each_pair do |key, a|
395
+ next unless a.include?(k)
397
396
 
398
397
  type = key.to_s unless key == :common
399
398
  break
@@ -674,7 +674,7 @@ module Squared
674
674
  branch(flag, target: target, ref: ref, remote: remote)
675
675
  end
676
676
  when :delete
677
- format_desc action, flag, '(^~)name*,:?'
677
+ format_desc action, flag, '[^~]name*,:?'
678
678
  task flag do |_, args|
679
679
  refs = args.to_a
680
680
  if refs.empty? || (r = refs.last == ':')
@@ -1232,7 +1232,7 @@ module Squared
1232
1232
  end
1233
1233
  end
1234
1234
  start = epochtime
1235
- build(@output, sync: sync, from: :'git:revbuild')
1235
+ build(*@output, sync: sync, from: :'git:revbuild')
1236
1236
  rescue StandardError => e
1237
1237
  print_error(e, pass: true)
1238
1238
  else
@@ -1448,7 +1448,6 @@ module Squared
1448
1448
  end
1449
1449
  origin = readline('Enter an upstream', force: true)
1450
1450
  end
1451
- raise_error('missing remote name', hint: origin) unless origin.include?('/')
1452
1451
  upstream = true
1453
1452
  end
1454
1453
  break
@@ -2122,7 +2121,9 @@ module Squared
2122
2121
  end
2123
2122
 
2124
2123
  def repotrack(origin, branch, quote: true)
2125
- i = origin.index('/')
2124
+ unless origin && branch && (i = origin.index('/'))
2125
+ raise_error(ArgumentError, "missing #{origin ? 'branch' : 'remote'} name", hint: origin)
2126
+ end
2126
2127
  branch = "#{branch}:#{origin[(i + 1)..-1]}" unless origin.end_with?("/#{branch}")
2127
2128
  ret = [origin[0..(i - 1)], branch]
2128
2129
  quote ? ret.map! { |val| shell_quote(val) } : ret
@@ -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 = {
@@ -437,11 +438,12 @@ module Squared
437
438
  if flag == :add
438
439
  cmd << 'add' << "--save-#{save}"
439
440
  cmd << '--save-exact' if exact
441
+ option('allow-build') { |val| cmd << quote_option('allow-build', val) }
440
442
  else
441
443
  cmd << 'install'
442
444
  append_platform
443
445
  end
444
- if (val = option('public-hoist-pattern', ignore: false))
446
+ if (val = option('public-hoist-pattern'))
445
447
  split_escape(val).each { |opt| cmd << shell_option('public-hoist-pattern', opt) }
446
448
  end
447
449
  cmd << '--ignore-workspace' if env('NODE_WORKSPACES', equals: '0')
@@ -451,7 +453,6 @@ module Squared
451
453
  if flag == :add
452
454
  cmd << "--save-#{save}"
453
455
  cmd << '--save-exact' if exact
454
- cmd.merge(packages.map { |pkg| shell_quote(pkg) })
455
456
  else
456
457
  append_platform
457
458
  end
@@ -460,7 +461,8 @@ module Squared
460
461
  append_nocolor
461
462
  end
462
463
  append_loglevel
463
- run(from: :depend, sync: sync)
464
+ cmd.merge(packages.map { |pkg| shell_quote(pkg) }) if flag == :add
465
+ run(from: flag || :depend, sync: sync)
464
466
  end
465
467
  end
466
468
 
@@ -713,7 +715,7 @@ module Squared
713
715
  else
714
716
  cmd = session 'npm', flag
715
717
  list = OPT_NPM[:install_base] + OPT_NPM.fetch(flag, []) + OPT_NPM[:common]
716
- list.concat(OPT_NPM[:install_as]) unless flag == :dedupe
718
+ list.concat(OPT_NPM[:install_as]) if flag == :install || flag == :update
717
719
  no = OPT_NPM[:install_no]
718
720
  end
719
721
  op = OptionPartition.new(opts, list, cmd, no: no, project: self)
@@ -733,13 +735,13 @@ module Squared
733
735
  append_platform if flag == :install
734
736
  append_nocolor
735
737
  append_loglevel
736
- if flag == :dedupe
738
+ if flag == :dedupe || pnpm?
737
739
  op.clear
738
740
  else
739
741
  op.append(quote: true)
740
742
  end
741
- op.clear(errors: true)
742
743
  end
744
+ op.clear(errors: true)
743
745
  run(from: from || :"package:#{flag}")
744
746
  end
745
747
 
@@ -1038,7 +1040,7 @@ module Squared
1038
1040
 
1039
1041
  def append_loglevel(target: @session)
1040
1042
  level = env('NODE_LOGLEVEL')
1041
- silent = !verbose || level == 'silent'
1043
+ silent = verbosetype == 0 || level == 'silent'
1042
1044
  return unless silent || level
1043
1045
 
1044
1046
  if yarn?
@@ -561,7 +561,6 @@ module Squared
561
561
  when :install, :update
562
562
  list.concat(OPT_GEM[:install_base])
563
563
  end
564
- cmd.merge(preopts)
565
564
  op = OptionPartition.new(opts, list, cmd, project: self, no: OPT_GEM[:no][flag])
566
565
  op.each do |opt|
567
566
  if !opt.match?(/\A[A-Za-z\d][A-Za-z\d_.-]*\z/) && %i[install uninstall update pristine].include?(flag)
@@ -959,18 +958,11 @@ module Squared
959
958
  end
960
959
 
961
960
  def gem_session(*cmd, **kwargs)
962
- ret = session('gem', *cmd, **kwargs)
963
- return ret if cmd.empty?
964
-
965
- ret.merge(preopts)
961
+ session('gem', *cmd, *preopts, **kwargs)
966
962
  end
967
963
 
968
964
  def bundle_session(*cmd, **kwargs)
969
- ret = session('bundle', *cmd, **kwargs)
970
- return ret if cmd.empty?
971
-
972
- append_nocolor
973
- ret.merge(preopts)
965
+ session('bundle', *cmd, *preopts, **kwargs).tap { append_nocolor }
974
966
  end
975
967
 
976
968
  def rake_session(*cmd, **kwargs)
@@ -994,7 +986,7 @@ module Squared
994
986
  end
995
987
 
996
988
  def preopts
997
- verbosetype > 1 && !session_arg?('quiet') ? ['--verbose'] : []
989
+ verbosetype > 1 ? ['--verbose'] : []
998
990
  end
999
991
 
1000
992
  def variables
@@ -1056,7 +1048,9 @@ module Squared
1056
1048
  end
1057
1049
 
1058
1050
  def gemdir?
1059
- !@gemdir.nil? && @gemdir.exist? && !@gemdir.empty?
1051
+ return false unless @gemdir
1052
+
1053
+ @gemdir.exist? && !@gemdir.empty?
1060
1054
  end
1061
1055
 
1062
1056
  alias read_rakefile raketasks
@@ -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*|\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
@@ -121,12 +121,12 @@ module Squared
121
121
  end
122
122
 
123
123
  def shortopt(*group)
124
- group.map! { |s| s.sub(/\A-/, '') }
124
+ group.map! { |s| Regexp.escape(s.sub(/\A-/, '')) }
125
125
  "-(?:#{Regexp.escape(group.join('|'))})(?:\\z|[^ =]| +[^ -])"
126
126
  end
127
127
 
128
128
  def longopt(*group, value)
129
- group.map! { |s| s.sub(/\A--/, '') }
129
+ group.map! { |s| Regexp.escape(s.sub(/\A--/, '')) }
130
130
  "--(?:#{Regexp.escape(group.join('|'))})(?:#{value ? '=[^ ]| +[^ -]' : '[= ]|\z'})"
131
131
  end
132
132
  end
@@ -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
@@ -340,7 +340,7 @@ module Squared
340
340
 
341
341
  def adjoin(*args, with: nil, start: false)
342
342
  i = -1
343
- temp = to_a
343
+ temp = compact
344
344
  if with
345
345
  pat = case with
346
346
  when String, Symbol
@@ -359,11 +359,11 @@ module Squared
359
359
  else
360
360
  temp.each_with_index do |val, index|
361
361
  if i == 0
362
- next unless val.start_with?('-')
362
+ next unless val.is_a?(String) && val.start_with?('-')
363
363
 
364
364
  i = index
365
365
  break
366
- elsif index > 0 && !val.start_with?('-')
366
+ elsif index > 0 && !val.to_s.start_with?('-')
367
367
  if start
368
368
  i = index + (start.is_a?(Numeric) ? start : 1)
369
369
  break
@@ -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.4.28
4
+ version: 0.4.30
5
5
  platform: ruby
6
6
  authors:
7
7
  - An Pham
@@ -125,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
125
  - !ruby/object:Gem::Version
126
126
  version: '0'
127
127
  requirements: []
128
- rubygems_version: 3.6.9
128
+ rubygems_version: 3.7.2
129
129
  specification_version: 4
130
130
  summary: Rake task generator for managing multi-language workspaces.
131
131
  test_files: []