squared 0.6.15 → 0.6.17

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: 80355e12b27ecd0f289536aae720c1c8201065cbff2adeffbc03882844c5e382
4
- data.tar.gz: a4bf1561c925f287b5188f94e9b6d0588a53483634372c76847eaf533520dc7c
3
+ metadata.gz: 2390f7c0bb110d16dd19ad08cd75e166953b9cccf7c57215301ae997fd05bbe2
4
+ data.tar.gz: e91ec4e023247fd9ce4faf5e4f95a8b2723f801fd2b15bccd47ba7c519c674da
5
5
  SHA512:
6
- metadata.gz: 1a4bb20091c851bd558e173905fb2d57b835aa1de91c03c903f080b2fbe6b1b75f14e55bccfec21701743c1005b33d0106fbbdabb6a87d92e053e4d624ad15e6
7
- data.tar.gz: 32aa7376ea891b663daa3a0aa08a4dba0c814ff87ffe7da8c41fd22a53f602ee71c79d48c5c8e20c0e6b4fb6cbe447156e9a34cb1c8cbed2e8581db620627fa6
6
+ metadata.gz: b53882da825e403432228e0e83aa152ffb4846ae6a1f73a49b26ffc796b16c6cd78dcaafd356a39c26c96c77370c7a644bd20ca9329493dd6eeee4bc90323fd5
7
+ data.tar.gz: 2117e0d6c0bdcb1c31ad6acdf6aaa05322abe820060dd76683a93ed8d96f7c0b9183d37db5ca3df55949b852b83ea4713c9f7d99158ac44de1c1433102c0960e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,45 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.6.17] - 2026-08-06
4
+
5
+ ### Added
6
+
7
+ - NPM command install can bypass engines with ENV and engine-strict=false.
8
+
9
+ ### Fixed
10
+
11
+ - Ruby command gem action push interactive file selector did nothing.
12
+ - Git choice prompt did not permit optional empty values.
13
+
14
+ ## [0.4.40] - 2026-08-06
15
+
16
+ ### Changed
17
+
18
+ - Series method exclude? was made compatible with v0.8 signature.
19
+
20
+ ## [0.6.16] - 2026-07-04
21
+
22
+ ### Added
23
+
24
+ - Git command pull action all supports filter pattern negation.
25
+
26
+ ## [0.5.25] - 2026-07-04
27
+
28
+ ### Fixed
29
+
30
+ - See `0.4.39`.
31
+
32
+ ## [0.4.39] - 2026-07-04
33
+
34
+ ### Changed
35
+
36
+ - Common global argument OUT with a file separator overrides PIPE.
37
+
38
+ ### Fixed
39
+
40
+ - Git output list results did not hide footer when banner was disabled.
41
+ - Project banners which were empty were being printed.
42
+
3
43
  ## [0.6.15] - 2026-06-17
4
44
 
5
45
  ### Fixed
@@ -1717,6 +1757,8 @@
1717
1757
 
1718
1758
  - Changelog was created.
1719
1759
 
1760
+ [0.6.17]: https://github.com/anpham6/squared-ruby/releases/tag/v0.6.17
1761
+ [0.6.16]: https://github.com/anpham6/squared-ruby/releases/tag/v0.6.16
1720
1762
  [0.6.15]: https://github.com/anpham6/squared-ruby/releases/tag/v0.6.15
1721
1763
  [0.6.14]: https://github.com/anpham6/squared-ruby/releases/tag/v0.6.14
1722
1764
  [0.6.13]: https://github.com/anpham6/squared-ruby/releases/tag/v0.6.13
@@ -1733,6 +1775,7 @@
1733
1775
  [0.6.2]: https://github.com/anpham6/squared-ruby/releases/tag/v0.6.2
1734
1776
  [0.6.1]: https://github.com/anpham6/squared-ruby/releases/tag/v0.6.1
