squared 0.6.2 → 0.6.4

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.
@@ -269,7 +269,7 @@ module Squared
269
269
  when :freeze
270
270
  format_desc action, flag, "file?=#{DEP_PYTHON[4]},opts*"
271
271
  task flag do |_, args|
272
- if (file = pip(flag, opts: args.to_a, banner: true)) && verbose
272
+ if (file = pip(flag, opts: args.to_a, banner: true)) && !silent?
273
273
  puts File.read(file)
274
274
  end
275
275
  end
@@ -330,7 +330,8 @@ module Squared
330
330
  end
331
331
  end
332
332
  when 'outdated'
333
- format_desc action, flag, 'eager?,user?,s/elect'
333
+ format_desc(action, flag, "eager?,no-deps?,#{shortname('h', 'i', 's', 'd')}",
334
+ before: ('user?' unless venv))
334
335
  task flag do |_, args|
335
336
  outdated flag, args.to_a
336
337
  end
@@ -406,21 +407,34 @@ module Squared
406
407
 
407
408
  def outdated(flag = nil, opts = [], sync: invoked_sync?('outdated', flag))
408
409
  cmd = pip_session 'list --outdated'
409
- cmd << '--not-required' unless flag || option('not-required', equals: '0')
410
+ cmd << if flag
411
+ se = has_value!(opts, 's', 'select')
412
+ ia = has_value!(opts, 'i', 'interactive') && !se
413
+ hide = has_value! opts, 'h', 'hide'
414
+ dryrun = has_value! opts, 'd', 'dry-run'
415
+ if !sync || stdin?
416
+ se = false
417
+ ia = false
418
+ elsif se || ia
419
+ items = []
420
+ end
421
+ '--not-required' if opts.include?('no-deps')
422
+ else
423
+ '--not-required' unless option('not-required', equals: '0')
424
+ end
410
425
  cmd << '--local' if option('l', 'local')
411
426
  append_global
427
+ dryrun ||= dryrun?
412
428
  cmd = session_done cmd
413
429
  log.info cmd
414
430
  on :first, :outdated
415
431
  banner = format_banner cmd
416
- items = if sync
417
- print_item banner
418
- [] if flag && has_value?(opts, 's', 'select') && !stdin?
419
- end
432
+ print_item banner if sync
420
433
  pwd_set(from: :outdated) do
421
434
  tc = theme[:current]
422
435
  start = 0
423
436
  found = 0
437
+ col = 0
424
438
  major = []
425
439
  minor = []
426
440
  patch = []
@@ -431,53 +445,58 @@ module Squared
431
445
  else
432
446
  IO.popen(runenv || {}, cmd)
433
447
  end.each do |line|
448
+ line.chomp!
434
449
  next if line.match?(/^[ -]+$/)
435
450
 
436
451
  if start > 0
452
+ n = line.size
437
453
  unless stdin?
438
454
  cur, lat = line.scan(SEM_VER)
439
455
  next unless cur && lat
440
456
 
441
- latest = lat.join
442
- current = cur.join
457
+ name = line.split(' ', 2).first
458
+ c = cur.join
459
+ l = lat.join
443
460
  semver cur
444
461
  semver lat
445
- name = line.split(' ', 2).first
446
- type = if semmajor?(cur, lat)
447
- major << name
448
- 2
449
- elsif cur[2] == lat[2]
450
- patch << name
451
- 0
452
- else
453
- minor << name
454
- 1
455
- end
456
- if type == 0
462
+ case (type = semtype(cur, lat))
463
+ when 1
464
+ major << name
465
+ when 2
466
+ minor << name
467
+ else
468
+ patch << name
469
+ end
470
+ next if hide && ((flag == :patch && type < 3) || (flag == :minor && type < 2))
471
+
472
+ if type == 3
457
473
  styles = color(:yellow)
458
474
  else
459
475
  styles = color(:green)
