squared 0.4.34 → 0.4.35

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: 0d59b575971efdb7998b924fa5ca7815c4aeaeeaeecb756197fbc79b11433743
4
- data.tar.gz: 9cb428fb205f51803c0b7576b71d78165a8987925f90c04462c266bd03ca48b9
3
+ metadata.gz: 87083dafc757443f6f6afb994664bbb3089d4c57af8f32e06e2a9b76a21f520d
4
+ data.tar.gz: 8025828b76fce4826e3572e2546977ee7d998027aed144d9b119d84ba0a6e05d
5
5
  SHA512:
6
- metadata.gz: 5504784e072989e9e4a25ee08aa2f8bc5b9b73d4476aa9ad5d4633b08b2546847b9945de201f964b04a52124b2e75bc2f9341321348f429e2dc9ea0c4bae3fd8
7
- data.tar.gz: 73786a35bd4255024f235090cc8b11883b95efa8903e2034b8f5d13353fb7a7756ed8d8d335f42756232d595a00bf10cdafb099c3065906617575e3cd035bebf
6
+ metadata.gz: 868a4f6d3fbbd406eab3ce1d2c87850f7a59fe2161314b001e8a20b540f9c98bd71a8f4250699d463220337be7124e7d437d34178e5f6036f40087c188e4ab98
7
+ data.tar.gz: 60e6625462ad8f9d6efbf4b9029629f6eceee0316647be5bf19098c9c951a7de42b6411395135b1664c76f598ac63a40656541f3e669775cfefa6f9261d356cc
data/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.4.35] - 2025-12-31
4
+
5
+ ### Changed
6
+
7
+ - Ruby task copy uses GEM_HOME as fallback for autodetect.
8
+
9
+ ### Fixed
10
+
11
+ - Git commands [rebase|clone] did not forward sync flag.
12
+ - Pip command install carelessly used an undefined method.
13
+ - Common prompt method readline with multiline did not permit empty lines.
14
+ - Application method with using pass did not ignore exceptions.
15
+
3
16
  ## [0.4.34] - 2025-12-26
4
17
 
5
18
  ### Added
@@ -1164,6 +1177,7 @@
1164
1177
 
1165
1178
  - Changelog was created.
1166
1179
 
1180
+ [0.4.35]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.35
1167
1181
  [0.4.34]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.34
1168
1182
  [0.4.33]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.33
1169
1183
  [0.4.32]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.32
@@ -94,7 +94,11 @@ module Squared
94
94
  elsif block_given?
95
95
  Readline.readmultiline(msg, history, &blk)
96
96
  else
97
- Readline.readmultiline(msg, history) { |line| multiline.any? { |val| line.split.last.end_with?(val.to_s) } }
97
+ Readline.readmultiline(msg, history) do |line|
98
+ next if line.strip.empty?
99
+
100
+ multiline.any? { |val| line.split.last.end_with?(val.to_s) }
101
+ end
98
102
  end
99
103
  end
100
104
  case force
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Squared
4
- VERSION = '0.4.34'
4
+ VERSION = '0.4.35'
5
5
  end
@@ -179,7 +179,7 @@ module Squared
179
179
  end
180
180
 
181
181
  def with(*val, pass: false, group: nil, **kwargs, &blk)
182
- return self if pass == true || (pass && Array(pass).map(&:to_s).any? { |s| respond_to?(s) && __send__(s) })
182
+ return self if pass == true || (pass && as_a(pass, :to_s).any? { |s| respond_to?(s) && __send__(s) rescue nil })
183
183
 
184
184
  @group = nil
185
185
  @ref = nil
@@ -1065,8 +1065,7 @@ module Squared
1065
1065
  begin
1066
1066
  cmd.flatten.each { |val| run(val, env, sync: sync, banner: banner, **kwargs) }
1067
1067
  rescue StandardError => e
1068
- ret = on :error, from, e
1069
- raise unless ret == true
1068
+ on_error(e, from, exception: kwargs.fetch(:exception, exception))
1070
1069
  end
1071
1070
  on :last, from
1072
1071
  end
@@ -665,8 +665,8 @@ module Squared
665
665
  end
666
666
  end
667
667
 
668
- def list_image(flag, cmd, hint: nil, from: nil, no: true)
669
- pwd_set do
668
+ def list_image(flag, cmd, hint: nil, no: true, from: nil)
669
+ pwd_set(from: from) do
670
670
  found = false
671
671
  index = 0
672
672
  all = option('all', prefix: 'docker')
@@ -1049,7 +1049,7 @@ module Squared
1049
1049
 
1050
1050
  cmd << "--#{command}"
1051
1051
  end
1052
- source
1052
+ source(sync: sync)
1053
1053
  end
1054
1054
 
1055
1055
  def autostash(*, sync: invoked_sync?('autostash'), **)
