squared 0.5.17 → 0.5.18

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: 91dfb7530ecdb1ab70461ab8bbbf894e706ea6f78b5e9ada99c930d0819e9ec9
4
- data.tar.gz: 82591aa893baf80057a3193e95763b8ce98c13593de54dffd00e31f0c27a3bf8
3
+ metadata.gz: 7c64d1ba5b8781c76d0dbbccf6cbedf66e217043fbfd2bc33220a8c2d60baa82
4
+ data.tar.gz: 0566e40b09f80693e1abbbf7e97de7bb92e952d5d2890be37340da34e0f24be3
5
5
  SHA512:
6
- metadata.gz: ce78218f60162cda536062dc37e5f27f30b5cd25e1afcac502c3519085988594c01ea149b47ecd536373ba2f4312162d468915fd6792f27f15d1d301bf2e03eb
7
- data.tar.gz: b0b6cec02ec4c531ddbabfa4ff1f3f8a87cf4592dd48fd86b74a8ac3787c602df165b0526cd69af8c585c221dcace1bcfc606a1bc511e3722f1e1b9cd1161e17
6
+ metadata.gz: 4ff0e0a44837f6fec6016680564f784968e0627367e727dfd30d1533f951f437b57ca746cc5876aa97ae05c11bc89ca79b149783e9082e15adc7d437e95c87e1
7
+ data.tar.gz: ac233a17a56d35be1008b1e598d875fe173e85d412eafd13477536a469da1de9e06f16c245c02c5e568b8250a4a8bbf2693b9859fc3e3231ac43ff0a661371e6
data/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.5.18] - 2025-11-25
4
+
5
+ ### Fixed
6
+
7
+ - See `0.5.18`.
8
+
9
+ ## [0.4.32] - 2025-11-25
10
+
11
+ ### Fixed
12
+
13
+ - Git method commit did not include --dry-run with add command.
14
+ - JoinSet method include? did not always search to start of delimiter.
15
+ - Config viewer did not check for a readable package registry document.
16
+ - Powershell executable did not check for alternate path location.
17
+
3
18
  ## [0.5.17] - 2025-11-22
4
19
 
5
20
  ### Fixed
@@ -112,7 +112,8 @@ module Squared
112
112
  end
113
113
 
114
114
  def shell_bin(name, env: true)
115
- key = name.upcase
115
+ key = name.to_s.upcase
116
+ key = File.basename(key, '.*') if Rake::Win32.windows?
116
117
  shell_quote((env && ENV["PATH_#{key}"]) || PATH[key] || PATH[key.to_sym] || name,
117
118
  option: false, force: false, double: true)
118
119
  end
@@ -22,8 +22,8 @@ module Squared
22
22
  nil
23
23
  end
24
24
 
25
- def link(project, main = project.dependfile.basename, name = nil, **kwargs, &blk)
26
- return unless project.enabled?
25
+ def link(project, main = project.dependfile&.basename, name = nil, **kwargs, &blk)
26
+ return unless project.enabled? && main
27
27
 
28
28
  ret = new(main, name, project: project, **kwargs)
29
29
  ret.instance_eval(&blk) if block_given?
@@ -159,7 +159,7 @@ module Squared
159
159
  end
160
160
 
161
161
  def also(path, type = nil, name: nil, **kwargs)
162
- return self if @mime.frozen? || !(file = basepath(path)).exist?
162
+ return self unless (file = basepath(path)).exist? && !@mime.frozen?
163
163
 
164
164
  ext = mimetype file
165
165
  type ||= ext
@@ -211,7 +211,7 @@ module Squared
211
211
  file = nil
212
212
  ext[0] = mime
213
213
  elsif file
214
- keys.prepend(file)
214
+ keys.unshift(file)
215
215
  alt = basepath "#{main}.{#{ext.join(',')}}"
216
216
  file = Dir[alt].first
217
217
  else
@@ -293,7 +293,7 @@ module Squared
293
293
  if stdin?
294
294
  puts out.map!(&:last).join("\n")
295
295
  else
296
- out.map! { |item| '%-*s : %s' % [pad, item[0], item[1]] }
296
+ out.map! { |a, b| '%-*s : %s' % [pad, a, b] }
297
297
  end
298
298
  end
299
299
 
@@ -309,7 +309,7 @@ module Squared
309
309
  return unless Rake::TaskManager.record_task_metadata
310
310
 
311
311
  val = "#{ext.first}[#{target ? '' : "file?=#{File.basename(main)}.#{ext.last},"}keys+]"
