squared 0.6.6 → 0.6.7

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: eef895f1332463b52f24d46188726f55878170e90ba8ed9c7dcf1a1fac3bdd41
4
- data.tar.gz: d8ac6097a8ec74b0dd266558ad273e8ea23ba5994f5c79602875e6ce75d7367a
3
+ metadata.gz: 73203f27b80dac94c1a96127b27afeb60d939e27adc578724264c9db26380ac0
4
+ data.tar.gz: 308784d8e94aefcb5b2da4b75e6614bb94e6d1a5d66fc4754d7e72072655e588
5
5
  SHA512:
6
- metadata.gz: 8569824e8b5cedbb189666ba9e1b67590887afa004ac43bd5c42cc854cf1a61f51ea5709f16a0c55988cfc7ad5cadab0b4b751ce4864bbb46195f3bc97181248
7
- data.tar.gz: 7f3c48efd9652ee0ad67f5f35bfba87596e6c13f4bb5fb45ebd68aecfb2947e7f43c0ea7dad1bb04e365d45a001d82651e8b59f976274b07e6dda806d0e3bb4c
6
+ metadata.gz: 1f477ca8a24e892a052a2375283fbbf08af5cfc4714eaadba8c9465d59ad20e5d9bc6ae6cd624ff09780d62831cf2355918f01a851bbe09c52861d45479b1b6b
7
+ data.tar.gz: 289b353519bd3d5d7b13eb6f190428c74d9f4975e176094e65ba052a1febf28b2d719210efae09768cf0c3729d03b944bfd2344bde2025705cf2b0627d6bdfeb
data/CHANGELOG.md CHANGED
@@ -1,5 +1,36 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.6.7] - 2025-12-07
4
+
5
+ ### Added
6
+
7
+ - Docker command options were updated to 29.1.
8
+
9
+ ### Fixed
10
+
11
+ - Bundler did not recognize sub-commands options.
12
+ - Project graph did not use built-in comparison method.
13
+
14
+ ## [0.5.19] - 2025-12-07
15
+
16
+ ### Fixed
17
+
18
+ - See `0.4.33`.
19
+
20
+ ## [0.4.33] - 2025-12-07
21
+
22
+ ### Added
23
+
24
+ - Ruby attribute setter gemdir for copy method was created.
25
+ - Project inline run executables binary path are replaced with global alias.
26
+
27
+ ### Fixed
28
+
29
+ - Workspace class Series created non-existent keys when queried.
30
+ - Application class did not support changing base Project class.
31
+ - Git command rev action build did not check build? method.
32
+ - Python command build action python did not use outdir option.
33
+
3
34
  ## [0.6.6] - 2025-11-30
4
35
 
5
36
  ### Added
@@ -1493,6 +1524,7 @@
1493
1524
 
1494
1525
  - Changelog was created.
1495
1526
 
1527
+ [0.6.7]: https://github.com/anpham6/squared-ruby/releases/tag/v0.6.7
1496
1528
  [0.6.6]: https://github.com/anpham6/squared-ruby/releases/tag/v0.6.6
1497
1529
  [0.6.5]: https://github.com/anpham6/squared-ruby/releases/tag/v0.6.5
1498
1530
  [0.6.4]: https://github.com/anpham6/squared-ruby/releases/tag/v0.6.4
@@ -1500,6 +1532,7 @@
1500
1532
  [0.6.2]: https://github.com/anpham6/squared-ruby/releases/tag/v0.6.2
1501
1533
  [0.6.1]: https://github.com/anpham6/squared-ruby/releases/tag/v0.6.1
1502
1534
  [0.6.0]: https://github.com/anpham6/squared-ruby/releases/tag/v0.6.0
1535
+ [0.5.19]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.19
1503
1536
  [0.5.18]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.18
1504
1537
  [0.5.17]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.17
1505
1538
  [0.5.16]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.16
@@ -1519,6 +1552,7 @@
1519
1552
  [0.5.2]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.2-ruby
1520
1553
  [0.5.1]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.1-ruby
1521
1554
  [0.5.0]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.0-ruby
1555
+ [0.4.33]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.33
1522
1556
  [0.4.32]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.32