1735
1777
  [0.6.0]: https://github.com/anpham6/squared-ruby/releases/tag/v0.6.0
1778
+ [0.5.25]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.25
1736
1779
  [0.5.24]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.24
1737
1780
  [0.5.23]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.23
1738
1781
  [0.5.22]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.22
@@ -1758,6 +1801,8 @@
1758
1801
  [0.5.2]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.2-ruby
1759
1802
  [0.5.1]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.1-ruby
1760
1803
  [0.5.0]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.0-ruby
1804
+ [0.4.40]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.40
1805
+ [0.4.39]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.39
1761
1806
  [0.4.38]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.38
1762
1807
  [0.4.37]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.37
1763
1808
  [0.4.36]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.36
@@ -91,6 +91,13 @@ module Squared
91
91
  VAR[key.is_a?(::String) ? key.to_sym : key] = val
92
92
  end
93
93
 
94
+ def __arg__(key, name = nil, &blk)
95
+ ret = ARG[key.to_sym]
96
+ return ret unless name && ret.is_a?(::Hash)
97
+
98
+ ret[name = name.downcase] || (block_given? ? ret.fetch(name.to_sym, &blk) : ret[name.to_sym])
99
+ end
100
+
94
101
  def __freeze__
95
102
  PATH.freeze
96
103
  ARG.freeze
@@ -81,7 +81,7 @@ module Squared
81
81
  end}] "
82
82
  end
83
83
  end
84
- between = ->(s) { s.match?(/^\d+$/) && s.to_i.between?(min, max) }
84
+ between = ->(s) { s.match?(/^\d+$/) && s.to_i.between?(min, max <= min ? Float::INFINITY : max) }
85
85
  Timeout.timeout(timeout) do
86
86
  while (ch = Readline.readline(msg))
87
87
  unless (ch = ch.strip).empty?
@@ -173,11 +173,19 @@ module Squared
173
173
  end
174
174
 
175
175
  def env_pipe(key, default = 1, suffix: nil, strict: false, root: nil)
176
+ out = 1
176
177
  case key
177
178
  when ::String
178
179
  case (ret = env_value(key, suffix: suffix, strict: strict))
179
180
  when '0', '1', '2'
180
181
  return ret.to_i
182
+ else
183
+ out = default if default.is_a?(::Numeric)
184
+ if ret.include?(File::SEPARATOR)
185
+ default = ret
186
+ elsif key.include?(File::SEPARATOR)
187
+ default = key
188
+ end
181
189
  end
182
190
  when ::Numeric
183
191
  return key if key.between?(0, 2)
@@ -188,7 +196,7 @@ module Squared
188
196
  (root ? Pathname.new(root) + default : Pathname.new(default)).realdirpath
189
197
  rescue StandardError => e
190
198
  warn e
191
- 1
199
+ out
192
200
  end
193
201
  end
194
202
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Squared
4
- VERSION = '0.6.15'
4
+ VERSION = '0.6.17'
5
5
  end
@@ -116,7 +116,13 @@ module Squared
116
116
  @extensions = []
117
117
  @envname = env_key(@main).freeze
118
118
  self.exception = env_bool exception
119
- self.pipe = $DEBUG ? 2 : env_pipe(pipe, (ARG[:OUT] && env(ARG[:OUT])) || 1, root: @home)
119
+ self.pipe = if $DEBUG
120
+ 2
121
+ elsif (out = ARG[:OUT]) && out.include?(File::SEPARATOR)
122
+ env_pipe(out, pipe, root: home)
123
+ else
124
+ env_pipe(pipe, (out && env(out)) || 1, root: home)
125
+ end
120
126
  self.verbose = if $VERBOSE.nil?
121
127
  false
122
128
  elsif verbose.nil?
@@ -1409,7 +1409,7 @@ module Squared
1409
1409
  def env(key, default = nil, suffix: nil, equals: nil, ignore: nil, strict: false)
