squared 0.5.20 → 0.5.21

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: '0795a62a3426493dde89a22b6a8bcfe57e6c48aecf2dafc5ee661140654f25d6'
4
- data.tar.gz: 0a0351323f82eab2fbfc164dcd4d5718bf66589e3213340822130cc11d99fa51
3
+ metadata.gz: 422d0fe6f69fab606e4b0a218c2f4faae43fe6bb24a2e66f7e37ef2d0685019a
4
+ data.tar.gz: 53761c954112ee12a3f22756a2d140b2a86db9c6a0f6113ea05a3aa32f95f52a
5
5
  SHA512:
6
- metadata.gz: 7784fe33a1d668f126e6e0b3973d241046387f724b873ea7904e4f7acd6f05d83ce807b4271cc41e0ba9a840e2952242160fed0861e1d25c3178567f39dfaab4
7
- data.tar.gz: 38b755e356c7593c60cc8a608fa542043bd31bba950decd92ace7cf8139bcdf906f16b5253493691d6786cfbbdb73ce2911517e771a0252433861d372af8280d
6
+ metadata.gz: 46c2e2f4a935003a2a773e157760b928d23445e57a1d2c4663eae322ac02b3f3b96091a1e122457c91621b7693199cb1f15f1ebea0f5349f8f536b1ac4cc3d06
7
+ data.tar.gz: 79e1beaddef54cad59db12a5ca864babe97933636f129f9797338d710bc0d928f38c1beb5882028a87670ea6aec217646ffafd6227ca7bd6b106ed77557f8f69
data/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.5.21] - 2025-12-31
4
+
5
+ ### Fixed
6
+
7
+ - See `0.4.35`.
8
+
9
+ ## [0.4.35] - 2025-12-31
10
+
11
+ ### Changed
12
+
13
+ - Ruby task copy uses GEM_HOME as fallback for autodetect.
14
+
15
+ ### Fixed
16
+
17
+ - Git commands [rebase|clone] did not forward sync flag.
18
+ - Pip command install carelessly used an undefined method.
19
+ - Common prompt method readline with multiline did not permit empty lines.
20
+ - Application method with using pass did not ignore exceptions.
21
+
3
22
  ## [0.5.20] - 2025-12-26
4
23
 
5
24
  ### Fixed
@@ -1332,6 +1351,7 @@
1332
1351
 
1333
1352
  - Changelog was created.
1334
1353
 
1354
+ [0.5.21]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.21
1335
1355
  [0.5.20]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.20
1336
1356
  [0.5.19]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.19
1337
1357
  [0.5.18]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.18
@@ -1353,6 +1373,7 @@
1353
1373
  [0.5.2]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.2-ruby
1354
1374
  [0.5.1]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.1-ruby
1355
1375
  [0.5.0]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.0-ruby
1376
+ [0.4.35]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.35
1356
1377
  [0.4.34]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.34
1357
1378
  [0.4.33]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.33
1358
1379
  [0.4.32]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.32
@@ -113,7 +113,11 @@ module Squared
113
113
  elsif block_given?
114
114
  Readline.readmultiline(msg, history, &blk)
115
115
  else
116
- Readline.readmultiline(msg, history) { |line| multiline.any? { |val| line.split.last.end_with?(val.to_s) } }
116
+ Readline.readmultiline(msg, history) do |line|
117
+ next if line.strip.empty?
118
+
119
+ multiline.any? { |val| line.split.last.end_with?(val.to_s) }
120
+ end
117
121
  end
118
122
  end
119
123
  case force
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Squared
4
- VERSION = '0.5.20'
4
+ VERSION = '0.5.21'
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
@@ -1136,8 +1136,7 @@ module Squared
1136
1136
  begin
1137
1137
  cmd.flatten.each { |val| run(val, env, sync: sync, banner: banner, **kwargs) }
1138
1138
  rescue StandardError => e
1139
- ret = on :error, from, e
1140
- raise unless ret == true
1139
+ on_error(e, from, exception: kwargs.fetch(:exception, exception))
1141
1140
  end
1142
1141
  on :last, from
1143
1142
  end
@@ -693,8 +693,8 @@ module Squared
693
693
  end
694
694
  end
695
695
 
696
- def list_image(flag, cmd, hint: nil, from: nil, no: true)
697
- pwd_set do
696
+ def list_image(flag, cmd, hint: nil, no: true, from: nil)
697
+ pwd_set(from: from) do
698
698
  found = false
699
699
  index = 0
700
700
  all = option('all', prefix: 'docker')
@@ -1050,7 +1050,7 @@ module Squared
1050
1050
 
1051
1051
  cmd << "--#{command}"
1052
1052
  end
1053
- source
1053
+ source(sync: sync)
1054
1054
  end
1055
1055
 