1523
1557
  [0.4.31]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.31
1524
1558
  [0.4.30]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.30
data/README.md CHANGED
@@ -712,7 +712,7 @@ GIT_AUTOSTASH_${NAME}=0 # rebase (project only)
712
712
 
713
713
  ### Docker
714
714
 
715
- * Version: [28.5](https://docs.docker.com/engine/release-notes/28)
715
+ * Version: [29.1](https://docs.docker.com/engine/release-notes/29)
716
716
 
717
717
  ```sh
718
718
  DOCKER_OPTIONS=q,no-cache # all
@@ -823,7 +823,7 @@ Features can be enabled through ENV when calling global tasks such as through *C
823
823
  | Command | Flag | ENV |
824
824
  | :--------- | :-------- | :---------------------------------------------------------------- |
825
825
  | depend | - | BINSTUBS=s JOBS=n |
826
- | outdated | - | U|UPDATE=major|minor|patch DRY_RUN |
826
+ | outdated | - | U|UPDATE=major|minor|patch ONLY_EXPLICIT DRY_RUN |
827
827
  | gem | outdated | DOCUMENT=0,1 USER_INSTALL=0,1 |
828
828
  | rbs | prototype | Y=0,1 |
829
829
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Squared
4
- VERSION = '0.6.6'
4
+ VERSION = '0.6.7'
5
5
  end
@@ -359,9 +359,9 @@ module Squared
359
359
  proj = ((if !ref.is_a?(Class)
360
360
  require_project ref
361
361
  Application.find(ref, path: path)
362
- elsif ref < Project::Base
362
+ elsif ref < Application.impl_project
363
363
  ref
364
- end) || @kind[name]&.last || Project::Base).new(self, path, name, **kwargs)
364
+ end) || @kind[name]&.last || Application.impl_project).new(self, path, name, **kwargs)
365
365
  proj.__send__(:index_set, size)
366
366
  @project[name] = proj
367
367
  __get__(:project)[name] = proj unless kwargs[:private]
@@ -537,7 +537,7 @@ module Squared
537
537
  end
538
538
  d = append_hash(d, target: []).join(' ') if d.is_a?(Hash)
539
539
  if a
540
- cmd << [a, d, b].compact.join(' ')
540
+ cmd << [replace_bin(a), d, b].compact.join(' ')
541
541
  else
542
542
  next unless respond_to?(:compose)
543
543
 
@@ -551,7 +551,7 @@ module Squared
551
551
  if cmd
552
552
  return run_b(cmd, sync: sync, from: from) if cmd.is_a?(Proc) || cmd.is_a?(Method)
553
553
 
554
- cmd = as_get cmd, from
554
+ cmd = replace_bin as_get(cmd, from)
555
555
  opts = compose(opts, script: false) if opts && respond_to?(:compose)
556
556
  flags = append_hash(flags, target: []).join(' ') if flags.is_a?(Hash)
557
557
  cmd = case opts
@@ -1358,13 +1358,7 @@ module Squared
1358
1358
  obj.enabled? ? [obj] : []
1359
1359
  else
1360
1360
  workspace.find(group: val, ref: val.to_sym)
1361
- end.sort do |a, b|
1362
- if a.parent == b
1363
- -1
1364
- else
1365
- b.parent == a ? 1 : 0
1366
- end
1367
- end.each do |proj|
1361
+ end.sort.each do |proj|
1368
1362
  next if pass.include?(name = proj.name)
1369
1363
 
1370
1364
  if proj.graph? && !data.key?(name) && !root.include?(name)
@@ -1872,6 +1866,13 @@ module Squared
1872
1866
  ret
1873
1867
  end
1874
1868
 
1869
+ def replace_bin(val)
1870
+ a, b = val.split(' ', 2)
1871
+ return val if val.start_with?(/["']/) || a.include?(File::Separator)
1872
+
1873
+ [shell_bin(a), b].compact.join(' ')
1874
+ end
1875
+
1875
1876
  def parse_json(val, kind: Hash, hint: nil)
1876
1877
  ret = JSON.parse(val)
1877
1878
  raise_error 'invalid JSON'.subhint(kind.name), val, hint: hint if kind && !ret.is_a?(kind)
@@ -13,7 +13,7 @@ module Squared
13
13
  buildx: {
14
14
  common: %w[builder=b D|debug],
15
15
  build: %w[add-host=q annotation=q attest=q build-arg=qq build-context=qq cache-from=q cache-to=q
16
- cgroup-parent=b iidfile=p label=q a-file=p network=b no-cache-filter=b o|output=q platform=b
16
+ cgroup-parent=b iidfile=p label=q network=b no-cache-filter=b o|output=q platform=q
17
17
  q|quiet secret=qq shm-size=b ssh=qq t|tag=b target=b ulimit=q].freeze,
18
18
  bake: %w[print list=q set=q].freeze,
19
19
  shared: %w[check load no-cache pull push allow=q call=b? f|file=p metadata-file=p progress=b provenance=q
@@ -40,22 +40,21 @@ module Squared
40
40
  rm t|tty use-api-socket add-host=q annotation=q a|attach=b blkio-weight=i blkio-weight-device=i
41
41
  cap-add=b cap-drop=b cgroup-parent=b cgroupns=b cidfile=p device=q device-cgroup-rule=q
42
42
  device-read-bps=q device-read-iops=q device-write-bps=q device-write-iops=q
43
- disable-content-trust=b? dns=q dns-option=q dns-search=q domainname=b entrypoint=q e|env=qq
44
- env-file=p expose=q gpus=q group-add=b health-cmd=q health-interval=b health-retries=i
45
- health-start-interval=q health-start-period=q health-timeout=q io-maxbandwidth=b io-maxiops=b
46
- ip=b ip6=q ipc=b isolation=b kernel-memory=b l|label=q label-file=q link=b link-local-ip=q
47
- log-driver=b log-opt=q mac-address=q m|memory=b memory-reservation=b memory-swap=n
48
- memory-swappiness=n mount=qq name=b network=b network-alias=b oom-score-adj=b pid=b pids-limit=n
49
- platform=b p|publish=q pull=b restart=b runtime=b security-opt=q shm-size=b stop-signal=b
50
- stop-timeout=i storage-opt=q sysctl=q tmpfs=q ulimit=q u|user=b userns=b uts=b v|volume=q
51
- volume-driver=b volumes-from=b w|workdir=q].freeze,
52
- run: %w[d|detach detach-keys=q hostname=q sig-proxy=b?].freeze,
43
+ dns=q dns-option=q dns-search=q domainname=b entrypoint=q e|env=qq env-file=p expose=q gpus=q
44
+ group-add=b health-cmd=q health-interval=b health-retries=i health-start-interval=q
45
+ health-start-period=q health-timeout=q hostname=q io-maxbandwidth=b io-maxiops=b ip=b ip6=q ipc=b
46
+ isolation=b l|label=q label-file=q link=b link-local-ip=q log-driver=b log-opt=q mac-address=q
47
+ m|memory=b memory-reservation=b memory-swap=n memory-swappiness=n mount=qq name=b network=b
48
+ network-alias=b oom-score-adj=b pid=b pids-limit=n platform=q p|publish=q pull=b restart=b
49
+ runtime=b security-opt=q shm-size=b stop-signal=b stop-timeout=i storage-opt=q sysctl=q tmpfs=q
50
+ ulimit=q u|user=b userns=b uts=b v|volume=q volume-driver=b volumes-from=b w|workdir=q].freeze,
51
+ run: %w[d|detach detach-keys=q sig-proxy=b?].freeze,
53
52
  update: %w[blkio-weight=i cpu-period=i cpu-quota=i cpu-rt-period=i cpu-rt-runtime=i c|cpu-shares=i cpus=f
54
- cpuset-cpus=b cpuset-mems=b m|memory=b memory-reservation=b memory-swap=b pids-limit=n
53
+ cpuset-cpus=b cpuset-mems=b m|memory=b memory-reservation=b memory-swap=n pids-limit=n
55
54
  restart=q].freeze,
56
- exec: %w[d|detach i|interactive privileged t|tty detach-keys=q e|env=qq env-file=p user=e
55
+ exec: %w[d|detach i|interactive privileged t|tty detach-keys=q e|env=qq env-file=p u|user=e
57
56
  w|workdir=q].freeze,
58
- commit: %w[a|author=q c|change=q m|message=q pause=b?].freeze,
57
+ commit: %w[no-pause a|author=q c|change=q m|message=q pause=b?].freeze,
59
58
  inspect: %w[s|size f|format=q type=b].freeze,
60
59
  start: %w[a|attach i|interactive detach-keys=q].freeze,
61
60
  stop: %w[s|signal=b t|timeout=i].freeze,
@@ -65,9 +64,9 @@ module Squared
65
64
  }.freeze,
66
65
  image: {
67
66
  ls: %w[a|all digests no-trunc q|quiet tree f|filter=q format=q].freeze,
68
- push: %w[a|all-tags disable-content-trust=b? platform=b q|quiet].freeze,
69
- rm: %w[f|force no-prune platform=b].freeze,
70
- save: %w[o|output=p platform=b].freeze
67
+ push: %w[a|all-tags platform=q q|quiet].freeze,
68
+ rm: %w[f|force no-prune platform=q].freeze,
69
+ save: %w[o|output=p platform=q].freeze
71
70
  }.freeze,
72
71
  network: {
73
72
  connect: %w[alias=b driver-opt=q gw-priority=n ip=b ip6=q link=b link-local-ip=q].freeze,
@@ -883,6 +883,8 @@ module Squared
883
883
  rev_parse(flag, ref: ref, size: size)
884
884
  end
885
885
  when :build
886
+ next unless build?
887
+
886
888
  format_desc action, flag, 'opts*'
887
889
  task flag do |_, args|
888
890
  revbuild flag, args.to_a
@@ -101,7 +101,7 @@ module Squared
101
101
 
102
102
  attr_reader :venv, :editable
103
103
 
104
- def initialize(*, editable: '.', verbose: nil, asdf: 'python', **kwargs)
104
+ def initialize(*, editable: '.', asdf: 'python', **kwargs)
105
105
  super
106
106
  if @pass.include?(Python.ref)
107
107
  initialize_ref Python.ref
@@ -344,7 +344,7 @@ module Squared
344
344
  when :poetry then 'output?'
345
345
  when :pdm then 'dest?'
346
346
  when :hatch then 'location?'
347
- else 'srcdir?'
347
+ else 'outdir?,srcdir?'
348
348
  end)
349
349
  task flag do |_, args|
350
350
  build! flag, args.to_a
@@ -582,36 +582,28 @@ module Squared
582
582
  cmd, opts = python_session('-m build', opts: opts)
583
583
  OPT_PYTHON[:build]
584
584
  end
585
- srcdir = nil
586
585
  op = OptionPartition.new(opts, list, cmd, project: self, single: singleopt(flag))
587
- op.each do |opt|
588
- if !srcdir && exist?(opt.chomp('*')) && projectpath?(opt.chomp('*'))
589
- srcdir = opt
590
- else
591
- op.found << opt
592
- end
593
- end
594
- op.swap
595
586
  case flag
596
- when :poetry, :pdm
597
- if srcdir
598
- args = flag == :pdm ? %w[d dest] : %w[o output]
599
- if op.arg?(*args)
600
- op.push(srcdir)
601
- else
602
- op << quote_option(args.last, basepath(srcdir))
603
- end
604
- srcdir = nil
605
- end
606
587
  when :hatch
607
- if ENV['HATCH_BUILD_LOCATION']
608
- srcdir = nil
609
- else
610
- srcdir ||= path
588
+ if !ENV['HATCH_BUILD_LOCATION'] && (outdir ||= op.shift)
589
+ op.add_path(outdir)
611
590
  end
612
591
  op << basic_option('p', project) unless ENV['HATCH_PROJECT'] || op.arg?('p', 'project')
592
+ else
593
+ unless op.empty?
594
+ args = case flag
595
+ when :poetry
596
+ %w[o output]
597
+ when :pdm
598
+ %w[d dest]
599
+ else
600
+ srcdir = true
601
+ %w[o outdir]
602
+ end
603
+ op << quote_option(args.last, basepath(op.shift)) unless op.arg?(*args)
604
+ end
613
605
  end
614
- op.add_path(srcdir) if srcdir
606
+ op.exist?(add: true, first: true) if srcdir
615
607
  op.clear
616
608
  run(from: :"#{flag}:build")
617
609
  end
@@ -41,6 +41,7 @@ module Squared
41
41
  common: %w[no-color V|verbose r|retry=i].freeze,
42
42
  common_all: %w[all all-platforms path=p].freeze,
43
43
  common_git: %w[branch=q git=q path=p ref=q].freeze,
44
+ common_version: %w[local major minor patch pre strict].freeze,
44
45
  add: %w[optimistic quiet skip-install strict github=q glob=q g|group=q require=q s|source=q
45
46
  v|version=q].freeze,
46
47
  binstubs: %w[force standalone shebang=q].freeze,
@@ -48,25 +49,27 @@ module Squared
48
49
  check: %w[dry-run gemfile=p path=p].freeze,
49
50
  clean: %w[dry-run force].freeze,
50
51
  config: %w[global local].freeze,
51
- doctor: %w[quiet gemfile=p].freeze,
52
+ doctor: %w[quiet ssl gemfile=p].freeze,
53
+ doctor_ssl: %w[host=q tls-version=b verify-mode=b].freeze,
52
54
  exec: %w[gemfile=p].freeze,
53
55
  gem: %w[b|bin git no-exe rubocop ci=b e|edit=p? ext=b github-username=q linter=b t|test=b?].freeze,
54
56
  init: %w[gemfile=p gemspec=p].freeze,
55
57
  install: %w[frozen no-cache no-prune system binstubs=p? path=p standalone=q? target-rbconfig=p trust-policy=b
56
58
  with=q without=q].freeze,
57
- install_a: %w[force full-index quiet redownload gemfile=p j|jobs=i].freeze,
58
- lock: %w[add-checksums conservative full-index local major minor normalize-platforms patch pre print strict
59
- add-platform=q bundler=b? gemfile=p lockfile=p remove-platform=p update=q?].freeze,
59
+ install_a: %w[force full-index local quiet redownload gemfile=p j|jobs=i].freeze,
60
+ lock: %w[add-checksums conservative full-index normalize-platforms print add-platform=q bundler=b? gemfile=p
61
+ lockfile=p remove-platform=p update=q?].freeze,
60
62
  open: %w[path=p].freeze,
61
- outdated: %w[filter-major filter-minor filter-patch groups local parseable pre only-explicit strict
63
+ outdated: %w[filter-major filter-minor filter-patch filter-strict groups parseable porcelain only-explicit
62
64
  update-strict group=q source=q].freeze,
63
65
  platform: %w[ruby].freeze,
64
66
  plugin: %w[source=q version=q].freeze,
67
+ plugin_uninstall: %w[all].freeze,
65
68
  remove: %w[install].freeze,
66
69
  show: %w[outdated paths].freeze,
67
70
  update: %w[all conservative local major minor patch pre ruby strict bundler=b? g|group=q source=q].freeze,
68
71
  no: {
69
- gem: %w[changelog ci coc linter mit test].freeze
72
+ gem: %w[changelog ci coc exe linter mit test].freeze
70
73
  }.freeze
71
74
  }.freeze
72
75
  OPT_GEM = {
@@ -79,8 +82,8 @@ module Squared
79
82
  cert: %w[a|add=p b|build=q C|certificate=p d|days=i l|list=q A|key-algorithm=b K|private-key=p r|remove=q
80
83
  R|re-sign s|sign=p].freeze,
81
84
  check: %w[a v|version=q].freeze,
82
- cleanup: %w[n d|dry-run].freeze,
83
- contents: %w[l all s|spec-dir=p v|version=q].freeze,
85
+ cleanup: %w[D n d|dry-run].freeze,
86
+ contents: %w[l all s|spec-dir=q v|version=q].freeze,
84
87
  dependency: %w[R pipe platform=q v|version=q].freeze,
85
88
  exec: %w[conservative g|gem=b v|version=q].freeze,
86
89
  fetch: %w[clear-sources platform=q v|version=q].freeze,
@@ -89,11 +92,11 @@ module Squared
89
92
  install: %w[v|version=q].freeze,
90
93
  install_a: %w[E f w conservative default development development-all explain ignore-dependencies N|no-document
91
94
  vendor n|bindir=p build-root=p document=b? g|file=p? i|install-dir=p platform=q
92
- target-rbconfig=p? P|trust-policy=b without=b].freeze,
95
+ target-rbconfig=p? P|trust-policy=b without=q].freeze,
93
96
  list: %w[d i I].freeze,
94
97
  lock: %w[s].freeze,
95
98
  open: %w[e|editor=p v|version=q].freeze,
96
- outdated: %w[C=p platform=q].freeze,
99
+ outdated: %w[platform=q].freeze,
97
100
  owner: %w[a|add=q r|remove=q p|http-proxy=q?].freeze,
98
101
  pristine: %w[E all only-executables only-missing-extensions only-plugins n|bindir=p i|install-dir=p skip=b
99
102
  v|version=q].freeze,
@@ -113,7 +116,7 @@ module Squared
113
116
  check: %w[alien doctor dry-run gems].freeze,
114
117
  cleanup: %w[check-development user-install].freeze,
115
118
  contents: %w[lib-only prefix show-install-dir].freeze,
116
- dependency: %w[http-proxy reverse-dependencies].freeze,
119
+ dependency: %w[http-proxy prerelease reverse-dependencies].freeze,
117
120
  exec: %w[prerelease].freeze,
118
121
  fetch: %w[http-proxy prerelease suggestions].freeze,
119
122
  generate_index: %w[compact modern].freeze,
@@ -381,7 +384,7 @@ module Squared
381
384
  flags.each do |flag|
382
385
  case action
383
386
  when 'outdated'
384
- format_desc action, flag, "#{shortname('i', 's', 'u', 'd')},opts*"
387
+ format_desc action, flag, "#{shortname('i', 's', 'u', 'd')},e/xplicit,opts*"
385
388
  task flag do |_, args|
386
389
  outdated flag, args.to_a
387
390
  end
@@ -585,6 +588,7 @@ module Squared
585
588
  se = has_value!(opts, 's', 'select')
586
589
  ia = has_value!(opts, 'i', 'interactive') && !se
587
590
  up = has_value!(opts, 'u', 'update')
591
+ opts << 'only-explicit' if has_value!(opts, 'e', 'explicit')
588
592
  dryrun = has_value!(opts, 'd', 'dry-run')
589
593
  if !sync || stdin?
590
594
  se = false
@@ -603,6 +607,7 @@ module Squared
603
607
  end
604
608
  items = []
605
609
  end
610
+ cmd << '--only-explicit' if option('only-explicit', prefix: 'bundle')
606
611
  dryrun ||= dryrun?(prefix: 'bundle')
607
612
  log.info cmd.to_s
608
613
  on :first, :outdated
@@ -908,7 +913,8 @@ module Squared
908
913
  when :build, :cert, :generate_index, :mirror, :outdated, :push, :server, :signin, :signout, :sources, :stale
909
914
  opts.concat(args)
910
915
  end
911
- op = OptionPartition.new(opts, gemopts(flag), gem_session(flag), project: self, no: OPT_GEM[:no][flag])
916
+ op = OptionPartition.new(opts, gemopts(flag), gem_session(flag),
917
+ project: self, no: OPT_GEM[:no][flag == :update ? :install : flag])
912
918
  from = :"gem:#{flag}"
913
919
  if flag == :outdated
914
920
  op.adjoin(gempwd, start: 0) if gempwd
@@ -1240,13 +1246,41 @@ module Squared
1240
1246
  end
1241
1247
  end
1242
1248
  opts = session_opts(with, args: args, kwargs: kwargs, pass: pass)
1249
+ invalid = ->(a) { raise_error ArgumentError, "unrecognized args: #{a.join(', ')}", hint: flag }
1250
+ cmd = bundle_session(flag)
1243
1251
  case flag
1244
- when :cache, :check, :clean, :doctor, :init, :install, :lock, :pack, :package, :platform
1252
+ when :cache, :check, :clean, :init, :install, :lock, :pack, :package, :platform
1245
1253
  pre = true
1246
1254
  opts.concat(args)
1255
+ when :doctor
1256
+ case (pre = (val = args.shift) || opts.shift)
1257
+ when 'diagnose', 'ssl'
1258
+ cmd << pre
1259
+ else
1260
+ if val
1261
+ args << val
1262
+ elsif pre
1263
+ opts << pre
1264
+ end
1265
+ pre = true
1266
+ end
1267
+ opts.concat(args)
1268
+ when :plugin
1269
+ case (plu = args.shift || opts.shift)
1270
+ when 'install', 'uninstall', 'help', 'list'
1271
+ cmd << plu
1272
+ else
1273
+ invalid.call(plu)
1274
+ end
1247
1275
  end
1248
- op = OptionPartition.new(opts, bundleopts(flag), bundle_session(flag),
1249
- project: self, no: OPT_BUNDLE[:no][flag], args: flag == :exec)
1276
+ op = OptionPartition.new(opts, bundleopts(if pre == 'ssl'
1277
+ :doctor_ssl
1278
+ elsif plu
1279
+ plu == 'install' ? :plugin : :"plugin_#{plu}"
1280
+ else
1281
+ flag
1282
+ end),
1283
+ cmd, proect: self, no: OPT_BUNDLE[:no][flag], args: flag == :exec)
1250
1284
  op.concat(args) unless pre
1251
1285
  output = false
1252
1286
  invalid = ->(a) { raise_error ArgumentError, "unrecognized args: #{a.join(', ')}", hint: flag }
@@ -1296,16 +1330,12 @@ module Squared
1296
1330
  op.clear
1297
1331
  end
1298
1332
  when :plugin
1299
- a = op.dup
1300
- case (b = op.shift)
1333
+ case plu
1301
1334
  when 'install', 'uninstall', 'help'
1302
1335
  op.append
1303
- when 'list'
1304
- op.clear
1305
1336
  else
1306
- invalid.call(a)
1337
+ op.clear
1307
1338
  end
1308
- op.adjoin(b, with: 'plugin')
1309
1339
  when :exec
1310
1340
  if op.empty? || (op.delete(':') && op.append(quote: false))
1311
1341
  op << readline('Enter arguments', force: true)
@@ -1634,6 +1664,8 @@ module Squared
1634
1664
  args << :common_git
1635
1665
  when :binstubs, :cache
1636
1666
  args << :common_all
1667
+ when :lock, :outdated
1668
+ args << :common_version
1637
1669
  end
1638
1670
  OPT_BUNDLE[:common] + args.flat_map { |name| OPT_BUNDLE.fetch(name, []) }
1639
1671
  end
@@ -39,8 +39,8 @@ module Squared
39
39
  def alias(ref, obj)
40
40
  if obj.is_a?(Hash)
41
41
  obj.each { |key, val| TASK_ALIAS[key][ref] = val }
42
- else
43
- TASK_ALIAS[obj]&.delete(ref)
42
+ elsif TASK_ALIAS.key?(obj)
43
+ TASK_ALIAS[obj].delete(ref)
44
44
  end
45
45
  end
46
46
 
@@ -176,6 +176,8 @@ module Squared
176
176
  end
177
177
 
178
178
  def alias_get(key)
179
+ return unless TASK_ALIAS.key?(key)
180
+
179
181
  TASK_ALIAS[key]
180
182
  end
181
183
 
@@ -193,10 +195,10 @@ module Squared
193
195
  end
194
196
 
195
197
  def extend?(obj, key)
196
- return false unless (items = TASK_EXTEND[key])
198
+ return false unless TASK_EXTEND.key?(key)
197
199
 
198
200
  ret = false
199
- items.each do |kind|
201
+ TASK_EXTEND[key].each do |kind|
200
202
  next unless obj.is_a?(kind)
201
203
 
202
204
  meth = :"#{key}?"
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.6
4
+ version: 0.6.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - An Pham