1410
1410
  name = "#{key}_#{@envname}"
1411
1411
  ret = if suffix
1412
- ENV.fetch("#{name}_#{suffix}", '')
1412
+ ENV["#{name}_#{suffix}"] || (ignore == false && ENV["#{key}_#{suffix}"]) || ''
1413
1413
  elsif strict
1414
1414
  ENV[name].to_s
1415
1415
  else
@@ -1551,7 +1551,7 @@ module Squared
1551
1551
  def print_item(*val, series: false)
1552
1552
  puts unless printfirst?
1553
1553
  printsucc unless series
1554
- puts val unless val.empty? || (val.size == 1 && !val.first)
1554
+ puts val unless val.empty? || (val.size == 1 && (!val.first || val.first.empty?))
1555
1555
  end
1556
1556
 
1557
1557
  def print_banner(*lines, client: false, styles: theme[:banner], border: borderstyle, **)
@@ -1711,7 +1711,7 @@ module Squared
1711
1711
  end
1712
1712
 
1713
1713
  def append_hash(data, target: @session || [], build: false)
1714
- if build && (type = env('BUILD', suffix: 'TYPE') || ENV['BUILD_TYPE'])
1714
+ if build && (type = env('BUILD', suffix: 'TYPE', ignore: false))
1715
1715
  if (extra = data[type = "__#{type}__"] || data[type.to_sym]).is_a?(Hash)
1716
1716
  data = data.merge(extra)
1717
1717
  else
@@ -1918,8 +1918,8 @@ module Squared
1918
1918
  args
1919
1919
  end
1920
1920
 
1921
- def confirm_basic(msg, hint, default = 'Y', style: :inline, target: @session, prefix: nil, **kwargs)
1922
- return true if prefix ? option('y', prefix: prefix) : target && option('y', target: target)
1921
+ def confirm_basic(msg, hint, default = 'Y', style: :inline, target: @session, prefix: target&.first, **kwargs)
1922
+ return true if option('y', prefix: prefix)
1923
1923
 
1924
1924
  confirm("#{msg} [#{sub_style(hint.to_s, style.is_a?(Symbol) ? theme[style] : style)}]", default, **kwargs)
1925
1925
  end
@@ -2053,13 +2053,29 @@ module Squared
2053
2053
  files.map { |val| val == '.' ? '.' : shell_quote(basepath(val)) }
2054
2054
  end
2055
2055
 
2056
- def matchmap(list, prefix = nil)
2057
- list.map do |val|
2058
- next val if val.is_a?(Regexp)
2059
-
2060
- val = ".*#{val}" if prefix && !val.sub!(/\A(\^|\\A)/, '')
2061
- Regexp.new("#{prefix}#{val == '*' ? '.+' : val}")
2056
+ def matchmap(list, prefix = nil, negate: false)
2057
+ ret = negate ? [[], []] : []
2058
+ list.each do |val|
2059
+ unless val.is_a?(Regexp)
2060
+ val = val.dup
2061
+ n = 1 if negate && val.delete_prefix!('!')
2062
+ if prefix
2063
+ a = nil
2064
+ val.sub!(/\A(\^|\\A)/) do |s|
2065
+ a = s
2066
+ nil
2067
+ end
2068
+ val = ".*#{val}" unless a
2069
+ end
2070
+ end
2071
+ pat = Regexp.new("#{a}#{prefix}#{val == '*' ? '.+' : val}")
2072
+ if negate
2073
+ ret[n || 0] << pat
2074
+ else
2075
+ ret << pat
2076
+ end
2062
2077
  end
2078
+ ret
2063
2079
  end
2064
2080
 
2065
2081
  def semver(val)
@@ -2500,6 +2516,10 @@ module Squared
2500
2516
  ARG[:BANNER] && !env('BANNER', equals: '0')
2501
2517
  end
2502
2518
 