312
- args = *name.split(':').append(command, val)
312
+ args = *name.split(':').push(command, val)
313
313
  if project
314
314
  project.workspace.task_desc(*args)
315
315
  else
@@ -322,7 +322,9 @@ module Squared
322
322
  end
323
323
 
324
324
  def warning?
325
- project ? project.workspace.warning : true
325
+ return true unless project
326
+
327
+ project.workspace.warning
326
328
  end
327
329
 
328
330
  def stdin?
@@ -347,7 +349,9 @@ module Squared
347
349
  end
348
350
 
349
351
  def basepath(*args)
350
- project ? project.basepath(*args) : Pathname.pwd.join(*args)
352
+ return Pathname.pwd.join(*args) unless project
353
+
354
+ project.basepath(*args)
351
355
  end
352
356
  end
353
357
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Squared
4
- VERSION = '0.5.17'
4
+ VERSION = '0.5.18'
5
5
  end
@@ -29,7 +29,7 @@ module Squared
29
29
  self.impl_project = obj
30
30
  impl_series.base_set(obj)
31
31
  else
32
- kind_project.prepend(obj)
32
+ kind_project.unshift(obj)
33
33
  obj.tasks&.each { |task| impl_series.add(task, obj) }
34
34
  end
35
35
  if (args = obj.batchargs)
@@ -785,7 +785,7 @@ module Squared
785
785
  end
786
786
  end
787
787
  if step == -1
788
- level.prepend(data.action)
788
+ level.unshift(data.action)
789
789
  step = 0
790
790
  elsif step > 0
791
791
  (level[step -= 1] ||= []).concat(data.action)
@@ -365,7 +365,7 @@ module Squared
365
365
  when 'unpack'
366
366
  format_desc(action, flag, 'tag/url,dir,digest?,f|force?', before: flag == :ext ? 'ext' : nil)
367
367
  params = %i[tag dir digest force]
368
- params.prepend(:ext) if flag == :ext
368
+ params.unshift(:ext) if flag == :ext
369
369
  task flag, params do |_, args|
370
370
  ext = flag == :ext ? param_guard(action, flag, args: args, key: :ext) : flag.to_s
371
371
  tag = param_guard(action, flag, args: args, key: :tag)
@@ -402,7 +402,7 @@ module Squared
402
402
  @asdf[1].children
403
403
  .map(&:basename)
404
404
  .sort { |a, b| b <=> a }
405
- .append('latest', 'system'),
405
+ .push('latest', 'system'),
406
406
  force: true, accept: [['Confirm?', false, true]],
407
407
  values: ['Options'])
408
408
  OptionPartition.strip(opts)
@@ -533,7 +533,7 @@ module Squared
533
533
  flags = append_hash(flags, target: []).join(' ') if flags.is_a?(Hash)
534
534
  case opts
535
535
  when Hash
536
- cmd = Array(cmd).append(flags)
536
+ cmd = Array(cmd).push(flags)
537
537
  .concat(append_hash(opts, target: [], build: true))
538
538
  .compact
539
539
  .join(' ')
@@ -1770,7 +1770,7 @@ module Squared
1770
1770
  def command(*args)
1771
1771
  return args.join(' && ') unless workspace.powershell?
1772
1772
 
