squared 0.4.20 → 0.4.22

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.
@@ -161,7 +161,7 @@ module Squared
161
161
  add: %w[A|all e|edit f|force ignore-errors ignore-missing ignore-removal i|interactive no-all
162
162
  no-ignore-removal n|dry-run p|patch pathspec-file-nul renormalize sparse u|update v|verbose
163
163
  chmod=b pathspec-from-file=p].freeze,
164
- branch: %w[a|all create-reflog i|ignore-case q|quiet r|remotes v|verbose vv abbrev=i color=b column=b
164
+ branch: %w[a|all create-reflog i|ignore-case q|quiet r|remotes v|verbose abbrev=i color=b column=b
165
165
  contains=b format=q merged=b no-contains=b no-merged=b points-at=b u|set-upstream-to=b sort=q
166
166
  t|track=b].freeze,
167
167
  checkout: %w[l d|detach f|force ignore-other-worktrees ignore-skip-worktree-bits m|merge p|patch
@@ -992,7 +992,7 @@ module Squared
992
992
  cur = nil
993
993
  foreachref('heads', format: '%(if)%(HEAD)%(then)* %(end)%(refname:short)').each do |line|
994
994
  line.chomp!
995
- cur ||= line.delete_prefix!('* ')
995
+ cur ||= line.sub!(/\A\* /, '')
996
996
  heads << line if matchany?(line, reg)
997
997
  end
998
998
  raise_error('head not found', hint: 'for-each-ref') unless cur
@@ -1234,7 +1234,7 @@ module Squared
1234
1234
  start = epochtime
1235
1235
  build(@output, sync: sync, from: :'git:revbuild')
1236
1236
  rescue StandardError => e
1237
- warn log_message(Logger::WARN, e, pass: true) if warning?
1237
+ print_error(e, pass: true)
1238
1238
  else
1239
1239
  print_status(name, subject: 'revbuild', start: start, from: :completed)
1240
1240
  workspace.rev_write(name, { 'revision' => sha, 'files' => status_digest(*args, **kwargs) },
@@ -1597,9 +1597,7 @@ module Squared
1597
1597
  end
1598
1598
  on :last, from
1599
1599
  end
1600
- if ret == 0
1601
- warn log_message(Logger::WARN, name, 'no ref found', subject: 'branch', hint: 'head', pass: true)
1602
- end
1600
+ print_error(name, 'no ref found', subject: 'branch', hint: 'head', pass: true) if ret == 0
1603
1601
  return
1604
1602
  end
1605
1603
  return unless success?(source(stdout: stdout))
@@ -1747,8 +1745,8 @@ module Squared
1747
1745
  end)
1748
1746
  case flag
1749
1747
  when :blame
1750
- raise_error 'no file found' unless (n = op.index { |s| (path + s).file? })
1751
- op << '--' << shell_quote(path + op.delete_at(n))
1748
+ raise_error 'no file found' unless (n = op.index { |s| basepath(s).file? })
1749
+ op << '--' << shell_quote(basepath(op.delete_at(n)))
1752
1750
  op.clear
1753
1751
  when :revert
1754
1752
  if VAL_GIT[:rebase][:send].any? { |val| op.arg?(val) }
@@ -1758,7 +1756,7 @@ module Squared
1758
1756
  else
1759
1757
  append_commit(*op.extras)
1760
1758
  end
1761
- when :add, :clean
1759
+ when :add
1762
1760
  if flag == :add && !op.arg?('pathspec-from-file')
1763
1761
  grep, list = op.partition { |val| OptionPartition.pattern?(val) }
1764
1762
  unless grep.empty? && !list.empty?
@@ -1785,8 +1783,8 @@ module Squared
1785
1783
  refs = projectmap op.extras
1786
1784
  raise_error 'no source/destination' unless refs.size > 1
1787
1785
  op.merge(refs)
1788
- when :rm
1789
- append_pathspec(op.extras, expect: true)
1786
+ when :rm, :clean
1787
+ append_pathspec(op.extras, expect: flag == :rm)
1790
1788
  end
1791
1789
  source(sync: false, stderr: true)
1792
1790
  end
@@ -1951,7 +1949,7 @@ module Squared
1951
1949
  next if !glob.empty? && glob.none? { |val| File.fnmatch?(val, file, File::FNM_DOTMATCH) }
1952
1950
  next if !pass.empty? && pass.any? { |val| File.fnmatch?(val, file, File::FNM_DOTMATCH) }
1953
1951
 
1954
- ret[file] = algorithm.hexdigest(File.read(path + file))
1952
+ ret[file] = algorithm.hexdigest(File.read(basepath(file)))
1955
1953
  end
1956
1954
  ret
1957
1955
  end
@@ -1983,7 +1981,7 @@ module Squared
1983
1981
  when 'recurse-submodules'
1984
1982
  op.append?($1, $2, type: :basic)
1985
1983
  when 'refspec'
1986
- refspec << shell_escape($2, quote: true)
1984
+ refspec << shell_quote($2)
1987
1985
  end
1988
1986
  elsif op.arg?('multiple')
1989
1987
  op.found << opt
@@ -2001,12 +1999,12 @@ module Squared
2001
1999
  end
2002
2000
  op.delete('--all')
2003
2001
  elsif op.arg?('multiple')
2004
- op.swap.merge(op.map! { |opt| shell_escape(opt, quote: true) })
2002
+ op.add_quote(*op.found)
2005
2003
  return
2006
2004
  elsif option('all')
2007
2005
  op << '--all'
2008
2006
  end
2009
- op.clear(errors: true, subject: flag.to_s) if flag
2007
+ op.clear(errors: true, subject: flag) if flag
2010
2008
  end
2011
2009
 
2012
2010
  def append_commit(*val, target: @session, head: false)
@@ -2145,7 +2143,7 @@ module Squared
2145
2143
  end
2146
2144
 
2147
2145
  def matchpathspec
2148
- [/\A[^a-z\d-]+/i, %r{\A[^=\\/*]*[\\/*]}]
2146
+ [/\A[^a-z\d-]+/i, %r{\A[^=\\/*]*[\\/*]}, /\A--\z/]
2149
2147
  end
2150
2148
 
2151
2149
  def messageopt
@@ -5,34 +5,34 @@ module Squared
5
5
  module Project
6
6
  class Node < Git
7
7
  OPT_NPM = {
8
- common: %w[dry-run=!? include-workspace-root=!? workspaces=!? w|workspace=v].freeze,
9
- install: %w[prefer-dedupe=!? package-lock-only=!? audit=! bin-links=! cpu=b fund=! libc=b os=b
10
- package-lock=!].freeze,
11
- install_base: %w[ignore-scripts=!? install-links=!? strict-peer-deps=!? include=b omit=b
12
- install-strategy=b].freeze,
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,
13
12
  install_no: %w[audit bin-links fund package-lock].freeze,
14
- install_as: %w[no-save save-bundle save-dev save-optional save-peer save-prod foreground-scripts=!?
13
+ install_as: %w[no-save save-bundle save-dev save-optional save-peer save-prod before=q foreground-scripts=!?
15
14
  g|global=!? S|save=!? E|save-exact=!?].freeze,
16
15
  run: %w[foreground-scripts=!? if-present=!? ignore-scripts=!? script-shell=p].freeze,
17
16
  exec: %w[c|call=q package=b].freeze,
18
- pack: %w[json=!? pack-destination=p].freeze
17
+ pack: %w[ignore-scripts=!? json=!? pack-destination=p].freeze
19
18
  }.freeze
20
19
  OPT_PNPM = {
21
20
  common: %w[aggregate-output color no-color stream use-stderr C|dir=p loglevel=b w|workspace-root].freeze,
21
+ cpu: %w[cpu=b libc=b os=b].freeze,
22
22
  filter: %w[fail-if-no-match changed-files-ignore-pattern=q filter=q filter-prod=q test-pattern=q].freeze,
23
23
  install: %w[fix-lockfile force ignore-pnpmfile ignore-workspace lockfile-only merge-git-branch-lockfiles
24
- no-hoist no-lockfile no-optional prefer-frozen-lockfile resolution-only shamefully-hoist
25
- side-effects-cache side-effects-cache-readonly s|silent strict-peer-dependencies
24
+ optimistic-repeat-install no-hoist no-lockfile no-optional prefer-frozen-lockfile resolution-only
25
+ shamefully-hoist side-effects-cache side-effects-cache-readonly s|silent strict-peer-dependencies
26
26
  use-running-store-server use-store-server child-concurrency=i hoist-pattern=q lockfile-dir=p
27
27
  modules-dir=p network-concurrency=i package-import-method=b public-hoist-pattern=q
28
28
  reporter=b].freeze,
29
29
  install_base: %w[global-dir ignore-scripts offline prefer-offline store-dir=p virtual-store-dir=p].freeze,
30
30
  install_no: %w[frozen-lockfile verify-store-integrity].freeze,
31
31
  install_as: %w[D|dev global-dir no-optional P|prod r|recursive].freeze,
32
- update: %w[global interactive latest depth=i].freeze,
32
+ update: %w[g|global i|interactive L|latest depth=i].freeze,
33
33
  dedupe: %w[check].freeze,
34
- run: %w[if-present no-bail parallel r|recursive report-summary reporter-hide-prefix resume-from sequential
35
- stream use-stderr].freeze,
34
+ run: %w[if-present no-bail parallel r|recursive report-summary reporter-hide-prefix resume-from
35
+ sequential].freeze,
36
36
  exec: %w[no-reporter-hide-prefix parallel r|recursive report-summary resume-from c|shell-mode].freeze,
37
37
  pack: %w[json pack-destination=p pack-gzip-level=i].freeze
38
38
  }.freeze
@@ -108,7 +108,7 @@ module Squared
108
108
  initialize_build(Node.ref, prod: prod?, **kwargs)
109
109
  initialize_env(**kwargs)
110
110
  end
111
- @dependfile = @path + 'package.json'
111
+ @dependfile = basepath 'package.json'
112
112
  @pm = { __: init }
113
113
  end
114
114
 
@@ -223,7 +223,7 @@ module Squared
223
223
  flags.each do |flag|
224
224
  case action
225
225
  when 'outdated'
226
- format_desc(action, flag, %w[prune interactive dry-run].freeze, arg: 'opts?')
226
+ format_desc(action, flag, %w[update interactive dry-run], arg: 'opts?')
227
227
  task flag do |_, args|
228
228
  outdated flag, args.to_a
229
229
  end
@@ -259,11 +259,6 @@ module Squared
259
259
  otp = args.first
260
260
  else
261
261
  tag, otp = param_guard(action, flag, args: args)
262
- unless SEM_VER.match?(tag)
263
- a = sub_style(project, styles: theme[:active])
264
- b = sub_style(tag, styles: theme[:inline])
265
- exit 1 unless confirm("Publish #{a}@#{b}? [y/N] ", 'N')
266
- end
267
262
  end
268
263
  publish(flag, otp: otp, tag: tag, dryrun: dryrun, access: access)
269
264
  end
@@ -371,7 +366,7 @@ module Squared
371
366
  subdir << target.to_s
372
367
  end
373
368
  begin
374
- FileUtils.cp(path + s, dest, verbose: verbose.is_a?(Numeric) && verbose > 0)
369
+ FileUtils.cp(basepath(s), dest, verbose: verbose.is_a?(Numeric) && verbose > 0)
375
370
  rescue StandardError => e
376
371
  print_error e
377
372
  errors += 1
@@ -386,7 +381,7 @@ module Squared
386
381
  end
387
382
  glob = Array(glob || '**/*')
388
383
  target = []
389
- from = path + from
384
+ from = basepath from
390
385
  if workspace
391
386
  Dir.glob(from + '*').each do |path|
392
387
  next unless (path = Pathname.new(path)).directory?
@@ -460,6 +455,7 @@ module Squared
460
455
  cmd << '--save-exact' if exact
461
456
  else
462
457
  cmd << 'install'
458
+ append_platform
463
459
  end
464
460
  if (val = option('public-hoist-pattern', ignore: false))
465
461
  split_escape(val).each { |opt| cmd << shell_option('public-hoist-pattern', opt) }
@@ -471,7 +467,9 @@ module Squared
471
467
  if flag == :add
472
468
  cmd << "--save-#{save}"
473
469
  cmd << '--save-exact' if exact
474
- cmd.merge(packages.map { |pkg| shell_escape(pkg) })
470
+ cmd.merge(packages.map { |pkg| shell_quote(pkg) })
471
+ else
472
+ append_platform
475
473
  end
476
474
  cmd << '--workspaces=false' if env('NODE_WORKSPACES', equals: '0')
477
475
  cmd << '--package-lock=false' if option('package-lock', equals: '0')
@@ -621,10 +619,13 @@ module Squared
621
619
  footer.call(modified, found.size)
622
620
  elsif modified > 0
623
621
  modified = -1
624
- footer.call(0, found.size)
625
622
  File.write(dependfile, doc)
623
+ if opts.include?('update') || opts.include?('u') || option('update')
624
+ update
625
+ else
626
+ footer.call(0, found.size)
627
+ end
626
628
  commit(:add, refs: ['package.json'], pass: true)
627
- install if opts.include?('prune') || opts.include?('p')
628
629
  end
629
630
  elsif !avail.empty?
630
631
  col1 = size_col.call(avail, 0) + 4
@@ -650,18 +651,23 @@ module Squared
650
651
  end
651
652
 
652
653
  def update(*)
653
- package('update', from: :update)
654
+ package(:update, from: :update)
654
655
  end
655
656
 
656
657
  def publish(flag = nil, *, sync: invoked_sync?('publish', flag), otp: nil, tag: nil, access: nil, dryrun: nil)
657
- if !version || read_packagemanager(:private)
658
- warn log_message(Logger::WARN, 'invalid task "publish"', subject: name, hint: version ? 'private' : nil)
658
+ unless version && !read_packagemanager(:private)
659
+ print_error('invalid task "publish"', subject: name, hint: version ? 'private' : nil)
659
660
  return
660
661
  end
661
662
  cmd = session 'npm', 'publish'
662
663
  cmd << basic_option('otp', otp) if otp ||= option('otp')
663
- cmd << basic_option('tag', tag) if tag ||= option('tag')
664
- cmd << basic_option('access', access) if access ||= option('access')
664
+ cmd << basic_option('tag', tag.tr(' ', '-')) if tag ||= option('tag')
665
+ case access || option('access')
666
+ when 'p', 'public'
667
+ cmd << '--access=public'
668
+ when 'r', 'restricted'
669
+ cmd << '--access=restricted'
670
+ end
665
671
  dryrun ||= dryrun?('npm')
666
672
  if dryrun
667
673
  cmd << '--dry-run'
@@ -689,15 +695,16 @@ module Squared
689
695
  workspace.rev_clear(name)
690
696
  if (yarn = dependtype(:yarn)) > 0
691
697
  cmd = session 'yarn', if flag == :update
692
- flag = yarn == 1 ? 'upgrade' : 'up'
698
+ yarn == 1 ? 'upgrade' : 'up'
693
699
  else
694
- flag
700
+ yarn == 1 && flag == :dedupe ? 'install' : flag
695
701
  end
696
702
  op = OptionPartition.new(opts, if yarn == 1
697
- OPT_YARN.fetch(flag, []) + OPT_YARN[:common]
703
+ OPT_YARN.fetch(flag == :dedupe ? :install : flag, []) + OPT_YARN[:common]
698
704
  else
699
705
  OPT_BERRY[flag]
700
706
  end, cmd, project: self)
707
+ op << '--ignore-engines' if yarn == 1 && !option('ignore-engines', equals: '0')
701
708
  op.clear
702
709
  append_loglevel
703
710
  else
@@ -705,20 +712,20 @@ module Squared
705
712
  cmd = session 'pnpm', flag
706
713
  list = OPT_PNPM[:install_base] + OPT_PNPM.fetch(flag, []) + OPT_PNPM[:common]
707
714
  list.concat(OPT_PNPM[:install_as] + OPT_PNPM[:filter]) unless flag == :dedupe
715
+ list.concat(OPT_PNPM[:cpu]) unless flag == :update
708
716
  no = OPT_PNPM[:"#{flag}_no"]
709
717
  else
710
718
  cmd = session 'npm', flag
711
719
  list = OPT_NPM[:install_base] + OPT_NPM.fetch(flag, []) + OPT_NPM[:common]
712
720
  list.concat(OPT_NPM[:install_as]) unless flag == :dedupe
713
721
  no = OPT_NPM[:install_no]
714
- cmd << '--save=true' if option('save')
715
722
  end
716
723
  op = OptionPartition.new(opts, list, cmd, no: no, project: self)
717
724
  op.each do |opt|
718
725
  if opt =~ op.values
719
726
  case $1
720
727
  when 'w', 'workspace'
721
- op << ($2.match?(%r{[\\/]}) ? quote_option($1, path + $2) : shell_option($1, $2))
728
+ op << ($2.match?(%r{[\\/]}) ? quote_option($1, basepath($2)) : shell_option($1, $2))
722
729
  end
723
730
  elsif opt.include?('=')
724
731
  op.errors << opt
@@ -727,12 +734,13 @@ module Squared
727
734
  end
728
735
  end
729
736
  op.swap
737
+ append_platform if flag == :install
730
738
  append_nocolor
731
739
  append_loglevel
732
740
  if flag == :dedupe
733
741
  op.clear
734
742
  else
735
- op.append(escape: true)
743
+ op.append(quote: true)
736
744
  end
737
745
  op.clear(errors: true)
738
746
  end
@@ -811,7 +819,7 @@ module Squared
811
819
 
812
820
  case $1
813
821
  when 'w', 'workspace'
814
- op << ($2.match?(%r{[\\/]}) ? quote_option($1, path + $2) : shell_option($1, $2))
822
+ op << ($2.match?(%r{[\\/]}) ? quote_option($1, basepath($2)) : shell_option($1, $2))
815
823
  op.found << opt
816
824
  end
817
825
  end
@@ -929,6 +937,14 @@ module Squared
929
937
  respond_to?(meth) && __send__(meth) ? @pm[prog] : 0
930
938
  end
931
939
 
940
+ def dependbin
941
+ if yarn?
942
+ 'yarn'
943
+ else
944
+ pnpm? ? 'pnpm' : 'npm'
945
+ end
946
+ end
947
+
932
948
  def version
933
949
  @version ||= read_packagemanager(:version)
934
950
  end
@@ -1009,11 +1025,11 @@ module Squared
1009
1025
  end
1010
1026
  end
1011
1027
 
1012
- def dependbin
1013
- if yarn?
1014
- 'yarn'
1015
- else
1016
- pnpm? ? 'pnpm' : 'npm'
1028
+ def append_platform(target: @session)
1029
+ %w[cpu os libc].each do |name|
1030
+ next unless (val = option(name))
1031
+
1032
+ target << basic_option(name, val)
1017
1033
  end
1018
1034
  end
1019
1035
 
@@ -207,7 +207,7 @@ module Squared
207
207
  if flag == :create
208
208
  format_desc action, flag, 'dir,opts*'
209
209
  task flag, [:dir] do |_, args|
210
- dir = path + param_guard(action, flag, args: args, key: :dir)
210
+ dir = basepath param_guard(action, flag, args: args, key: :dir)
211
211
  venv_create dir, args.extras
212
212
  end
213
213
  elsif venv
@@ -245,10 +245,7 @@ module Squared
245
245
  when :upgrade
246
246
  format_desc action, flag, 'opts*'
247
247
  task flag do |_, args|
248
- args = args.to_a
249
- args.unshift('upgrade')
250
- args << 'pip'
251
- install flag, args
248
+ install flag, ['upgrade', *args.to_a, 'pip']
252
249
  end
253
250
  when :freeze
254
251
  format_desc action, flag, "file?=#{DEP_PYTHON[4]},opts*"
@@ -351,7 +348,7 @@ module Squared
351
348
  when :user
352
349
  cmd << '--user'
353
350
  when :target
354
- cmd << quote_option('target', path + target)
351
+ cmd << quote_option('target', basepath(target))
355
352
  when :force
356
353
  cmd << '--force-reinstall'
357
354
  end
@@ -474,11 +471,7 @@ module Squared
474
471
  cmd << '--user' if user
475
472
  cmd << basic_option('upgrade-strategy', strategy) if strategy
476
473
  append_value out
477
- if workspace.windows?
478
- pip = cmd.to_a.drop(1)
479
- cmd = python_session '-m pip'
480
- cmd.merge(pip)
481
- end
474
+ python_session('-m pip', *cmd.to_a.drop(1)) if workspace.windows?
482
475
  end
483
476
  run(from: :install)
484
477
  end
@@ -515,7 +508,7 @@ module Squared
515
508
  if op.arg?(*args)
516
509
  op.push(srcdir)
517
510
  else
518
- op << quote_option(args.last, path + srcdir)
511
+ op << quote_option(args.last, basepath(srcdir))
519
512
  end
520
513
  srcdir = nil
521
514
  end
@@ -549,7 +542,7 @@ module Squared
549
542
  end
550
543
  op = OptionPartition.new(opts, list, @session, project: self, single: singleopt(flag))
551
544
  dist = lambda do
552
- (path + 'dist').tap do |dir|
545
+ basepath('dist').tap do |dir|
553
546
  raise_error('no source files found', hint: dir) unless dir.directory? && !dir.empty?
554
547
  end
555
548
  end
@@ -558,7 +551,7 @@ module Squared
558
551
  if op.empty?
559
552
  op.push("#{dist.call}/*")
560
553
  else
561
- op.map! { |val| path + val }
554
+ op.map! { |val| basepath(val) }
562
555
  end
563
556
  op.append
564
557
  else
@@ -629,7 +622,7 @@ module Squared
629
622
  def poetry_session(*cmd)
630
623
  ret = session('poetry', *cmd, *preopts)
631
624
  if (val = option('project', ignore: false))
632
- ret << quote_option('project', path + val)
625
+ ret << quote_option('project', basepath(val))
633
626
  end
634
627
  ret
635
628
  end
@@ -651,7 +644,7 @@ module Squared
651
644
  end
652
645
 
653
646
  def append_pip(flag, opts, target: @session, from: nil)
654
- if !from || opts.empty?
647
+ unless from && !opts.empty?
655
648
  append_global(target: target)
656
649
  return []
657
650
  end
@@ -674,11 +667,11 @@ module Squared
674
667
  end
675
668
  op.swap
676
669
  if edit
677
- edit = path + edit unless %r{\A[a-z]+(?:\+[a-z]+)?://}i.match?(edit)
670
+ edit = basepath(edit) unless %r{\A[a-z]+(?:\+[a-z]+)?://}i.match?(edit)
678
671
  if flag == :editable
679
672
  op.push(edit)
680
673
  else
681
- target << quote_option('e', edit)
674
+ op << quote_option('e', edit)
682
675
  end
683
676
  end
684
677
  case flag
@@ -689,25 +682,25 @@ module Squared
689
682
  []
690
683
  end
691
684
  else
692
- opts
685
+ op.extras
693
686
  end
694
687
  end
695
688
 
696
689
  def append_editable(target: @session)
697
- return if requirements?
690
+ return if requirements? && editable == '.'
698
691
 
699
692
  if (val = option('editable', 'e', target: target, ignore: false))
700
- session_delete('e', 'editable', target: target)
693
+ OptionPartition.delete_key(target, 'e', 'editable')
701
694
  case val
702
695
  when '0', 'false'
703
696
  return
704
697
  else
705
- val = path + val
698
+ val = basepath val
706
699
  end
707
700
  elsif session_arg?('e', 'editable', target: target) || !(val = editable)
708
701
  return
709
702
  end
710
- target << quote_option('e', val)
703
+ target << quote_option('e', basepath(val))
711
704
  end
712
705
 
713
706
  def append_global(target: @session)
@@ -716,11 +709,11 @@ module Squared
716
709
  when '0', 'false'
717
710
  '--no-cache-dir'
718
711
  else
719
- quote_option('cache-dir', path + val)
712
+ quote_option('cache-dir', basepath(val))
720
713
  end
721
714
  end
722
715
  target << shell_option('proxy', val) if (val = option('proxy', target: target))
723
- target << quote_option('python', path + val) if (val = option('python', target: target))
716
+ target << quote_option('python', basepath(val)) if (val = option('python', target: target))
724
717
  append_nocolor(target: target)
725
718
  end
726
719
 
@@ -842,7 +835,7 @@ module Squared
842
835
  when '.', Pathname
843
836
  val
844
837
  when String
845
- Pathname.new(editable)
838
+ Pathname.new(val) unless val.empty?
846
839
  end
847
840
  end
848
841
 
@@ -853,8 +846,7 @@ module Squared
853
846
  val, *opts = val
854
847
  @venvopts = opts
855
848
  end
856
- @venv = Pathname.new(val)
857
- @venv = @path + @venv unless @venv.absolute?
849
+ @venv = basepath(val)
858
850
  if projectpath?(@venv)
859
851
  if @venv.exist?
860
852
  log.debug "venv found: #{@venv}"