2519
+ def dryrun?(*, target: @session, prefix: target&.first)
2520
+ Array(target).include?('--dry-run') || !option('dry-run', target: target, prefix: prefix).nil?
2521
+ end
2522
+
2503
2523
  def pwd?
2504
2524
  path == Pathname.pwd
2505
2525
  end
@@ -267,7 +267,7 @@ module Squared
267
267
  end
268
268
  end
269
269
  else
270
- format_desc action, flag, "opts*,id/name#{flag == :update ? '+' : '*'}"
270
+ format_desc action, flag, "opts*,id/name#{flag == :update || flag == :inspect ? '+' : '*'}"
271
271
  task flag do |_, args|
272
272
  container flag, args.to_a
273
273
  end
@@ -501,7 +501,7 @@ module Squared
501
501
  end
502
502
  end
503
503
  append_command(flag, id || tagmain, op.extras)
504
- when :update
504
+ when :update, :inspect
505
505
  raise_error ArgumentError, 'missing container', hint: flag if op.empty?
506
506
  op.append(escape: true, strip: /^:/)
507
507
  when :commit
@@ -141,7 +141,6 @@ module Squared
141
141
  end
142
142
  File.write(@revfile, JSON.pretty_generate(@revdoc))
143
143
  rescue StandardError => e
144
- log&.debug e
145
144
  warn log_warn(e, pass: true) if warning
146
145
  ensure
147
146
  @revlock = false
@@ -1010,14 +1009,14 @@ module Squared
1010
1009
  end
1011
1010
  op = OptionPartition.new(opts, OPT_GIT[:pull], cmd, project: self, no: OPT_GIT[:no][:pull])
1012
1011
  opts -= op.extras
1013
- reg = matchmap op
1012
+ reg, neg = matchmap(op, negate: true)
1014
1013
  session_done op.target
1015
1014
  heads = []
1016
1015
  cur = nil
1017
1016
  foreachref('heads', format: '%(if)%(HEAD)%(then)* %(end)%(refname:short)').each do |line|
1018
1017
  line.chomp!
1019
1018
  cur ||= line.delete_prefix!('* ')
1020
- heads << line if matchany?(line, reg)
1019
+ heads << line if matchany?(line, reg) && !matchany?(neg, line, empty: false)
1021
1020
  end
1022
1021
  raise_error 'head not found', hint: 'for-each-ref' unless cur
1023
1022
  opts << 'ff-only' if opts.empty? && !option('ff-only', equals: '0')
@@ -1186,7 +1185,7 @@ module Squared
1186
1185
  op.clear
1187
1186
  out, banner, from = source(io: true)
1188
1187
  print_item banner
1189
- list_result(write_lines(out), 'objects', from: from)
1188
+ list_result(write_lines(out), 'objects', banner: banner, from: from)
1190
1189
  return
1191
1190
  end
1192
1191
  else
@@ -1235,7 +1234,7 @@ module Squared
1235
1234
  end
1236
1235
  out, banner, from = source(io: true)
1237
1236
  ret = write_lines(out, banner: banner, sub: sub)
1238
- list_result(ret, 'files', action: 'modified', from: from)
1237
+ list_result(ret, 'files', action: 'modified', banner: banner, from: from)
1239
1238
  end
1240
1239
 
1241
1240
  def revbuild(flag = nil, opts = [], sync: nil, **kwargs)
@@ -1376,7 +1375,7 @@ module Squared
1376
1375
  out, banner, from = source(io: true)
1377
1376
  print_item banner
1378
1377
  ret = write_lines(out, grep: op.extras)
1379
- list_result(ret, 'tags', grep: op.extras, from: from)
1378
+ list_result(ret, 'tags', grep: op.extras, banner: banner, from: from)
1380
1379
  return
1381
1380
  end
1382
1381
  remote ||= option('remote')
@@ -1385,9 +1384,9 @@ module Squared
1385
1384
 