1773
- "powershell.exe -Command #{shell_quote("& {#{args.join(' ; ')}}", option: false, double: true)}"
1773
+ "#{shell_bin('powershell.exe')} -Command \"& {#{args.join(' ; ')}}\""
1774
1774
  end
1775
1775
 
1776
1776
  def relativepath(*list, all: false)
@@ -1457,13 +1457,14 @@ module Squared
1457
1457
  append_pathspec op.extras
1458
1458
  end
1459
1459
  co = git_session('commit', options: false)
1460
- pu = git_output 'push', upstream && '--set-upstream'
1460
+ pu = git_output 'push'
1461
+ co << '--amend' if amend
1462
+ pu << '--set-upstream' if upstream
1461
1463
  if dryrun?
1462
- op.delete('--dry-run')
1464
+ op.adjoin('--dry-run')
1463
1465
  co << '--dry-run'
1464
1466
  pu << '--dry-run'
1465
1467
  end
1466
- co << '--amend' if amend
1467
1468
  if message
1468
1469
  append_message message
1469
1470
  elsif flag == :'amend-orig' || option('edit', equals: '0')
@@ -1471,7 +1472,6 @@ module Squared
1471
1472
  end
1472
1473
  pu << '--force-with-lease' if amend
1473
1474
  pu.merge(repotrack(origin, branch))
1474
- puts if pass
1475
1475
  adding = git_spawn 'diff --name-only --no-color'
1476
1476
  source op
1477
1477
  cached = git_spawn 'diff --cached --name-only --no-color'
@@ -219,7 +219,7 @@ module Squared
219
219
  version = param_guard(action, 'version', args: args, key: :version)
220
220
  args = args.extras
221
221
  args << readline('Enter command', force: true) if args.empty?
222
- args.prepend(File.join(ENV['NVM_DIR'], 'nvm-exec'))
222
+ args.unshift(File.join(ENV['NVM_DIR'], 'nvm-exec'))
223
223
  run(args.join(' '), { 'NODE_VERSION' => version }, banner: false, from: :nvm)
224
224
  end
225
225
  when 'pack'
@@ -632,6 +632,7 @@ module Squared
632
632
  else
633
633
  footer.call(0, found.size)
634
634
  end
635
+ printsucc
635
636
  commit(:add, ['package.json'], pass: true)
636
637
  end
637
638
  elsif !avail.empty?
@@ -8,7 +8,7 @@ module Squared
8
8
  DIR_PYTHON = (DEP_PYTHON + %w[README.rst]).freeze
9
9
  OPT_PYTHON = {
10
10
  common: %w[b B d E h i I O P q s S u v x c=q m=b W=b X=q check-hash-based-pycs=b].freeze,
11
- build: %w[n|no-isolation s|sdist x|skip-dependency-check v|verbose w|wheel C|config-setting=q installer=b
11
+ build: %w[C=bm n|no-isolation s|sdist x|skip-dependency-check v|verbose w|wheel config-setting=q installer=b
12
12
  o|outdir=p].freeze,
13
13
  venv: %w[clear copies symlinks system-site-packages upgrade upgrade-deps without-scm-ignore-files without-pip
14
14
  prompt=q].freeze
@@ -516,7 +516,7 @@ module Squared
516
516
  c < d ? -1 : 1
517
517
  end
518
518
  end
519
- .append('')
519
+ .push('')
520
520
  .each do |val|
521
521
  next unless val.empty? || File.exist?(val.sub('$HOME', Dir.home))
522
522
 
@@ -921,7 +921,7 @@ module Squared
921
921
  out = `#{gem_output(opt, 'list --local -d', gemname)}`
922
922
  if out =~ /#{Regexp.escape(gemname)} \(([^)]+)\)/
923
923
  split_escape($1)
924
- .prepend(version)
924
+ .unshift(version)
925
925
  .uniq
926
926
  .each do |val|
927
927
  next unless out =~ /\(#{Regexp.escape(val)}(?:,[^)]+|\b)\):([^\n]+)/
@@ -558,7 +558,7 @@ module Squared
558
558
  end
559
559
 
560
560
  def last(val, pat)
561
- (@last ||= []).append([val, pat, $1]) if val =~ pat
561
+ (@last ||= []).push([val, pat, $1]) if val =~ pat
562
562
  self << val
563
563
  end
564
564
 
@@ -641,6 +641,13 @@ module Squared
641
641
  super + extras.size
642
642
  end
643
643
 
644
+ def include?(obj)
645
+ return true if super
646
+ return extras.include?(obj) unless (n = extras.index(@partition))
647
+
648
+ extras[0..n].include?(obj)
649
+ end
650
+
644
651
  def to_a
645
652
  pass
646
653
  end
@@ -663,6 +670,7 @@ module Squared
663
670
 
664
671
  alias add :<<
665
672
  alias add? :<<
673
+ alias member? include?
666
674
 
667
675
  private
668
676
 
@@ -216,7 +216,7 @@ module Squared
216
216
  end
217
217
  end
218
218
 
219
- series.sync.append(
219
+ series.sync.push(
220
220
  task_join(path, 'all'),
221
221
  task_join(path, 'init'),
222
222
  task_join(path, 'sync')
@@ -20,7 +20,7 @@ module Squared
20
20
 
21
21
  def expect(name)
22
22
  ret = project name
23
- return ret if ret&.path&.directory?
23
+ return ret if ret&.path&.directory? && !ret.path.empty?
24
24
 
25
25
  raise NoMethodError, "project is not initialized (#{name})"
26
26
  end
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.17
4
+ version: 0.5.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - An Pham