squared 0.5.10 → 0.5.12

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: 1614a1b7a4674c33cbc895cc8ee6e475ec2ed577f431a52df251c9b1415b128f
4
- data.tar.gz: f24f7926cda7af396f681670f35008473d56bd35f29b7c3a982826be9b2ffaa7
3
+ metadata.gz: e711136d645a7a32cb93a09fc7562525a7fd9bc725436c5db5846fa217ac013c
4
+ data.tar.gz: 9fe647b2d3021fb50a2d4d4a3983d12422ecbbdbcb92324461382faf5efcb4c7
5
5
  SHA512:
6
- metadata.gz: c8e181a06665254466e0fffc3cb1c00e33ebeaa56354689a1b40b4c7a302e5e3554ceca1b45dea389eff4fd8653eec8e756fc8fe9921447d28fd5cd62b100235
7
- data.tar.gz: e6ed8bbcdb2a38741f0562bf5ff00ee638d359ea0af7674c5e6346dd125e692e350999e027c560641b708ec2dbcd3438f184ab4565387a5adbe942ef014a264d
6
+ metadata.gz: 58dee7d115025166ad1326dc11e76f9708ce4af715f1d85b53e2d19799b07aab81118eb82283913a2fee9401b005c0eb9c883f1c820d3b7bfadf9eed2a845013
7
+ data.tar.gz: 2bac7d7f87848d78327542d4be5f5535f4d8ed45e818afa27b5a408f921c90363655de8a88dcf4d49d5da44902b5c87c6628cc75b1afe8875eee5bdecc48e3c6
data/CHANGELOG.md CHANGED
@@ -1,5 +1,68 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.5.12] - 2025-10-31
4
+
5
+ ### Changed
6
+
7
+ - Ruby task depend does not override bundle config without setting.
8
+
9
+ ### Fixed
10
+
11
+ - Node command run did nothing at all when called upon.
12
+
13
+ ## [0.4.26] - 2025-10-31
14
+
15
+ ### Added
16
+
17
+ - Docker command options were updated to 28.5.
18
+
19
+ ### Changed
20
+
21
+ - Node package manager does not override package.json with NODE_INSTALL.
22
+ - Node workspaces can specify more than one package manager through NODE_INSTALL.
23
+
24
+ ### Fixed
25
+
26
+ - Node command add did not provide optional save argument.
27
+ - Python command outdated did not detect synchronous output.
28
+ - Node command outdated auto-commit was completely dysfunctional.
29
+ - Project workspaces caused a complete meltdown on TruffleRuby.
30
+ - Project build initialization global flag was always incoherent.
31
+ - Project base setters did not accept direct values.
32
+ - Project base global graph tasks are not definable by a sub-project.
33
+
34
+ ## [0.5.11] - 2025-10-18
35
+
36
+ ### Fixed
37
+
38
+ - Ruby command version did not parse asdf output in Go.
39
+ - Git command submodule action branch did not provide name argument.
40
+
41
+ ## [0.4.25] - 2025-10-18
42
+
43
+ ### Fixed
44
+
45
+ - Project groups did not have their own copy of base events.
46
+
47
+ ## [0.4.24] - 2025-10-17
48
+
49
+ ### Added
50
+
51
+ - Repo task [init|all] can bypass dev? copy requirement with REPO_STAGE=4.
52
+
53
+ ### Changed
54
+
55
+ - Node command outdated does not check PNPM minimum version.
56
+
57
+ ### Fixed
58
+
59
+ - Project base rescue error handling used reversed parameters.
60
+ - Project absolute paths did not append wildcard with trailing slash.
61
+ - Powershell commands did not escape nested double quotes.
62
+ - OptionPartition did not strip flags without a value.
63
+ - Project base method add did not use parent context.
64
+ - Application property pipe did not parse numeric values.
65
+
3
66
  ## [0.5.10] - 2025-10-11
4
67
 
5
68
  ### Fixed
@@ -1121,6 +1184,8 @@
1121
1184
 
1122
1185
  - Changelog was created.