1386
1385
  def log!(flag, opts = [], range: [], index: [], grep: [])
1387
1386
  cmd, opts = git_session('log', opts: opts)
1388
- op = OptionPartition.new(opts, collect_hash(OPT_GIT[:log]), cmd, project: self,
1389
- no: collect_hash(OPT_GIT[:no][:log]),
1390
- first: matchpathspec)
1387
+ op = OptionPartition.new(opts, collect_hash(OPT_GIT[:log]), cmd,
1388
+ project: self, no: collect_hash(OPT_GIT[:no][:log]),
1389
+ first: matchpathspec)
1391
1390
  case flag
1392
1391
  when :between, :contain
1393
1392
  op.add_quote(range.join(flag == :between ? '..' : '...'))
@@ -1632,7 +1631,7 @@ module Squared
1632
1631
  opt_style(color(:green), /^(\*\s+)(\S+)(.*)$/, 2),
1633
1632
  opt_style(color(:red), %r{^(\s*)(remotes/\S+)(.*)$}, 2)
1634
1633
  ])
1635
- list_result(ret, 'branches', from: from)
1634
+ list_result(ret, 'branches', banner: banner, from: from)
1636
1635
  return
1637
1636
  else
1638
1637
  if (head = git_spawn('rev-parse --abbrev-ref HEAD').chomp).empty?
@@ -1641,7 +1640,7 @@ module Squared
1641
1640
  git_spawn 'fetch --all --prune --quiet' if option('sync')
1642
1641
  cmd << '-vv --no-abbrev --list'
1643
1642
  out, banner, from = source(io: true)