1056
1056
  def autostash(*, sync: invoked_sync?('autostash'), **)
@@ -1094,7 +1094,7 @@ module Squared
1094
1094
  append_hash opts
1095
1095
  cmd << '--quiet' unless verbose
1096
1096
  append_value(data[0], path, delim: true)
1097
- source(banner: sync && !quiet?, multiple: !sync || quiet?)
1097
+ source(sync: sync, banner: sync && !quiet?, multiple: !sync || quiet?)
1098
1098
  end
1099
1099
 
1100
1100
  def stash(flag = nil, opts = [], sync: invoked_sync?('stash', flag))
@@ -686,7 +686,7 @@ module Squared
686
686
  log.info cmd.to_s
687
687
  end
688
688
  if sync
689
- run(from: from, sync: sync, interactive: !dryrun && "Publish #{sub_style(npmname, styles: theme[:active])}")
689
+ run(sync: sync, from: from, interactive: !dryrun && "Publish #{sub_style(npmname, styles: theme[:active])}")
690
690
  else
691
691
  require 'open3'
692
692
  on :first, from
@@ -808,7 +808,7 @@ module Squared
808
808
  raise_error('version not found', hint: dependfile)
809
809
  end
810
810
  rescue StandardError => e
811
- on_error e, :bump
811
+ on_error(e, :bump, dryrun: dryrun?)
812
812
  end
813
813
  end
814
814
 
@@ -900,6 +900,10 @@ module Squared
900
900
  puts(dir.directory? ? "Success: #{dir}" : 'Failed') if banner && !status
901
901
  end
902
902
 
903
+ def installable?
904
+ setuptools? || !!pyprojectfile
905
+ end
906
+
903
907
  def setuptools?
904
908
  dependtype == 2 || dependtype == 4
905
909
  end
@@ -893,7 +893,16 @@ module Squared
893
893
  def copy?
894
894
  return true if @copy.is_a?(Hash) ? copy[:into] : super
895
895
  return gemdir? if gemdir
896
+ return false unless @autodetect
897
+
898
+ set = lambda do |val, path|
899
+ base = Pathname.new(path.strip)
900
+ return false unless base.join(gempath(val, 'specifications')).exist?
896
901
 
902
+ log.warn "using version #{val} (given #{version})" if version && version != val
903
+ self.version = val
904
+ self.gemdir = base + gempath
905
+ end
897
906
  if version
898
907
  begin
899
908
  case @autodetect
@@ -904,33 +913,20 @@ module Squared
904
913
  self.gemdir = File.join($1, 'lib/ruby/gems', "#{$2}.0")
905
914
  end
906
915
  when 'asdf'
907
- val = pwd_set { `asdf where ruby` }
916
+ val = pwd_set { `asdf where ruby`.chomp }
908
917
  self.gemdir = File.join(val, 'lib/ruby/gems', "#{$1}.0") if val =~ /(\d\.\d)\.[^.]+$/
909
- when 'env'
910
- ENV['GEM_HOME'] || ENV['GEM_ROOT']
911
918
  when /bundler?/
912
919
  path = pwd_set { `bundle env` }[/^\s+Gem Path\s+(.+)$/, 1]
913
920
  self.gemdir = path.split(File::PATH_SEPARATOR).find { |val| Dir.exist?(val) }
921
+ else
922
+ self.gemdir = ENV['GEM_HOME'] || ENV['GEM_ROOT']
914
923
  end
924
+ return true if gemdir?
915
925
  rescue StandardError => e
916
926
  log.debug e
917
927
  end
918
- return true if gemdir?
919
- end
920
- return false unless @autodetect
921
-
922
- set = lambda do |val, path|
923
- base = Pathname.new(path.strip)
924
- return false unless base.join(gempath(val, 'specification')).exist?
925
-
926
- log.warn "using version #{val} (given #{version})" if version && version != val
927
- self.version = val
928
- self.gemdir = base + gempath
929
- end
930
- if version
931
- opt = gempwd
932
- pwd_set(pass: !opt.nil?) do
933
- out = `#{gem_output(opt, 'list --local -d', gemname)}`
928
+ pwd_set(pass: !gempwd.nil?) do
929
+ out = `#{gem_output(gempwd, 'list --local -d', gemname)}`
934
930
  if out =~ /#{Regexp.escape(gemname)}\s+\((.+)\)$/
935
931
  split_escape($1)
936
932
  .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.5.20
4
+ version: 0.5.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - An Pham
@@ -124,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
124
124
  - !ruby/object:Gem::Version
125
125
  version: '0'
126
126
  requirements: []
127
- rubygems_version: 3.6.9
127
+ rubygems_version: 4.0.3
128
128
  specification_version: 4
129
129
  summary: Rake task generator for managing multi-language workspaces.
130
130
  test_files: []