1123
1186
 
1187
+ [0.5.12]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.12
1188
+ [0.5.11]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.11
1124
1189
  [0.5.10]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.10
1125
1190
  [0.5.9]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.9
1126
1191
  [0.5.8]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.8
@@ -1132,6 +1197,9 @@
1132
1197
  [0.5.2]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.2-ruby
1133
1198
  [0.5.1]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.1-ruby
1134
1199
  [0.5.0]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.0-ruby
1200
+ [0.4.26]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.26
1201
+ [0.4.25]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.25
1202
+ [0.4.24]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.24
1135
1203
  [0.4.23]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.23
1136
1204
  [0.4.22]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.22
1137
1205
  [0.4.21]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.21
data/README.md CHANGED
@@ -688,7 +688,7 @@ GIT_AUTOSTASH_${NAME}=0 # rebase (project only)
688
688
 
689
689
  ### Docker
690
690
 
691
- * Version: [28.3](https://docs.docker.com/engine/release-notes/28)
691
+ * Version: [28.5](https://docs.docker.com/engine/release-notes/28)
692
692
 
693
693
  ```sh
694
694
  DOCKER_OPTIONS=q,no-cache # all
@@ -745,7 +745,7 @@ REPO_SYNC # 0,1
745
745
  REPO_URL # manifest repository
746
746
  REPO_MANIFEST # e.g. latest,nightly,prod
747
747
  REPO_GROUPS # e.g. base,prod,docs
748
- REPO_STAGE # 0,1,2,3
748
+ REPO_STAGE # 0,1,2,3,4
749
749
  REPO_SUBMODULLES # 0,1
750
750
  REPO_TIMEOUT # confirm dialog (seconds)
751
751
  ```
@@ -108,7 +108,7 @@ module Squared
108
108
  ret = wrap.call(ret, code) unless code.empty?
109
109
  return ret unless data
110
110
 
111
- out = ''.dup
111
+ out = +''
112
112
  data.to_a.each_with_index do |group, i|
113
113
  next if i == 0
114
114
 
@@ -180,8 +180,9 @@ module Squared
180
180
  args = args.map(&:to_s)
181
181
  if level.is_a?(::Numeric)
182
182
  if append && respond_to?(:log)
183
- ref = log rescue nil
184
- ref.add(level, message(subject, *args, hint: hint, space: ', ')) if ref.is_a?(Logger)
183
+ (log rescue nil).tap do |ref|
184
+ ref.add(level, message(subject, *args, hint: hint, space: ', ')) if ref.is_a?(::Logger)
185
+ end
185
186
  end
186
187
  return false if !pass && level < ARG[:LEVEL]
187
188
  end
@@ -200,7 +201,7 @@ module Squared
200
201
  def log_console(*args, pipe: 1)
201
202
  return if args.first == false && args.size == 1
202
203
 
203
- if pipe.is_a?(Pathname)
204
+ if pipe.is_a?(::Pathname)
204
205
  begin
205
206
  File.open(pipe, 'a') do |f|
206
207
  br = File::SEPARATOR == '\\' ? "\r\n" : "\n"
@@ -219,7 +220,8 @@ module Squared
219
220
  module_function
220
221
 
221
222
  def message(*args, hint: nil, empty: false, space: ARG[:SPACE])
222
- (empty ? args.reject { |val| val.nil? || val.empty? } : args).join(space) + (hint ? " (#{hint})" : '')
223
+ (empty ? args.reject { |val| val.nil? || (val.respond_to?(:empty?) && val.empty?) } : args)
224
+ .join(space) + (hint ? " (#{hint})" : '')
223
225
  end
224
226
 
225
227
  def emphasize(val, title: nil, footer: nil, right: false, cols: nil, sub: nil, pipe: nil,
@@ -233,7 +235,7 @@ module Squared
233
235
  lines = val.map(&:to_s)
234
236
  else
235
237
  lines = val.to_s.lines(chomp: true)
236
- lines[0] = "#{val.class}: #{lines.first}" if (err = val.is_a?(StandardError))
238
+ lines[0] = "#{val.class}: #{lines.first}" if (err = val.is_a?(::StandardError))
237
239
  end
238
240
  n = cols || max.call(lines)
239
241
  if $stdout.tty?
@@ -53,11 +53,11 @@ module Squared
53
53
  end
54
54
  max = items.size
55
55
  raise_error 'empty selection list' if max == 0
56
- min = [min, max].min
56
+ min = grep ? 1 : [min, max].min
57
57
  if auto
58
- msg = "#{msg}: [1-#{max}#{if multiple
59
- "|,#{multiple.is_a?(Numeric) ? "{#{multiple}}" : ''}"
60
- end}] "
58
+ msg = "#{msg + (force ? ':' : '?')} [#{min}-#{max}#{if (n = multiple)
59
+ "|,#{n.is_a?(::Numeric) ? "{#{n}}" : ''}"
60
+ end}] "
61
61
  end
62
62
  end
63
63
  valid = ->(s) { s.match?(/^\d+$/) && s.to_i.between?(min, max) }
@@ -81,8 +81,7 @@ module Squared
81
81
  b.flatten!
82
82
  b.uniq!
83
83
  b.sort!
84
- return b unless items
85
- return b.map! { |i| items[i - 1] } unless multiple.is_a?(::Numeric) && multiple != b.size
84
+ return items ? b.map! { |i| items[i - 1] } : b unless multiple.is_a?(::Numeric) && multiple != b.size
86
85
  end
87
86
  elsif valid.call(ch)
88
87
  return items ? items[ch.to_i - 1] : ch.to_i
@@ -113,18 +112,18 @@ module Squared
113
112
  elsif block_given?
114
113
  Readline.readmultiline(msg, history, &blk)
115
114
  else
116
- Readline.readmultiline(msg, history) { |line| multiline.any? { |val| line.split.last.end_with?(val) } }
115
+ Readline.readmultiline(msg, history) { |line| multiline.any? { |val| line.split.last.end_with?(val.to_s) } }
117
116
  end
118
117
  end
119
118
  case force
120
119
  when ::TrueClass, ::FalseClass
121
120
  msg = "#{msg} %s " % if multiline
122
- multiline.is_a?(::Enumerable) ? "{#{multiline.join('|')}}" : multiline
121
+ multiline.is_a?(::Enumerable) ? "{#{multiline.to_a.join('|')}}" : multiline
123
122
  else
124
123
  "(#{force ? 'required' : 'optional'}):"
125
124
  end
126
125
  ret = (prompt.call || '').strip
127
- multiline.each { |val| break if ret.delete_suffix!(val) } if multiline.is_a?(::Enumerable)
126
+ multiline.each { |val| break if ret.delete_suffix!(val.to_s) } if multiline.is_a?(::Enumerable)
128
127
  exit 1 if force && ret.empty?
129
128
  ret
130
129
  else
@@ -16,15 +16,15 @@ module Squared
16
16
  elsif !r[3] || r[6]
17
17
  return val
18
18
  end
19
- if r[7].match?(/\A["']/)
20
- opt = "#{r[7]}#{r[7][0]}"
21
- elsif r[7].match?(/["']\z/)
22
- opt = "#{r[7][-1]}#{r[7]}"
23
- else
24
- return val unless r[7].match?(/\s/)
25
-
26
- opt = r[7]
27
- end
19
+ opt = if r[7].match?(/\A["']/)
20
+ "#{r[7]}#{r[7][0]}"
21
+ elsif r[7].match?(/["']\z/)
22
+ "#{r[7][-1]}#{r[7]}"
23
+ else
24
+ return val unless r[7].match?(/\s/)
25
+
26
+ r[7]
27
+ end
28
28
  r[1] + (data ? data[2] : r[2]) + r[4] + shell_quote(opt, double: double, force: force, override: override)
29
29
  elsif option && val =~ /\A([^=]+)=(.+)\z/m
30
30
  return val if $2.match?(/\A(["']).+\1\z/m)
@@ -69,15 +69,15 @@ module Squared
69
69
  escape = false
70
70
  override = true
71
71
  end
72
- if flag[0] == '-'
73
- b = flag[1] == '-' ? '=' : ' '
74
- elsif flag.size == 1
75
- a = '-'
76
- b = merge ? '' : ' '
77
- else
78
- a = '--'
79
- b = '='
80
- end
72
+ b = if flag[0] == '-'
73
+ flag[1] == '-' ? '=' : ' '
74
+ elsif flag.size == 1
75
+ a = '-'
76
+ merge ? '' : ' '
77
+ else
78
+ a = '--'
79
+ '='
80
+ end
81
81
  "#{a}#{flag}#{unless val.nil?
82
82
  "#{b}#{if escape
83
83
  shell_escape(val, quote: quote, double: double, override: override)
@@ -103,7 +103,7 @@ module Squared
103
103
  end
104
104
 
105
105
  def line_width(lines)
106
- ret = [lines.max_by(&:size).size, 80].max
106
+ ret = [lines.empty? ? 0 : lines.max_by(&:size).size, 80].max
107
107
  [ret, Rake.application.terminal_width].min
108
108
  end
109
109
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Squared
4
- VERSION = '0.5.10'
4
+ VERSION = '0.5.12'
5
5
  end
@@ -140,20 +140,19 @@ module Squared
140
140
  return unless @pipe.is_a?(Pathname)
141
141
 
142
142
  msg = "Session started on #{Time.now} by #{@main}"
143
- bord = '#' * s.size
143
+ bord = '#' * msg.size
144
144
  puts bord, msg, bord
145
145
  end
146
146
 
147
147
  def build(parallel: [], pass: nil, **kwargs)
148
148
  return self unless enabled? && !@closed
149
149
 
150
- if kwargs[:pattern].is_a?(Array)
151
- kwargs[:parallel] = parallel.map(&:to_s)
152
- else
153
- kwargs[:pattern] = []
154
- kwargs[:parallel] = parallel.reject { |val| val.is_a?(Regexp) && (kwargs[:pattern] << val) }
155
- .map(&:to_s)
156
- end
150
+ kwargs[:parallel] = if kwargs[:pattern].is_a?(Array)
151
+ parallel.map(&:to_s)
152
+ else
153
+ kwargs[:pattern] = []
154
+ parallel.reject { |val| kwargs[:pattern] << val if val.is_a?(Regexp) }.map!(&:to_s)
155
+ end
157
156
  @pass[:pattern].concat(pass.map { |val| val.is_a?(Regexp) ? val : val.to_s }) if pass
158
157
  @project.each_value do |proj|
159
158
  if proj.enabled?
@@ -323,17 +322,9 @@ module Squared
323
322
  end
324
323
 
325
324
  def add(path, project = nil, **kwargs, &blk)
326
- kwargs = @withargs.yield_self { |data| data.dup.update(kwargs) } if @withargs
327
- ref = if kwargs.key?(:ref)
328
- kwargs = kwargs.dup unless @withargs
329
- kwargs.delete(:ref)
330
- elsif @ref.is_a?(Symbol)
331
- @ref
332
- end
333
- if @group.is_a?(String) && !kwargs.key?(:group)
334
- kwargs = kwargs.dup unless @withargs
335
- kwargs[:group] = @group
336
- end
325
+ kwargs = Support.hashdup(@withargs).update(kwargs) if @withargs
326
+ ref = kwargs.key?(:ref) ? kwargs.delete(:ref) : @ref
327
+ kwargs[:group] = @group if @group && !kwargs.key?(:group)
337
328
  path = root + path
338
329
  project = (project || path.basename).to_s
339
330
  name = task_name project
@@ -634,9 +625,7 @@ module Squared
634
625
  end
635
626
 
636
627
  def home?
637
- return false unless (proj = find(home))
638
-
639
- proj.enabled?
628
+ !!find(home)&.enabled?
640
629
  end
641
630
 
642
631
  def windows?