460
- line = sub_style(line, styles: if type == 2
461
- styles += [:bold]
462
- theme[:major]
463
- else
464
- theme[:active]
465
- end, pat: /^(\S+)(.+)$/)
476
+ sub_style!(line, if type == 1
477
+ styles += [:bold]
478
+ theme[:major]
479
+ else
480
+ theme[:active]
481
+ end, pat: /^(\S+)(.+)$/)
466
482
  end
467
- line = sub_style(line, **opt_style(tc, /^(.+)(#{Regexp.escape(current)})(.+)$/, 2)) if tc
468
- line = sub_style(line, **opt_style(styles, /^(.+)(#{Regexp.escape(latest)})(.+)$/, 2))
483
+ sub_style!(line, **opt_style(tc, /^(.+)(#{Regexp.escape(c)})(.+)$/, 2)) if tc
484
+ sub_style!(line, **opt_style(styles, /^(.+)(#{Regexp.escape(l)})(.+)$/, 2))
469
485
  found += 1
470
486
  end
471
- if items
472
- items << [line, name]
473
- else
474
- out.call("#{start.to_s.rjust(2)}. #{line}")
475
- end
487
+ s = '%2d. %s' % [start, line]
476
488
  start += 1
489
+ if ia
490
+ next unless confirm_semver(s.ljust(col + line.size - n), type)
491
+ elsif !se
492
+ out.call(s)
493
+ end
494
+ items&.push([line, name])
477
495
  elsif line.start_with?('Package')
478
496
  unless stdin?
497
+ col = line.size + 5
479
498
  sub = [opt_style(theme[:header], /^(.*)(?<!\dm)(Package|Latest)(.+)$/, 2)] * 2
480
- out.call(print_footer(" # #{line.chomp}", reverse: true, sub: sub))
499
+ out.call(print_footer(" # #{line}", reverse: true, sub: sub))
481
500
  end
482
501
  start += 1
483
502
  end
@@ -487,9 +506,11 @@ module Squared
487
506
  puts buffer
488
507
  end
489
508
  if found > 0
490
- if items
509
+ if se
491
510
  choice('Select a package', items.map(&:first),
492
511
  multiple: true, force: false, index: true, border: true).map! { |n| items[n.pred].last }
512
+ elsif ia
513
+ items.map(&:last)
493
514
  else
494
515
  case flag
495
516
  when :major
@@ -501,11 +522,19 @@ module Squared
501
522
  end
502
523
  end.tap do |packages|
503
524
  unless packages.empty?
504
- install(:upgrade, opts.grep(/^(?:eager|user)$/), packages: packages, banner: false)
525
+ base = %w[eager no-deps]
526
+ base << 'user' unless venv
527
+ opts = (base & opts).map! { |val| val == 'eager' ? "upgrade-strategy=#{val}" : val }
528
+ if dryrun
529
+ opts.map! { |val| fill_option(val) }
530
+ print_run pip_output('install --upgrade', *opts, *packages.quote!), false
531
+ else
532
+ install(:upgrade, opts, packages: packages, banner: false)
533
+ end
505
534
  end
506
535
  print_status(major.size, minor.size, patch.size, from: :outdated)
507
536
  end
508
- elsif start == 0
537
+ elsif start == 0 || hide
509
538
  puts 'No updates were found'
510
539
  end
511
540
  end
@@ -730,7 +759,7 @@ module Squared
730
759
  end
731
760
 
732
761
  def outdated?
733
- dependtype > 0
762
+ dependtype > 0 && !task_pass?('outdated')
734
763
  end
735
764
 
736
765
  private
@@ -739,6 +768,10 @@ module Squared
739
768
  session('pip', *cmd, *preopts, path: venv.nil?)
740
769
  end
741
770
 
771
+ def pip_output(*cmd)
772
+ session_output('pip', *cmd, *preopts, path: venv.nil?)
773
+ end
774
+
742
775
  def python_session(*cmd, opts: nil)
743
776
  return session('python', *preopts(quiet: false), *cmd, path: venv.nil?) unless opts
744
777
 
@@ -769,11 +802,11 @@ module Squared
769
802
 
770
803
  def append_pip(flag, opts, target: @session, from: nil)
771
804
  list = OPT_PIP.fetch(from, []) + OPT_PIP[:common]
772
- if pip_install?(flag)
805
+ if pip_install?(flag) || from == :install
773
806
  list.concat(OPT_PIP[:install_a])
774
807
  list.concat(OPT_PIP[:install_b]) unless flag == :index
775
808
  case flag
776
- when :install
809
+ when :install, :editable, :upgrade
777
810
  list.concat(OPT_PIP[:install_c] + OPT_PIP[:debug])
778
811
  when :lock, :wheel
779
812
  list.concat(OPT_PIP[:install_c])
@@ -785,7 +818,7 @@ module Squared
785
818
  op = OptionPartition.new(opts, list, target, project: self, single: singleopt)
786
819
  append_global(target: target)
787
820
  case flag
788
- when :install, :lock, :wheel
821
+ when :install, :lock, :wheel, :editable, :upgrade
789
822
  edit = nil
790
823
  op.each do |opt|
791
824
  if opt =~ op.values
@@ -994,10 +1027,10 @@ module Squared
994
1027
  def venv_init
995
1028
  return if !venv || (venvbin.directory? && !venvbin.empty?)
996
1029
 
997
- puts log_message(Logger::INFO, venv, subject: 'venv', hint: 'init')
1030
+ puts log_message(venv, subject: 'venv', hint: 'init')
998
1031
  opts = @venvopts&.map { |val| OptionPartition.strip(val) }&.flatten
999
1032
  venv_create(venv, opts || ["prompt=#{name}", 'upgrade-deps'], env: false, banner: false)
1000
- puts log_message(Logger::INFO, venv, subject: 'venv', hint: 'created')
1033
+ puts log_message(venv, subject: 'venv', hint: 'created')
1001
1034
  end
1002
1035
 
1003
1036
  def venv_create(dir, opts = [], env: nil, banner: true)
@@ -157,7 +157,7 @@ module Squared
157
157
  end
158
158
 
159
159
  subtasks({
160
- 'outdated' => %i[patch minor major].freeze,
160
+ 'outdated' => %i[major minor patch].freeze,
161
161
  'ruby' => %i[file script version].freeze,
162
162
  'gem' => %i[install uninstall outdated update pristine build push exec command].freeze,
163
163
  'bundle' => %i[install update cache exec config reinstall command].freeze,
@@ -334,14 +334,14 @@ module Squared
334
334
  flags.each do |flag|
335
335
  case action
336
336
  when 'outdated'
337
- format_desc action, flag, 's/elect?,u/pdate?,opts*'
337
+ format_desc action, flag, "#{shortname('i', 's', 'u', 'd')},opts*"
338
338
  task flag do |_, args|
339
- __send__ action, flag, args.to_a
339
+ outdated flag, args.to_a
340
340
  end
341
341
  when 'gem'
342
342
  case flag
343
343
  when :outdated
344
- format_desc action, flag, 'semver?=major|minor|patch,i/nteractive?,s/elect?,u/pdate?,opts*'
344
+ format_desc action, flag, "semver?=major|minor|patch,#{shortname('i', 's', 'u', 'd')},opts*"
345
345
  task flag, [:semver] do |_, args|
346
346
  opts = case (semver = args.semver)
347
347
  when 'major', 'minor', 'patch'
@@ -354,13 +354,14 @@ module Squared
354
354
  semver: semver,
355
355
  update: has_value!(opts, 'u', 'update'),
356
356
  interactive: has_value!(opts, 'i', 'interactive'),
357
- select: has_value!(opts, 's', 'select')
357
+ select: has_value!(opts, 's', 'select'),
358
+ dryrun: has_value!(opts, 'd', 'dry-run')
358
359
  })
359
360
  end
360
361
  when :build, :push, :exec, :update
361
362
  format_desc(action, flag, 'opts*', after: case flag
362
363
  when :exec then 'command,args*'
363
- when :push then 'file?|:'
364
+ when :push then 'file/:'
364
365
  when :update then 'name*'
365
366
  end)
366
367
  task flag do |_, args|
@@ -507,7 +508,7 @@ module Squared
507
508
  b = dest + val
508
509
  c = glob[i] || glob.first
509
510
  log.info "cp #{a + c} #{b}"
510
- copy_dir(a, b, c, pass: pass, verbose: verbosetype > 0)
511
+ copy_dir(a, b, c, pass: pass, verbose: !silent?)
511
512
  rescue StandardError => e
512
513
  on_error e, :copy
513
514
  end
@@ -517,44 +518,54 @@ module Squared
517
518
  def outdated(flag = nil, opts = [], sync: invoked_sync?('outdated', flag))
518
519
  cmd = bundle_output 'outdated'
519
520
  if flag
520
- se = has_value!(opts, 's', 'select') && !stdin?
521
+ se = has_value!(opts, 's', 'select')
522
+ ia = has_value!(opts, 'i', 'interactive') && !se
521
523
  up = has_value!(opts, 'u', 'update')
522
- cmd << "--#{flag}"
523
- OptionPartition.new(opts, bundleopts(:outdated), cmd, project: self)
524
+ dryrun = has_value!(opts, 'd', 'dry-run')
525
+ if !sync || stdin?
526
+ se = false
527
+ ia = false
528
+ elsif se || ia || up
529
+ items = []
530
+ end
531
+ OptionPartition.new(opts, bundleopts(:outdated), cmd << "--#{flag}", project: self)
524
532
  .clear
525
533
  end
534
+ dryrun ||= dryrun?(prefix: 'bundle')
526
535
  log.info cmd.to_s
527
536
  on :first, :outdated
528
537
  banner = format_banner cmd.to_s
529
- items = if sync
530
- print_item banner
531
- [] if flag && (se || up)
532
- end
538
+ print_item banner if sync
533
539
  pwd_set(from: :outdated) do
534
540
  tc = theme[:current]
535
541
  start = 0
536
542
  found = 0
537
543
  major = 0
544
+ col = 0
538
545
  buffer = []
539
546
  out = ->(val) { sync ? puts(val) : buffer << val }
540
547
  IO.popen(cmd.temp('--no-color')).each do |line|
548
+ line.chomp!
541
549
  if start > 0
550
+ n = line.size
542
551
  unless stdin?
552
+ line = line[0...col] if col > 0
543
553
  data = line.scan(SEM_VER)
544
554
  next unless (cur = data.shift) && (lat = data.shift)
545
555
 
546
556
  semver cur
547
557
  semver lat
558
+ type = semtype cur, lat
548
559
  c = cur.join
549
560
  l = lat.join
550
561
  styles = []
551
- major_set = lambda do
562
+ ma = lambda do
552
563
  styles = %i[green bold]
553
564
  major += 1
554
565
  end
555
- minor_set = -> { styles[0] = cur[2] == lat[2] ? :yellow : :green }
566
+ mi = -> { styles[0] = type == 2 ? :yellow : :green }
556
567
  if data.empty?
557
- semmajor?(cur, lat) ? major_set.call : minor_set.call
568
+ type == 1 ? ma.call : mi.call
558
569
  else
559
570
  data.each do |val|
560
571
  break unless line =~ /(>=?|=|~>|!=|<=?) (#{Regexp.escape(val.join)})/
@@ -562,11 +573,11 @@ module Squared
562
573
  v = semver(val).join
563
574
  case $1
564
575
  when '>', '>='
565
- semmajor?(cur, lat) ? major_set.call : minor_set.call
576
+ type == 1 ? ma.call : mi.call
566
577
  when '<', '<='
567
578
  if c <= v
568
- if semmajor?(cur, lat)
569
- major_set.call
579
+ if type == 1
580
+ ma.call
570
581
  else
571
582
  styles[0] = :yellow
572
583
  end
@@ -592,22 +603,33 @@ module Squared
592
603
  unless styles.empty?
593
604
  case styles.first
594
605
  when :green
595
- line = sub_style(line, **opt_style(theme[styles.last == :bold ? :major : :active], /^(\S+)(.+)$/))
606
+ sub_style!(line, **opt_style(theme[styles.last == :bold ? :major : :active], /^(\S+)(.+)$/))
596
607
  found += 1
597
608
  when :yellow
598
609
  found += 1
599
610
  end
600
- l = Regexp.escape(l)
601
- line = sub_style(line, **opt_style(tc, /^(.+)(#{Regexp.escape(c)})(.+)$/, 2)) if tc
602
- line = sub_style(line, **opt_style(colormap(styles), /^((?:\S+\s+){2})(#{l})(.*)$/, 2))
611
+ sub_style!(line, **opt_style(tc, /^(.+)(#{Regexp.escape(c)})(.+)$/, 2)) if tc
612
+ sub_style!(line, **opt_style(colormap(styles), /^((?:\S+\s+){2})(#{Regexp.escape(l)})(.*)$/, 2))
603
613
  end
604
614
  end
615
+ s = '%2d. %s' % [start, line]
616
+ if ia
617
+ unless confirm_semver(s.ljust(col + 4 + line.size - n), type)
618
+ start += 1
619
+ next
620
+ end
621
+ elsif !se
622
+ out.call(s)
623
+ end
605
624
  items&.push([line, name])
606
- out.call('%2d. %s' % [start, line]) unless se
607
625
  elsif line.start_with?('Gem')
608
626
  unless stdin?
627
+ if ia
628
+ line.sub!(/\sGroups$/, '')
629
+ col = line.size
630
+ end
609
631
  sub = [opt_style(theme[:header], /^(.+)(?<!\dm)(Gem|Latest)(.+)$/, 2)] * 2
610
- out.call(print_footer(" # #{line.chomp}", reverse: true, sub: sub))
632
+ out.call(print_footer(" # #{line}", reverse: true, sub: sub))
611
633
  end
612
634
  else
613
635
  next
@@ -619,26 +641,30 @@ module Squared
619
641
  puts buffer
620
642
  end
621
643
  if found > 0
622
- if items
644
+ unless Array(items).empty?
623
645
  gems = if se
624
646
  choice('Select a package', items.map(&:first),
625
647
  multiple: true, force: false, index: true, border: true).map! { |n| items[n.pred].last }
626
648
  else
627
649
  items.map(&:last)
628
650
  end
629
- bundle(:update, *gems, opts: [flag.to_s])
651
+ if dryrun
652
+ print_run bundle_output("update --#{flag}", *gems.quote!), false
653
+ else
654
+ bundle(:update, *gems, opts: [flag.to_s])
655
+ end
630
656
  end
631
657
  begin
632
- if major == 0 && dependfile.read =~ /\b(?:source\s+(["'])((?~\1))\1|remote:\s+(\S+))/
633
- status = ($2 || $3).chomp('/')
634
- right = true
635
- end
658
+ status = if gems
659
+ "#{gems.size} packages were updated"
660
+ elsif dependfile.read =~ /\b(?:source\s+(["'])((?~\1))\1|remote:\s+(\S+))/
661
+ right = true
662
+ ($2 || $3).chomp('/')
663
+ end
636
664
  rescue StandardError => e
637
665
  log.debug e
638
- ensure
639
- status ||= (items ? 'Updates were made' : 'Updates are available')
640
666
  end
641
- puts print_footer(empty_status(status, 'major', major, always: !right), right: right)
667
+ puts print_footer(status || 'Updates are available', right: right)
642
668
  elsif start == 0 && banner
643
669
  puts 'No updates were found'
644
670
  end
@@ -799,8 +825,7 @@ module Squared
799
825
  when :build, :cert, :generate_index, :mirror, :outdated, :push, :server, :signin, :signout, :sources, :stale
800
826
  opts.concat(args)
801
827
  end
802
- op = OptionPartition.new(opts, gemopts(flag), gem_session(flag, *preopts), project: self,
803
- no: OPT_GEM[:no][flag])
828
+ op = OptionPartition.new(opts, gemopts(flag), gem_session(flag), project: self, no: OPT_GEM[:no][flag])
804
829
  from = :"gem:#{flag}"
805
830
  if flag == :outdated
806
831
  op.adjoin(gempwd, start: 0) if gempwd
@@ -833,11 +858,7 @@ module Squared
833
858
  if line =~ /^(\S+) \((\S+) < ([^)]+)\)$/
834
859
  cur = semscan $2
835
860
  lat = semscan $3
836
- rows << [$~.to_a.drop(1), if semmajor?(cur, lat)
837
- 1
838
- else
839
- cur[2] == lat[2] ? 3 : 2
840
- end]
861
+ rows << [$~.to_a.drop(1), semtype(cur, lat)]
841
862
  else
842
863
  out.call(line)
843
864
  end
@@ -859,23 +880,24 @@ module Squared
859
880
  next if i == 0 && stdin?
860
881
 
861
882
  a, b, c = row.first
883
+ type = row.last
862
884
  if i == 0
863
885
  line = '%-*s %-*s %*s %*s' % [pad, ' #', d, a, e, b, f, c]
864
- n = line.size
886
+ s = ARG[:BORDER][1] * line.size
865
887
  queue = if stdin?
866
- [line, ARG[:BORDER][1] * n]
888
+ [line, s]
867
889
  else
868
890
  2.times do
869
- line = sub_style(line, **opt_style(theme[:header], /^(.+)(?<!\dm)(#{a}|#{c})(.*)$/, 2))
891
+ sub_style!(line, **opt_style(theme[:header], /^(.+)(?<!\dm)(#{a}|#{c})(.*)$/, 2))
870
892
  end
871
- [line, sub_style(ARG[:BORDER][1] * n, styles: borderstyle)]
893
+ [line, sub_style(s, borderstyle)]
872
894
  end
873
895
  else
874
896
  g = a.ljust(d)
875
897
  pat = [/^([^.]+\.)([^.]+\..+)$/, /^([^.]+\.[^.]+\.)(.+)$/]
876
898
  pre = b.start_with?('0.')
877
899
  latest = [theme[:latest]]
878
- case row.last
900
+ case type
879
901
  when 1
880
902
  case semver
881
903
  when 'major'
@@ -884,7 +906,7 @@ module Squared
884
906
  next
885
907
  end
886
908
  unless stdin?
887
- g = sub_style(g, styles: theme[:major])
909
+ sub_style! g, theme[:major]
888
910
  styles = %i[green bold]
889
911
  pat = (pat.first if pre)
890
912
  latest << :bold
@@ -898,7 +920,7 @@ module Squared
898
920
  next
899
921
  end
900
922
  unless stdin?
901
- g = sub_style(g, styles: theme[:active])
923
+ sub_style! g, theme[:active]
902
924
  styles = %i[green]
903
925
  pat = pre ? pat.last : pat.first
904
926
  end
@@ -917,21 +939,26 @@ module Squared
917
939
  b = b.rjust(e)
918
940
  h = c.rjust(f)
919
941
  unless stdin?
920
- b = sub_style(b, **opt_style(colormap(styles), pat, 2))
921
- h = sub_style(h, **opt_style(latest.flatten.compact, pat, 2))
942
+ sub_style!(b, **opt_style(colormap(styles), pat, 2))
943
+ sub_style!(h, **opt_style(latest.flatten.compact, pat, 2))
922
944
  end
923
945
  j += 1
924
946
  if queue
925
947
  out.call(queue)
926
948
  queue = nil
927
949
  end
928
- s = '%s %s %s' % [g, b, h]
929
- if items
930
- items << [s, a]
931
- else
932
- out.call('%*s %s' % [pad, "#{j}.", s])
950
+ s = ('%s %s %s' % [g, b, h]).yield_self do |val|
951
+ items&.push([val, a])
952
+ '%*s %s' % [pad, "#{j}.", val]
953
+ end
954
+ if ia
955
+ unless confirm_semver(s, type)
956
+ update.delete(a)
957
+ next
958
+ end
959
+ elsif !items
960
+ out.call(s)
933
961
  end
934
- update.delete(a) if ia && !confirm_outdated(a, c, row.last, timeout: 0)
935
962
  end
936
963
  end
937
964
  end
@@ -947,7 +974,7 @@ module Squared
947
974
  update = choice('Select a package', items.map(&:first),
948
975
  multiple: true, force: false, index: true, border: true).map! { |n| items[n.pred].last }
949
976
  end
950
- if update && !update.empty?
977
+ unless Array(update).empty?
951
978
  cmd = gem_output 'update -f'
952
979
  option('document', prefix: 'gem', ignore: false) do |val|
953
980
  cmd << case val
@@ -965,8 +992,12 @@ module Squared
965
992
  '--user-install'
966
993
  end
967
994
  end
968
- cmd.merge(update)
969
- run(cmd, sync: sync, banner: false, from: :'gem:update')
995
+ cmd.merge(update.quote!)
996
+ if filter[:dryrun]
997
+ print_run cmd, false
998
+ else
999
+ run(cmd, sync: sync, banner: false, from: :'gem:update')
1000
+ end
970
1001
  end
971
1002
  print_status(*major, from: :outdated)
972
1003
  end
@@ -1257,7 +1288,7 @@ module Squared
1257
1288
  dir = basepath sig, file.dirname
1258
1289
  dir.mkpath unless dir.exist?
1259
1290
  base = file.basename.to_s
1260
- rbs = dir.join(base.stripext + '.rbs')
1291
+ rbs = dir.join("#{base.stripext}.rbs")
1261
1292
  status = if rbs.exist?
1262
1293
  case y
1263
1294
  when '0', 'false'
@@ -1380,7 +1411,7 @@ module Squared
1380
1411
  end
1381
1412
 
1382
1413
  def outdated?
1383
- dependtype > 0
1414
+ dependtype > 0 && !task_pass?('outdated')
1384
1415
  end
1385
1416
 
1386
1417
  private
@@ -1394,18 +1425,11 @@ module Squared
1394
1425
  end
1395
1426
 
1396
1427
  def gem_session(*cmd, **kwargs)
1397
- ret = session('gem', *cmd, **kwargs)
1398
- return ret if cmd.empty?
1399
-
1400
- ret.merge(preopts)
1428
+ session('gem', *cmd, *preopts, **kwargs)
1401
1429
  end
1402
1430
 
1403
1431
  def bundle_session(*cmd, **kwargs)
1404
- ret = session('bundle', *cmd, **kwargs)
1405
- return ret if cmd.empty?
1406
-
1407
- append_nocolor
1408
- ret.merge(preopts)
1432
+ session('bundle', *cmd, *preopts, **kwargs).tap { append_nocolor }
1409
1433
  end
1410
1434
 
1411
1435
  def rake_session(*cmd, **kwargs)
@@ -1458,7 +1482,7 @@ module Squared
1458
1482
  end
1459
1483
 
1460
1484
  def preopts
1461
- verbose? && !session_arg?('quiet') ? ['--verbose'] : []
1485
+ verbose? ? ['--verbose'] : []
1462
1486
  end
1463
1487
 
1464
1488
  def variables
@@ -1538,8 +1562,7 @@ module Squared
1538
1562
  end
1539
1563
 
1540
1564
  def gemlib
1541
- @gemlib ||= begin
1542
- lib = Set.new(['lib'])
1565
+ @gemlib ||= Set.new(['lib']).yield_self do |lib|
1543
1566
  if (spec = gemspec)
1544
1567
  lib.merge(spec.require_paths || [])
1545
1568
  end
@@ -1552,7 +1575,9 @@ module Squared
1552
1575
  end
1553
1576
 
1554
1577
  def gemdir?
1555
- !@gemdir.nil? && @gemdir.exist? && !@gemdir.empty?
1578
+ return false unless @gemdir
1579
+
1580
+ @gemdir.exist? && !@gemdir.empty?
1556
1581
  end
1557
1582
  end
1558
1583