@@ -1090,7 +1090,7 @@ module Squared
1090
1090
  append_hash opts
1091
1091
  cmd << '--quiet' unless verbose
1092
1092
  append_value(data[0], path, delim: true)
1093
- source(banner: sync && !quiet?, multiple: !sync || quiet?)
1093
+ source(sync: sync, banner: sync && !quiet?, multiple: !sync || quiet?)
1094
1094
  end
1095
1095
 
1096
1096
  def stash(flag = nil, opts = [], sync: invoked_sync?('stash', flag))
@@ -678,7 +678,7 @@ module Squared
678
678
  log.info cmd.to_s
679
679
  end
680
680
  if sync
681
- run(from: from, sync: sync, interactive: !dryrun && "Publish #{sub_style(npmname, styles: theme[:active])}")
681
+ run(sync: sync, from: from, interactive: !dryrun && "Publish #{sub_style(npmname, styles: theme[:active])}")
682
682
  else
683
683
  require 'open3'
684
684
  on :first, from
@@ -801,7 +801,7 @@ module Squared
801
801
  raise_error('version not found', hint: dependfile)
802
802
  end
803
803
  rescue StandardError => e
804
- on_error e, :bump
804
+ on_error(e, :bump, dryrun: dryrun?)
805
805
  end
806
806
  end
807
807
 
@@ -879,6 +879,14 @@ module Squared
879
879
  puts(dir.directory? ? "Success: #{dir}" : 'Failed') if banner && !status
880
880
  end
881
881
 
882
+ def installable?
883
+ setuptools? || !!pyprojectfile
884
+ end
885
+
886
+ def setuptools?
887
+ dependtype == 2 || dependtype == 4
888
+ end
889
+
882
890
  def poetry?
883
891
  dependtype == 1
884
892
  end
@@ -855,7 +855,16 @@ module Squared
855
855
  def copy?
856
856
  return true if @copy.is_a?(Hash) ? copy[:into] : super
857
857
  return gemdir? if gemdir
858
+ return false unless @autodetect
859
+
860
+ set = lambda do |val, path|
861
+ base = Pathname.new(path.strip)
862
+ return false unless base.join(gempath(val, 'specifications')).exist?
858
863
 
864
+ log.warn "using version #{val} (given #{version})" if version && version != val
865
+ self.version = val
866
+ self.gemdir = base + gempath
867
+ end
859
868
  if version
860
869
  begin
861
870
  case @autodetect
@@ -866,33 +875,20 @@ module Squared
866
875
  self.gemdir = File.join($1, 'lib/ruby/gems', "#{$2}.0")
867
876
  end
868
877
  when 'asdf'
869
- val = pwd_set { `asdf where ruby` }
878
+ val = pwd_set { `asdf where ruby`.chomp }
870
879
  self.gemdir = File.join(val, 'lib/ruby/gems', "#{$1}.0") if val =~ /(\d\.\d)\.[^.]+$/
871
- when 'env'
872
- ENV['GEM_HOME'] || ENV['GEM_ROOT']
873
880
  when /bundler?/
874
881
  path = pwd_set { `bundle env` }[/^\s+Gem Path\s+(.+)$/, 1]
875
882
  self.gemdir = path.split(File::PATH_SEPARATOR).find { |val| Dir.exist?(val) }
883
+ else
884
+ self.gemdir = ENV['GEM_HOME'] || ENV['GEM_ROOT']
876
885
  end
886
+ return true if gemdir?
877
887
  rescue StandardError => e
878
888
  log.debug e
879
889
  end
880
- return true if gemdir?
881
- end
882
- return false unless @autodetect
883
-
884
- set = lambda do |val, path|
885
- base = Pathname.new(path.strip)
886
- return false unless base.join(gempath(val, 'specification')).exist?
887
-
888
- log.warn "using version #{val} (given #{version})" if version && version != val
889
- self.version = val
890
- self.gemdir = base + gempath
891
- end
892
- if version
893
- opt = gempwd
894
- pwd_set(pass: !opt.nil?) do
895
- out = `#{gem_output(opt, 'list --local -d', gemname)}`
890
+ pwd_set(pass: !gempwd.nil?) do
891
+ out = `#{gem_output(gempwd, 'list --local -d', gemname)}`
896
892
  if out =~ /#{Regexp.escape(gemname)}\s+\((.+)\)$/
897
893
  split_escape($1)
898
894
  .unshift(@version)
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.4.34
4
+ version: 0.4.35
5
5
  platform: ruby
6
6
  authors:
7
7
  - An Pham
@@ -125,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
125
  - !ruby/object:Gem::Version
126
126
  version: '0'
127
127
  requirements: []
128
- rubygems_version: 3.6.9
128
+ rubygems_version: 4.0.3
129
129
  specification_version: 4
130
130
  summary: Rake task generator for managing multi-language workspaces.
131
131
  test_files: []