squared 0.2.10 → 0.2.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 +4 -4
- data/CHANGELOG.md +43 -1
- data/lib/squared/common/base.rb +5 -2
- data/lib/squared/common/format.rb +3 -1
- data/lib/squared/common/system.rb +21 -14
- data/lib/squared/config.rb +2 -0
- data/lib/squared/version.rb +1 -1
- data/lib/squared/workspace/application.rb +11 -3
- data/lib/squared/workspace/project/base.rb +12 -9
- data/lib/squared/workspace/project/git.rb +26 -18
- data/lib/squared/workspace/project/node.rb +13 -8
- data/lib/squared/workspace/project/ruby.rb +5 -5
- data/lib/squared/workspace/repo.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c4f586dc4eb61a4952f9093d90f52b07bd95b920ddeb2f3f10df67c5d32a936
|
4
|
+
data.tar.gz: d2c688164ad5033e3d662fda16b63809cc2c6f1020b963d7ef15b3f61571f457
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8cebf94bb4963e7b8c2515df1c2a02e3c7a919a702eea06f66840c73cfd87cdaf3069c8dece4487385ecc421bb858934a87f320ecfeedec89964971147a3810d
|
7
|
+
data.tar.gz: d0917560fbe4c49c70269b1f4cfbe1f63b1c460eb9d1658046b9c23b1764182007533556d2fceb174b452424d835928a67815ba22927a435f872aeb5c8611772
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,43 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [0.2.12] - 2025-07-05
|
4
|
+
|
5
|
+
### Fixed
|
6
|
+
|
7
|
+
- See `0.1.9`.
|
8
|
+
|
9
|
+
## [0.1.9] - 2025-07-05
|
10
|
+
|
11
|
+
### Added
|
12
|
+
|
13
|
+
- Initial support for using JRuby.
|
14
|
+
- Config viewer theme color for boolean was implemented.
|
15
|
+
|
16
|
+
### Fixed
|
17
|
+
|
18
|
+
- Workspace did not add prefix to duplicate project names.
|
19
|
+
- Project output divider was not printed when not verbose.
|
20
|
+
- Directory context was not threaded using JRuby.
|
21
|
+
- Index character was not captured on Windows.
|
22
|
+
- Common method is used for Kernel shell commands.
|
23
|
+
- Git did not highlight output for single commands.
|
24
|
+
|
25
|
+
## [0.2.11] - 2025-05-15
|
26
|
+
|
27
|
+
### Fixed
|
28
|
+
|
29
|
+
- Disabled batch and alias tasks were not hidden.
|
30
|
+
- Workspace git did not parse multiple download URIs.
|
31
|
+
|
32
|
+
## [0.1.8] - 2025-05-15
|
33
|
+
|
34
|
+
### Fixed
|
35
|
+
|
36
|
+
- Disabled batch and alias tasks were not hidden.
|
37
|
+
- Log messages were written to terminal twice when emphasized.
|
38
|
+
- Node outdated interactive for major would sometimes deactivate.
|
39
|
+
- Node outdated interactive for major was mislabeled as minor.
|
40
|
+
|
3
41
|
## [0.2.10] - 2025-04-27
|
4
42
|
|
5
43
|
### Fixed
|
@@ -190,7 +228,7 @@
|
|
190
228
|
- Node tasks without any action are not displayed.
|
191
229
|
- Git fetch commands that do not apply to pull are rejected.
|
192
230
|
|
193
|
-
## [0.1.3] -
|
231
|
+
## [0.1.3] - 2025-01-02
|
194
232
|
|
195
233
|
### Fixed
|
196
234
|
|
@@ -269,6 +307,8 @@
|
|
269
307
|
|
270
308
|
- Changelog was created.
|
271
309
|
|
310
|
+
[0.2.12]: https://github.com/anpham6/squared/releases/tag/v0.2.12-ruby
|
311
|
+
[0.2.11]: https://github.com/anpham6/squared/releases/tag/v0.2.11-ruby
|
272
312
|
[0.2.10]: https://github.com/anpham6/squared/releases/tag/v0.2.10-ruby
|
273
313
|
[0.2.9]: https://github.com/anpham6/squared/releases/tag/v0.2.9-ruby
|
274
314
|
[0.2.8]: https://github.com/anpham6/squared/releases/tag/v0.2.8-ruby
|
@@ -280,6 +320,8 @@
|
|
280
320
|
[0.2.2]: https://github.com/anpham6/squared/releases/tag/v0.2.2-ruby
|
281
321
|
[0.2.1]: https://github.com/anpham6/squared/releases/tag/v0.2.1-ruby
|
282
322
|
[0.2.0]: https://github.com/anpham6/squared/releases/tag/v0.2.0-ruby
|
323
|
+
[0.1.9]: https://github.com/anpham6/squared/releases/tag/v0.1.9-ruby
|
324
|
+
[0.1.8]: https://github.com/anpham6/squared/releases/tag/v0.1.8-ruby
|
283
325
|
[0.1.7]: https://github.com/anpham6/squared/releases/tag/v0.1.7-ruby
|
284
326
|
[0.1.6]: https://github.com/anpham6/squared/releases/tag/v0.1.6-ruby
|
285
327
|
[0.1.5]: https://github.com/anpham6/squared/releases/tag/v0.1.5-ruby
|
data/lib/squared/common/base.rb
CHANGED
@@ -53,6 +53,7 @@ module Squared
|
|
53
53
|
hash: %i[green black!],
|
54
54
|
array: %i[blue black!],
|
55
55
|
number: [:magenta],
|
56
|
+
boolean: [:magenta],
|
56
57
|
undefined: %i[red italic]
|
57
58
|
},
|
58
59
|
logger: {
|
@@ -93,13 +94,15 @@ module Squared
|
|
93
94
|
return [] if obj.nil?
|
94
95
|
|
95
96
|
unless obj.is_a?(::Array)
|
96
|
-
obj = if obj.respond_to?(:
|
97
|
+
obj = if obj.respond_to?(:to_ary)
|
98
|
+
obj.to_ary
|
99
|
+
elsif obj.respond_to?(:to_a) && !obj.is_a?(::Hash) && (val = obj.to_a).is_a?(::Array)
|
97
100
|
val
|
98
101
|
else
|
99
102
|
[obj]
|
100
103
|
end
|
101
104
|
end
|
102
|
-
obj =
|
105
|
+
obj = flat.is_a?(::Numeric) ? obj.flatten(flat) : obj.flatten if flat
|
103
106
|
obj = obj.compact if compact
|
104
107
|
obj = obj.map(&meth) if meth
|
105
108
|
block_given? ? obj.select(&blk) : obj
|
@@ -171,7 +171,7 @@ module Squared
|
|
171
171
|
if args.size > 1
|
172
172
|
title = log_title(level, color: false)
|
173
173
|
sub = { pat: /^(#{title})(.+)$/, styles: __get__(:theme)[:logger][log_sym(level)] } if color
|
174
|
-
emphasize(args, title: title + (subject ? " #{subject}" : ''), sub: sub)
|
174
|
+
emphasize(args, title: title + (subject ? " #{subject}" : ''), sub: sub, pipe: -1)
|
175
175
|
else
|
176
176
|
msg = [log_title(level, color: color)]
|
177
177
|
msg << (color ? sub_style(subject, :underline) : subject) if subject
|
@@ -257,6 +257,8 @@ module Squared
|
|
257
257
|
yield out
|
258
258
|
elsif pipe
|
259
259
|
case pipe
|
260
|
+
when -1
|
261
|
+
return out
|
260
262
|
when 0
|
261
263
|
pipe = $stdin
|
262
264
|
when 2
|
@@ -1,23 +1,32 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'pathname'
|
4
|
-
require '
|
4
|
+
require 'rake'
|
5
5
|
|
6
6
|
module Squared
|
7
7
|
module Common
|
8
8
|
module System
|
9
9
|
module_function
|
10
10
|
|
11
|
-
def shell(*args, **kwargs)
|
12
|
-
if
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
11
|
+
def shell(*args, name: :system, **kwargs)
|
12
|
+
if RUBY_ENGINE == 'jruby' && Rake::Win32.windows?
|
13
|
+
e = kwargs[:exception]
|
14
|
+
if (dir = kwargs[:chdir]) && ((pwd = Dir.pwd) != dir)
|
15
|
+
Dir.chdir(dir)
|
16
|
+
ret = Kernel.send(name, *args)
|
17
|
+
Dir.chdir(pwd)
|
18
|
+
else
|
19
|
+
ret = Kernel.send(name, *args)
|
20
|
+
end
|
21
|
+
elsif RUBY_VERSION < '2.6'
|
22
|
+
e = kwargs.delete(:exception)
|
23
|
+
ret = Kernel.send(name, *args, **kwargs)
|
18
24
|
else
|
19
|
-
|
25
|
+
return Kernel.send(name, *args, **kwargs)
|
20
26
|
end
|
27
|
+
return ret if ret || !e
|
28
|
+
|
29
|
+
raise $?.to_s
|
21
30
|
end
|
22
31
|
|
23
32
|
def copy_dir(src, dest, glob = ['**/*'], create: false, link: nil, force: false, pass: nil, verbose: true)
|
@@ -29,10 +38,9 @@ module Squared
|
|
29
38
|
dest.mkpath if create
|
30
39
|
if pass
|
31
40
|
exclude = []
|
32
|
-
pass
|
33
|
-
pass.each { |val| exclude += Dir.glob(src.join(val)) }
|
41
|
+
Array(pass).each { |val| exclude += Dir.glob(src.join(val)) }
|
34
42
|
end
|
35
|
-
(glob
|
43
|
+
Array(glob).each do |val|
|
36
44
|
Dir.glob(src.join(val)) do |path|
|
37
45
|
next if exclude&.include?(path) || (path = Pathname.new(path)).directory?
|
38
46
|
|
@@ -79,8 +87,7 @@ module Squared
|
|
79
87
|
def copy_guard(src, dest, link: nil, force: false, verbose: true)
|
80
88
|
unless force
|
81
89
|
if (path = Pathname.new(dest)).directory?
|
82
|
-
src =
|
83
|
-
src = src.reject { |val| path.join(File.basename(val)).exist? }
|
90
|
+
src = Array(src).reject { |val| path.join(File.basename(val)).exist? }
|
84
91
|
return if src.empty?
|
85
92
|
elsif path.exist?
|
86
93
|
return
|
data/lib/squared/config.rb
CHANGED
@@ -249,6 +249,8 @@ module Squared
|
|
249
249
|
{ pat: /\A(.+ : ")(.+)("\s*)\z/m, styles: theme[:string], index: 2 },
|
250
250
|
{ pat: /\A(.+ : \{)(.+)(\}\s*)\z/m, styles: theme[:hash], index: 2 },
|
251
251
|
{ pat: /\A(.+ : \[)(.+)(\]\s*)\z/m, styles: theme[:array], index: 2 },
|
252
|
+
{ pat: /\A(.+ : )(true|false)(\s*)\z/m, styles: theme[:boolean],
|
253
|
+
index: 2 },
|
252
254
|
{ pat: /\A(.+ : (?!undefined))([^"\[{].*)\z/m, styles: theme[:value],
|
253
255
|
index: 2 }
|
254
256
|
]
|
data/lib/squared/version.rb
CHANGED
@@ -268,7 +268,7 @@ module Squared
|
|
268
268
|
index = 0
|
269
269
|
while @project[name]
|
270
270
|
index += 1
|
271
|
-
name = "#{project}-#{index}"
|
271
|
+
name = task_name "#{project}-#{index}"
|
272
272
|
end
|
273
273
|
proj = ((if !ref.is_a?(Class)
|
274
274
|
Application.find(ref, path: path)
|
@@ -427,7 +427,7 @@ module Squared
|
|
427
427
|
tasks << key if obj.has?(key, baseref)
|
428
428
|
elsif (batch = series.batch_get(key))
|
429
429
|
obj.allref.each do |ref|
|
430
|
-
next unless (data = batch[ref])
|
430
|
+
next unless obj.has?(key, ref) && (data = batch[ref])
|
431
431
|
|
432
432
|
data.each do |val|
|
433
433
|
if (items = task_resolve(obj, val)).empty?
|
@@ -446,7 +446,7 @@ module Squared
|
|
446
446
|
return [] if (base && !obj.ref?(baseref)) || !(data = series.alias_get(key))
|
447
447
|
|
448
448
|
obj.allref.each do |ref|
|
449
|
-
next unless (alt = data[ref])
|
449
|
+
next unless obj.has?(key, ref) && (alt = data[ref])
|
450
450
|
|
451
451
|
ret = task_resolve(obj, alt)
|
452
452
|
break unless ret.empty?
|
@@ -548,6 +548,14 @@ module Squared
|
|
548
548
|
Rake::Win32.windows?
|
549
549
|
end
|
550
550
|
|
551
|
+
def jruby?
|
552
|
+
RUBY_ENGINE == 'jruby'
|
553
|
+
end
|
554
|
+
|
555
|
+
def jruby_win?
|
556
|
+
jruby? && windows?
|
557
|
+
end
|
558
|
+
|
551
559
|
def rootpath(*args)
|
552
560
|
root.join(*args)
|
553
561
|
end
|
@@ -703,7 +703,7 @@ module Squared
|
|
703
703
|
|
704
704
|
t = dedupe.(proj.name)
|
705
705
|
j = if out
|
706
|
-
if i == items.size - 1 || check.(post = items[i + 1..-1]).empty?
|
706
|
+
if i == items.size - 1 || check.(post = items[(i + 1)..-1]).empty?
|
707
707
|
true
|
708
708
|
elsif !t.empty? && depth > 0
|
709
709
|
post.reject { |pr| t.include?(pr) }.empty?
|
@@ -820,11 +820,11 @@ module Squared
|
|
820
820
|
reg, list = list.partition do |val|
|
821
821
|
next unless (n = val.index('='))
|
822
822
|
|
823
|
-
bare << val[0..n - 1] if val.end_with?('?')
|
823
|
+
bare << val[0..(n - 1)] if val.end_with?('?')
|
824
824
|
true
|
825
825
|
end
|
826
826
|
list += bare
|
827
|
-
no = no.map { |val| (n = val.index('=')) ? val[0..n - 1] : val }
|
827
|
+
no = no.map { |val| (n = val.index('=')) ? val[0..(n - 1)] : val }
|
828
828
|
found = false
|
829
829
|
opts.each do |opt|
|
830
830
|
next out << opt if found
|
@@ -838,7 +838,7 @@ module Squared
|
|
838
838
|
found = true if first && pass.none? { |val| opt.include?(val) }
|
839
839
|
end
|
840
840
|
end
|
841
|
-
pat = Regexp.new("^(#{reg.map { |val| val[0..val.index('=') - 1] }.join('|')})=(.+)$")
|
841
|
+
pat = Regexp.new("^(#{reg.map { |val| val[0..(val.index('=') - 1)] }.join('|')})=(.+)$")
|
842
842
|
[out, pat]
|
843
843
|
end
|
844
844
|
|
@@ -851,7 +851,7 @@ module Squared
|
|
851
851
|
end
|
852
852
|
|
853
853
|
def print_item(*val)
|
854
|
-
puts if @@print_order > 0
|
854
|
+
puts if @@print_order > 0
|
855
855
|
@@print_order += 1
|
856
856
|
puts val unless val.empty? || (val.size == 1 && val.first.nil?)
|
857
857
|
end
|
@@ -1077,15 +1077,17 @@ module Squared
|
|
1077
1077
|
end
|
1078
1078
|
|
1079
1079
|
def indexitem(val)
|
1080
|
-
|
1081
|
-
|
1082
|
-
[data[1].to_i, data[2] ? data[2][1..-1] : nil]
|
1080
|
+
[$1.to_i, $2 && $2[1..-1]] if val =~ /\A#{Regexp.escape(indexchar)}(\d+)(:.+)?\z/
|
1083
1081
|
end
|
1084
1082
|
|
1085
1083
|
def indexerror(val, list = nil)
|
1086
1084
|
raise_error("requested index #{val}", hint: list && "of #{list.size}")
|
1087
1085
|
end
|
1088
1086
|
|
1087
|
+
def indexchar
|
1088
|
+
workspace.windows? ? '+' : '^'
|
1089
|
+
end
|
1090
|
+
|
1089
1091
|
def color(val)
|
1090
1092
|
ret = theme[val]
|
1091
1093
|
ret && !ret.empty? ? ret : [val]
|
@@ -1119,7 +1121,8 @@ module Squared
|
|
1119
1121
|
pwd = Pathname.pwd
|
1120
1122
|
if block_given?
|
1121
1123
|
begin
|
1122
|
-
|
1124
|
+
pass = semscan(pass).join <= RUBY_VERSION if pass.is_a?(String)
|
1125
|
+
if (path == pwd || pass == true) && !workspace.jruby_win?
|
1123
1126
|
ret = instance_eval(&blk)
|
1124
1127
|
else
|
1125
1128
|
Dir.chdir(path)
|
@@ -12,7 +12,11 @@ module Squared
|
|
12
12
|
check = ->(proj) { proj.is_a?(Project::Git) && !proj.exclude?(Project::Git.ref) && git_clone?(proj.path) }
|
13
13
|
if uri.is_a?(Array)
|
14
14
|
base = name
|
15
|
-
uri.each
|
15
|
+
uri.each do |val|
|
16
|
+
if (proj = @project[val.to_s]) && check.(proj)
|
17
|
+
repo << proj
|
18
|
+
end
|
19
|
+
end
|
16
20
|
elsif uri
|
17
21
|
data[name.to_s] = uri
|
18
22
|
elsif name.is_a?(Enumerable)
|
@@ -456,7 +460,7 @@ module Squared
|
|
456
460
|
source(sync: sync, sub: if verbose
|
457
461
|
[
|
458
462
|
{ pat: /^(.+)(\|\s+\d+\s+)([^-]*)(-+)(.*)$/, styles: :red, index: 4 },
|
459
|
-
{ pat: /^(.+)(\|\s+\d+\s+)(\++)(
|
463
|
+
{ pat: /^(.+)(\|\s+\d+\s+)(\++)(.*)$/, styles: :green, index: 3 }
|
460
464
|
]
|
461
465
|
end, **threadargs)
|
462
466
|
end
|
@@ -728,7 +732,8 @@ module Squared
|
|
728
732
|
origin = nil
|
729
733
|
source(git_output('fetch --no-tags --quiet'), io: true, banner: false, stdout: true)
|
730
734
|
cmd = git_output("for-each-ref --format=\"#{format}\" refs/heads")
|
731
|
-
source(cmd, io: true, banner: false).first
|
735
|
+
out = source(cmd, io: true, stdout: workspace.windows?, banner: false).first
|
736
|
+
(workspace.windows? ? out.lines : out).each do |line|
|
732
737
|
next if (line = line.chomp).empty?
|
733
738
|
|
734
739
|
branch, origin, hint = line.split('...')
|
@@ -742,8 +747,8 @@ module Squared
|
|
742
747
|
break
|
743
748
|
end
|
744
749
|
i = origin.index('/')
|
745
|
-
branch = "#{branch}:#{origin[i + 1..-1]}" unless origin.end_with?("/#{branch}")
|
746
|
-
origin = origin[0..i - 1]
|
750
|
+
branch = "#{branch}:#{origin[(i + 1)..-1]}" unless origin.end_with?("/#{branch}")
|
751
|
+
origin = origin[0..(i - 1)]
|
747
752
|
cmd = git_session('commit', option('dry-run') && '--dry-run', options: false)
|
748
753
|
cmd << '--amend' if amend
|
749
754
|
if message
|
@@ -930,9 +935,14 @@ module Squared
|
|
930
935
|
format_banner((banner.is_a?(String) ? banner : cmd).gsub(File.join(path, ''), ''), banner: true)
|
931
936
|
end
|
932
937
|
begin
|
933
|
-
|
934
|
-
|
935
|
-
|
938
|
+
if io
|
939
|
+
ret = if stdout
|
940
|
+
[`#{cmd}`]
|
941
|
+
else
|
942
|
+
[IO.popen(cmd), banner, from]
|
943
|
+
end
|
944
|
+
return ret
|
945
|
+
elsif stdin? ? sync : stdout
|
936
946
|
print_item banner unless multiple
|
937
947
|
ret = `#{cmd}`
|
938
948
|
if !ret.empty?
|
@@ -940,7 +950,7 @@ module Squared
|
|
940
950
|
elsif banner && stdout && !stdin?
|
941
951
|
puts 'Success'
|
942
952
|
end
|
943
|
-
elsif sync || (!exception && !stderr)
|
953
|
+
elsif !sub && (sync || (!exception && !stderr))
|
944
954
|
print_item banner unless multiple
|
945
955
|
shell(cmd, exception: exception)
|
946
956
|
else
|
@@ -995,15 +1005,13 @@ module Squared
|
|
995
1005
|
end
|
996
1006
|
|
997
1007
|
def list_result(size, type, from: nil, action: 'found', grep: nil)
|
998
|
-
if
|
999
|
-
|
1000
|
-
|
1001
|
-
|
1002
|
-
|
1003
|
-
|
1004
|
-
|
1005
|
-
puts empty_status("No #{type} were #{action}", 'grep', grep)
|
1006
|
-
end
|
1008
|
+
if size == 0
|
1009
|
+
puts empty_status("No #{type} were #{action}", 'grep', grep)
|
1010
|
+
elsif verbose
|
1011
|
+
styles = theme.fetch(:banner, []).reject { |s| s.to_s.end_with?('!') }
|
1012
|
+
styles << :bold if styles.size <= 1
|
1013
|
+
puts print_footer("#{size} #{size == 1 ? type.sub(/(?:(?<!l)e)?s\z/, '') : type}",
|
1014
|
+
sub: { pat: /\A(\d+)(.+)\z/, styles: styles })
|
1007
1015
|
end
|
1008
1016
|
on :last, from if from
|
1009
1017
|
end
|
@@ -72,7 +72,7 @@ module Squared
|
|
72
72
|
case action
|
73
73
|
when 'add'
|
74
74
|
format_desc action, nil, 'save?=prod|dev|optional|peer,name+'
|
75
|
-
task action, [:save
|
75
|
+
task action, [:save] do |_, args|
|
76
76
|
save = param_guard(action, 'save', args: args, key: :save)
|
77
77
|
if save.start_with?('=')
|
78
78
|
exact = true
|
@@ -80,7 +80,7 @@ module Squared
|
|
80
80
|
end
|
81
81
|
case save
|
82
82
|
when 'prod', 'dev', 'optional', 'peer'
|
83
|
-
name = param_guard(action, 'name', args: args.
|
83
|
+
name = param_guard(action, 'name', args: args.extras)
|
84
84
|
else
|
85
85
|
save = 'prod'
|
86
86
|
name = param_guard(action, 'name', args: args.to_a)
|
@@ -90,10 +90,10 @@ module Squared
|
|
90
90
|
when 'run'
|
91
91
|
next if (list = read_scripts).empty?
|
92
92
|
|
93
|
-
format_desc action, nil,
|
93
|
+
format_desc action, nil, "command+|#{indexchar}index|#,pattern*"
|
94
94
|
task action, [:command] do |_, args|
|
95
95
|
if args.command == '#'
|
96
|
-
format_list(list,
|
96
|
+
format_list(list, "run[#{indexchar}N]", 'scripts', grep: args.extras, from: dependfile.to_s)
|
97
97
|
else
|
98
98
|
cmd = param_guard(action, 'command', args: args.to_a)
|
99
99
|
cmd.each do |val|
|
@@ -403,7 +403,7 @@ module Squared
|
|
403
403
|
index = if a != c
|
404
404
|
1
|
405
405
|
elsif b != d
|
406
|
-
3
|
406
|
+
a == '0' ? 1 : 3
|
407
407
|
else
|
408
408
|
5
|
409
409
|
end
|
@@ -437,7 +437,8 @@ module Squared
|
|
437
437
|
col2 = size_col.(found, 1) + 4
|
438
438
|
found.each_with_index do |item, i|
|
439
439
|
a, b, c, d, e = item
|
440
|
-
|
440
|
+
f = inter && (rev != :major || e || semmajor?(item[5], item[6]))
|
441
|
+
if f && !confirm_outdated(a, c, d, e)
|
441
442
|
cur = -1
|
442
443
|
else
|
443
444
|
cur = modified
|
@@ -605,6 +606,10 @@ module Squared
|
|
605
606
|
dependfile.exist?
|
606
607
|
end
|
607
608
|
|
609
|
+
def refresh?
|
610
|
+
!Node.prod?
|
611
|
+
end
|
612
|
+
|
608
613
|
def yarn?
|
609
614
|
(@pm[:yarn] ||= if basepath('yarn.lock', ascend: dependext).exist?
|
610
615
|
if (rc = basepath('.yarnrc.yml', ascend: dependext)).exist?
|
@@ -685,7 +690,7 @@ module Squared
|
|
685
690
|
def read_packagemanager(key = nil, version: nil, update: false)
|
686
691
|
if @pm[:_].nil? || update
|
687
692
|
doc = JSON.parse(dependfile.read)
|
688
|
-
@pm[:_] = (val = doc['packageManager']) ? val[0..(val.index('+') || 0) - 1] : false
|
693
|
+
@pm[:_] = (val = doc['packageManager']) ? val[0..((val.index('+') || 0) - 1)] : false
|
689
694
|
@pm[:name] = doc['name']
|
690
695
|
@pm[:scripts] = doc['scripts']
|
691
696
|
@pm[:version] = doc['version']
|
@@ -698,7 +703,7 @@ module Squared
|
|
698
703
|
else
|
699
704
|
return @pm[key] if key
|
700
705
|
|
701
|
-
!(ret = @pm[:_]) || (version && ret[ret.index('@') + 1..-1] < version) ? nil : ret
|
706
|
+
!(ret = @pm[:_]) || (version && ret[(ret.index('@') + 1)..-1] < version) ? nil : ret
|
702
707
|
end
|
703
708
|
|
704
709
|
def read_install
|
@@ -110,11 +110,11 @@ module Squared
|
|
110
110
|
when 'rake'
|
111
111
|
next unless rakefile
|
112
112
|
|
113
|
-
format_desc action, nil,
|
113
|
+
format_desc action, nil, "command*|#{indexchar}index,args*|#,pattern*"
|
114
114
|
task action, [:command] do |_, args|
|
115
115
|
if args.command == '#'
|
116
|
-
format_list(read_rakefile,
|
117
|
-
|
116
|
+
format_list(read_rakefile, "rake[#{indexchar}N]", 'tasks', grep: args.extras, from: rakefile.to_s,
|
117
|
+
each: ->(val) { val[0] + val[1].to_s })
|
118
118
|
elsif (data = indexitem(args.command))
|
119
119
|
n, opts = data
|
120
120
|
list = read_rakefile
|
@@ -470,8 +470,8 @@ module Squared
|
|
470
470
|
cmd << shell_escape(project)
|
471
471
|
version = name[1..-1]
|
472
472
|
else
|
473
|
-
cmd << shell_escape(name[0..n - 1])
|
474
|
-
version = name[n + 1..-1]
|
473
|
+
cmd << shell_escape(name[0..(n - 1)])
|
474
|
+
version = name[(n + 1)..-1]
|
475
475
|
end
|
476
476
|
cmd << shell_option('version', version)
|
477
477
|
out.clear
|
@@ -172,7 +172,7 @@ module Squared
|
|
172
172
|
parse_opts.(args)
|
173
173
|
stage = 'init'
|
174
174
|
puts if newline
|
175
|
-
|
175
|
+
Common::System.shell("repo init -u #{manifest_url} -m #{args.manifest || target}.xml", chdir: root)
|
176
176
|
repo['all'].invoke
|
177
177
|
end
|
178
178
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: squared
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- An Pham
|
8
8
|
bindir: exe
|
9
9
|
cert_chain: []
|
10
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: rake
|
@@ -120,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
120
120
|
- !ruby/object:Gem::Version
|
121
121
|
version: '0'
|
122
122
|
requirements: []
|
123
|
-
rubygems_version: 3.6.
|
123
|
+
rubygems_version: 3.6.7
|
124
124
|
specification_version: 4
|
125
125
|
summary: Rake task generator for managing multi-language workspaces.
|
126
126
|
test_files: []
|