1644
- first = workspace.size > 1
1643
+ first = from_base?('branch')
1645
1644
  grep = first ? [/^\*\s+#{Regexp.escape(head)}\s/] : []
1646
1645
  ret = write_lines(out, grep: grep, banner: banner, first: first) do |line, index|
1647
1646
  next line if stdin?
@@ -1714,9 +1713,7 @@ module Squared
1714
1713
 
1715
1714
  def restore(flag, opts = [], commit: nil, files: nil)
1716
1715
  cmd, opts = git_session('restore', shell_option(flag, commit, escape: false, force: false), opts: opts)
1717
- op = OptionPartition.new(opts,
1718
- OPT_GIT[:restore] + OPT_GIT[:log][:diff_context],
1719
- cmd,
1716
+ op = OptionPartition.new(opts, OPT_GIT[:restore] + OPT_GIT[:log][:diff_context], cmd,
1720
1717
  project: self, no: OPT_GIT[:no][:restore], first: matchpathspec)
1721
1718
  append_pathspec(op.extras + (files || []), pass: false)
1722
1719
  source(sync: false, stderr: true)
@@ -1779,7 +1776,7 @@ module Squared
1779
1776
  out, banner, from = source(io: true)
1780
1777
  print_item banner
1781
1778
  ret = write_lines(out, grep: op.extras, prefix: "refs/#{flag}/")
1782
- list_result(ret, flag.to_s, grep: op.extras, from: from)
1779
+ list_result(ret, flag.to_s, grep: op.extras, banner: banner, from: from)
1783
1780
  end
1784
1781
 
1785
1782
  def ls_files(flag, opts = [])
@@ -1789,7 +1786,7 @@ module Squared
1789
1786
  out, banner, from = source(io: true)
1790
1787
  print_item banner
1791
1788
  ret = write_lines(out, grep: op.extras)
1792
- list_result(ret, 'files', grep: op.extras, from: from)
1789
+ list_result(ret, 'files', grep: op.extras, banner: banner, from: from)
1793
1790
  end
1794
1791
 
1795
1792
  def git(flag, opts = [])
@@ -1978,14 +1975,20 @@ module Squared
1978
1975
  ret += 1
1979
1976
  break if first
1980
1977
  end
1981
- print_item banner, out if banner && (ret > 0 || (!pass && !first))
1978
+ if banner && (ret > 0 || (!pass && !first))
1979
+ if banner.empty?
1980
+ print_item(*out)
1981
+ else
1982
+ print_item(banner, *out)
1983
+ end
1984
+ end
1982
1985
  ret
1983
1986
  end
1984
1987
 
1985
- def list_result(size, type, action: 'found', grep: [], from: nil)
1988
+ def list_result(size, type, action: 'found', grep: [], banner: nil, from: nil)
1986
1989
  if size == 0
1987
1990
  puts empty_status("No #{type} were #{action}", 'grep', grep.join(', '))
1988
- elsif stdout?
1991
+ elsif stdout? && (banner.nil? || (banner.is_a?(String) && !banner.empty?))
1989
1992
  styles = theme.fetch(:banner, []).reject { |s| s.to_s.end_with?('!') }
1990
1993
  styles << :bold if styles.size <= 1
1991
1994
  puts print_footer("#{size} #{size == 1 ? type.sub(/(?:(?<!l)e)?s\z/, '') : type}",
@@ -2017,7 +2020,7 @@ module Squared
2017
2020
  ret = choice_index('Choose a commit', git_spawn(cmd, stdout: false), column: /^(\S+)/, force: force, **kwargs)
2018
2021
  case ret
2019
2022
  when Array
2020
- ret.map!(&:stripstyle)
2023
+ ret.map { |val| val&.stripstyle }
2021
2024
  when String
2022
2025
  ret.stripstyle
2023
2026
  else
@@ -2193,10 +2196,6 @@ module Squared
2193
2196
  stdout: stdout, banner: banner, **kwargs)
2194
2197
  end
2195
2198
 
2196
- def dryrun?(*, target: @session, prefix: target&.first)
2197
- Array(target).include?('--dry-run') || !option('dry-run', target: target, prefix: prefix).nil?
2198
- end
2199
-
2200
2199
  def quiet?(*, target: @session, **)
2201
2200
  return silent? unless target
2202
2201
 
@@ -7,8 +7,8 @@ module Squared
7
7
  OPT_NPM = {
8
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
- install_a: %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,
10
+ install_a: %w[audit=! bin-links=! engine-strict=!? foreground-scripts=!? fund=! ignore-scripts=!?
11
+ install-links=!? package-lock=! strict-peer-deps=!? include=b install-strategy=b omit=b].freeze,
12
12
  install_b: %w[no-save B|save-bundle D|save-dev O|save-optional save-peer P|save-prod g|global=!?
13
13
  S|save=!?].freeze,
14
14
  run: %w[foreground-scripts=!? if-present=!? ignore-scripts=!? script-shell=p].freeze,
@@ -586,8 +586,7 @@ module Squared
586
586
  cmd << '--ignore-scripts' if option('ignore-scripts')
587
587
  cmd << '--dangerously-allow-all-builds' if option('approve-builds')
588
588
  else
589
- cmd = session 'npm'
590
- cmd << (ci = option('ci') ? 'ci' : 'install')
589
+ cmd = session('npm', (ci = option('ci', prefix: 'npm')) ? 'ci' : 'install')
591
590
  option('approve-scripts') do |val|
592
591
  cmd = npm_output 'approve-scripts'
593
592
  cmd << case val
@@ -601,6 +600,14 @@ module Squared
601
600
  print_run cmd, silent?
602
601
  run(cmd, banner: false)
603
602
  end
603
+ option('engine-strict', ignore: false) do |val|
604
+ cmd << case val
605
+ when '0', 'false'
606
+ '--engine-strict=false'
607
+ else
608
+ '--engine-strict'
609
+ end
610
+ end
604
611
  cmd << '--workspaces=false' if ws
605
612
  cmd << '--force' if option('force')
606
613
  append_nocolor
@@ -1359,8 +1366,8 @@ module Squared
1359
1366
  end
1360
1367
 
1361
1368
  def remove_modules(prefix = dependbin)
1362
- modules = basepath 'node_modules'
1363
- return false unless modules.directory? && confirm_basic('Remove?', modules, prefix: prefix)
1369
+ modules = basepath!('node_modules', type: 'd')
1370
+ return false unless modules && confirm_basic('Remove?', modules, prefix: prefix)
1364
1371
 
1365
1372
  modules.rmtree
1366
1373
  rescue Timeout::Error => e
@@ -31,8 +31,8 @@ module Squared
31
31
  root-user-action=b t|target=p upgrade-strategy=b].freeze,
32
32
  install_a: %w[ignore-requires-python no-index pre prefer-binary all-releases=b extra-index-url=q
33
33
  f|find-links=q i|index-url=q no-binary=q only-binary=q only-final=b uploaded-prior-to=q].freeze,
34
- install_b: %w[build-constraint check-build-dependencies no-build-isolation no-clean no-deps
35
- require-hashes use-pep517 c|constraint=p group=q progress-bar=b r|requirement=p
34
+ install_b: %w[check-build-dependencies no-build-isolation no-clean no-deps require-hashes use-pep517
35
+ build-constraint=p c|constraint=p group=q progress-bar=b r|requirement=p
36
36
  requirements-from-script=p src=p].freeze,
37
37
  install_c: %w[C|config-settings=q e|editable=v].freeze,
38
38
  hash: %w[a|algorithm].freeze,
@@ -185,7 +185,7 @@ module Squared
185
185
  log.warn "run script #{n} of #{list.size}".subhint('out of range')
186
186
  end
187
187
  else
188
- case i
188
+ case (i > 1 && poetry? ? 0 : i)
189
189
  when 0
190
190
  found |= 1
191
191
  run(session_output('poetry', 'run', val), from: :run)
@@ -936,6 +936,7 @@ module Squared
936
936
  buffer = []
937
937
  filter = kwargs.fetch(:filter, {})
938
938
  semver = filter[:semver]
939
+ dryrun = filter[:dryrun] || dryrun?(prefix: 'gem')
939
940
  update = if sync && filter[:select]
940
941
  semver ||= 'major'
941
942
  items = []
@@ -1089,7 +1090,7 @@ module Squared
1089
1090
  'user-install'
1090
1091
  end
1091
1092
  end
1092
- if filter[:dryrun]
1093
+ if dryrun
1093
1094
  print_run gem_output('update -f', *update.quote!), false
1094
1095
  else
1095
1096
  gem(:update, *update, opts: opts)
@@ -1131,8 +1132,8 @@ module Squared
1131
1132
  .clear(pass: false)
1132
1133
  end
1133
1134
  when :push
1134
- if op.empty? || (n = op.index(':'))
1135
- file = basepath(if !n && (spec = gemspec)
1135
+ if op.empty? || ia
1136
+ file = basepath(if !ia && (spec = gemspec)
1136
1137
  "#{spec.name}-#{spec.version}.gem"
1137
1138
  else
1138
1139
  choice_index 'Select a file', Dir.glob('*.gem', base: path)
@@ -246,8 +246,9 @@ module Squared
246
246
  already_invoked? parallel, val
247
247
  end
248
248
 
249
- def exclude?(key, empty = false)
250
- @exclude.include?(key) || (empty && (!key?(key) || self[key].empty?))
249
+ def exclude?(key, fallback = false, empty: nil)
250
+ fallback = empty unless empty.nil?
251
+ @exclude.include?(key) || (fallback && (!key?(key) || self[key].empty?))
251
252
  end
252
253
 
253
254
  private
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.6.15
4
+ version: 0.6.17
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.12
127
+ rubygems_version: 4.0.15
128
128
  specification_version: 4
129
129
  summary: Rake task generator for managing multi-language workspaces.
130
130
  test_files: []