squared 0.2.4 → 0.2.6
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 +37 -3
- data/lib/squared/common/shell.rb +4 -3
- data/lib/squared/version.rb +1 -1
- data/lib/squared/workspace/project/base.rb +11 -11
- data/lib/squared/workspace/project/git.rb +4 -4
- data/lib/squared/workspace/project/node.rb +6 -3
- data/squared.gemspec +1 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe89fb72998e6b7f728add465bb1a56a43d235949b335b18ac75a03899d5a01c
|
4
|
+
data.tar.gz: 36b8255d2d4a0b8e9574d81191b469b4a8258dddd33c8ad9146c9c78c71d3a23
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85d16ee391ec6668b1f658940c1f1c945c5b2389585ba0283b98d605f74329d715f890b6b8373eace007fe157a594b85ea7457f6175f222d890b30dee59253ef
|
7
|
+
data.tar.gz: f4a9f773d117a6aea52238c05ae4e3eefdedd3b18bf2ecf5955e8b4dc889193fe72efd35a40f3579006fecfe62b8c09e4579f7ac5bbb1e10b745bf5a95e7d9d7
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,27 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [0.2.6] - 2025-03-06
|
4
|
+
|
5
|
+
### Fixed
|
6
|
+
|
7
|
+
- Git rebase did not include flag with pull command.
|
8
|
+
|
9
|
+
## [0.2.5] - 2025-02-25
|
10
|
+
|
11
|
+
### Fixed
|
12
|
+
|
13
|
+
- See `0.1.5`.
|
14
|
+
|
15
|
+
## [0.1.5] - 2025-02-25
|
16
|
+
|
17
|
+
### Fixed
|
18
|
+
|
19
|
+
- Node copy method ignored include argument when called directly.
|
20
|
+
- Logger is not initialized when using only Git base class.
|
21
|
+
- Hide warnings about readline during execution.
|
22
|
+
- Logger is not initialized when using only base class.
|
23
|
+
- Merging ENV build options were double escaped.
|
24
|
+
|
3
25
|
## [0.2.4] - 2025-02-12
|
4
26
|
|
5
27
|
### Fixed
|
@@ -11,8 +33,16 @@
|
|
11
33
|
|
12
34
|
### Fixed
|
13
35
|
|
14
|
-
|
15
|
-
|
36
|
+
- Project hash options duplicated dash prefix.
|
37
|
+
|
38
|
+
## [0.1.4] - 2025-02-05
|
39
|
+
|
40
|
+
### Fixed
|
41
|
+
|
42
|
+
- Build options with array args were not recognized.
|
43
|
+
- Base clean command did not enumerate non-string values.
|
44
|
+
- Git command refs did not include ref option.
|
45
|
+
- Pip upgrade did not append package names.
|
16
46
|
|
17
47
|
## [0.2.2] - 2025-01-19
|
18
48
|
|
@@ -133,7 +163,7 @@
|
|
133
163
|
- Workspace did not check base project for Windows filename.
|
134
164
|
- Regexp for SemVer did not recognize package names.
|
135
165
|
|
136
|
-
## [0.1.1] -
|
166
|
+
## [0.1.1] - 2024-12-14
|
137
167
|
|
138
168
|
### Added
|
139
169
|
|
@@ -183,11 +213,15 @@
|
|
183
213
|
|
184
214
|
- Changelog was created.
|
185
215
|
|
216
|
+
[0.2.6]: https://github.com/anpham6/squared/releases/tag/v0.2.6-ruby
|
217
|
+
[0.2.5]: https://github.com/anpham6/squared/releases/tag/v0.2.5-ruby
|
186
218
|
[0.2.4]: https://github.com/anpham6/squared/releases/tag/v0.2.4-ruby
|
187
219
|
[0.2.3]: https://github.com/anpham6/squared/releases/tag/v0.2.3-ruby
|
188
220
|
[0.2.2]: https://github.com/anpham6/squared/releases/tag/v0.2.2-ruby
|
189
221
|
[0.2.1]: https://github.com/anpham6/squared/releases/tag/v0.2.1-ruby
|
190
222
|
[0.2.0]: https://github.com/anpham6/squared/releases/tag/v0.2.0-ruby
|
223
|
+
[0.1.5]: https://github.com/anpham6/squared/releases/tag/v0.1.5-ruby
|
224
|
+
[0.1.4]: https://github.com/anpham6/squared/releases/tag/v0.1.4-ruby
|
191
225
|
[0.1.3]: https://github.com/anpham6/squared/releases/tag/v0.1.3-ruby
|
192
226
|
[0.1.2]: https://github.com/anpham6/squared/releases/tag/v0.1.2-ruby
|
193
227
|
[0.1.1]: https://github.com/anpham6/squared/releases/tag/v0.1.1-ruby
|
data/lib/squared/common/shell.rb
CHANGED
@@ -10,7 +10,7 @@ module Squared
|
|
10
10
|
|
11
11
|
def shell_escape(val, quote: false, force: false)
|
12
12
|
if (data = /\A(--?[^= ]+)((=|\s+)(["'])?(.+?)(["'])?)?\z/m.match(val = val.to_s))
|
13
|
-
return val
|
13
|
+
return val if !data[2] || (!data[4] && data[5] =~ /\s/)
|
14
14
|
|
15
15
|
join = ->(opt) { data[1] + data[3] + shell_quote(opt) }
|
16
16
|
if data[4] == data[6]
|
@@ -32,8 +32,9 @@ module Squared
|
|
32
32
|
Rake::Win32.windows? ? "\"#{double_quote(val)}\"" : "'#{single_quote(val)}'"
|
33
33
|
end
|
34
34
|
|
35
|
-
def shell_split(val, quote: false, join: nil)
|
36
|
-
val = Shellwords.split(val)
|
35
|
+
def shell_split(val, escape: true, quote: false, join: nil)
|
36
|
+
val = Shellwords.split(val)
|
37
|
+
val = val.map { |opt| shell_escape(opt, quote: quote) } if escape
|
37
38
|
return val unless join
|
38
39
|
|
39
40
|
val.join(join.is_a?(::String) ? join : ' ')
|
data/lib/squared/version.rb
CHANGED
@@ -199,14 +199,14 @@ module Squared
|
|
199
199
|
@prod = env_match("#{pre}_PROD", prod)
|
200
200
|
cmd = @output[0]
|
201
201
|
unless cmd == false || cmd.is_a?(Array) || (val = env('BUILD', suffix: 'OPTS')).nil?
|
202
|
-
@output[cmd ? 1 : 3] = shell_split(val, join: true)
|
202
|
+
@output[cmd ? 1 : 3] = shell_split(val, escape: false, join: true)
|
203
203
|
end
|
204
204
|
unless @output[2] == false || (val = env('BUILD', suffix: 'ENV')).nil?
|
205
205
|
begin
|
206
206
|
data = JSON.parse(val)
|
207
207
|
raise_error('invalid JSON object', val, hint: "#{prefix}_ENV") unless data.is_a?(Hash)
|
208
208
|
rescue StandardError => e
|
209
|
-
log
|
209
|
+
log&.warn e
|
210
210
|
else
|
211
211
|
@output[2] = data
|
212
212
|
end
|
@@ -297,7 +297,7 @@ module Squared
|
|
297
297
|
if val.directory? && !val.empty?
|
298
298
|
true
|
299
299
|
else
|
300
|
-
log
|
300
|
+
log&.warn "workspace \"#{val}\" (#{val.empty? ? 'empty' : 'not found'})"
|
301
301
|
false
|
302
302
|
end
|
303
303
|
end
|
@@ -411,17 +411,17 @@ module Squared
|
|
411
411
|
val = val.to_s
|
412
412
|
path = basepath(val)
|
413
413
|
if path.directory? && val =~ %r{[\\/]\z}
|
414
|
-
log
|
414
|
+
log&.warn "rm -rf #{path}"
|
415
415
|
path.rmtree(verbose: true)
|
416
416
|
else
|
417
|
-
log
|
417
|
+
log&.warn "rm #{path}"
|
418
418
|
(val.include?('*') ? Dir[path] : [path]).each do |file|
|
419
419
|
next unless File.file?(file)
|
420
420
|
|
421
421
|
begin
|
422
422
|
File.delete(file)
|
423
423
|
rescue StandardError => e
|
424
|
-
log
|
424
|
+
log&.error e
|
425
425
|
end
|
426
426
|
end
|
427
427
|
end
|
@@ -500,7 +500,7 @@ module Squared
|
|
500
500
|
instance_variable_set :"@#{key}", val.first
|
501
501
|
end
|
502
502
|
else
|
503
|
-
log
|
503
|
+
log&.warn "variable_set: @#{key} (private)"
|
504
504
|
end
|
505
505
|
end
|
506
506
|
|
@@ -624,11 +624,11 @@ module Squared
|
|
624
624
|
|
625
625
|
def run(cmd = @session, var = nil, exception: @exception, sync: true, banner: true, chdir: path, from: nil, **)
|
626
626
|
cmd = session_done(cmd)
|
627
|
-
log
|
627
|
+
log&.info cmd
|
628
628
|
on :first, from if from
|
629
629
|
begin
|
630
630
|
if cmd.match?(/\A[^:]+:[^:]/) && workspace.task_defined?(cmd)
|
631
|
-
log
|
631
|
+
log&.warn "ENV was discarded: #{var}" if var
|
632
632
|
task_invoke(cmd, exception: exception, warning: warning?)
|
633
633
|
else
|
634
634
|
print_item format_banner(cmd, banner: banner) if sync
|
@@ -636,7 +636,7 @@ module Squared
|
|
636
636
|
shell(*args, chdir: chdir, exception: exception)
|
637
637
|
end
|
638
638
|
rescue StandardError => e
|
639
|
-
log
|
639
|
+
log&.error e
|
640
640
|
ret = on(:error, from, e) if from
|
641
641
|
raise unless ret == true
|
642
642
|
else
|
@@ -1119,7 +1119,7 @@ module Squared
|
|
1119
1119
|
Dir.chdir(pwd)
|
1120
1120
|
end
|
1121
1121
|
rescue StandardError => e
|
1122
|
-
log
|
1122
|
+
log&.error e
|
1123
1123
|
ret = on(:error, from, e) if from
|
1124
1124
|
raise if exception && ret != true
|
1125
1125
|
else
|
@@ -439,7 +439,7 @@ module Squared
|
|
439
439
|
end
|
440
440
|
|
441
441
|
def pull(flag = nil, sync: invoked_sync?('pull', flag), remote: nil, opts: [])
|
442
|
-
cmd = git_session 'pull'
|
442
|
+
cmd = git_session 'pull', flag && "--#{flag}"
|
443
443
|
if (val = option('rebase', ignore: false))
|
444
444
|
cmd << case val
|
445
445
|
when '0'
|
@@ -934,7 +934,7 @@ module Squared
|
|
934
934
|
banner &&= cmd.temp { |val| val.start_with?('--work-tree') || val.start_with?('--git-dir') }
|
935
935
|
end
|
936
936
|
cmd = session_done(cmd)
|
937
|
-
log
|
937
|
+
log&.info cmd
|
938
938
|
on :first, from if from
|
939
939
|
banner = if banner
|
940
940
|
format_banner((banner.is_a?(String) ? banner : cmd).gsub(File.join(path, ''), ''), banner: true)
|
@@ -970,7 +970,7 @@ module Squared
|
|
970
970
|
end
|
971
971
|
end
|
972
972
|
rescue StandardError => e
|
973
|
-
log
|
973
|
+
log&.error e
|
974
974
|
ret = on(:error, from, e) if from
|
975
975
|
raise if exception && ret != true
|
976
976
|
|
@@ -989,7 +989,7 @@ module Squared
|
|
989
989
|
next if grep && !line.match?(grep)
|
990
990
|
|
991
991
|
if loglevel
|
992
|
-
log
|
992
|
+
log&.add loglevel, line
|
993
993
|
else
|
994
994
|
sub&.each { |h| line = sub_style(line, **h) }
|
995
995
|
if banner
|
@@ -152,8 +152,8 @@ module Squared
|
|
152
152
|
end
|
153
153
|
end
|
154
154
|
|
155
|
-
def copy(from: 'build', into: 'node_modules', workspace: false,
|
156
|
-
also: nil, create: nil, link: false, force: false, override: false)
|
155
|
+
def copy(from: 'build', into: 'node_modules', workspace: false, scope: nil,
|
156
|
+
also: nil, create: nil, link: false, force: false, override: false, **kwargs)
|
157
157
|
return if @copy == false
|
158
158
|
|
159
159
|
if @copy && !override
|
@@ -163,12 +163,15 @@ module Squared
|
|
163
163
|
into = @copy[:into] if @copy.key?(:into)
|
164
164
|
workspace = @copy[:workspace] if @copy.key?(:workspace)
|
165
165
|
link = @copy[:link] if @copy.key?(:link)
|
166
|
-
force = @copy[:force] if @copy.key?(:
|
166
|
+
force = @copy[:force] if @copy.key?(:force)
|
167
167
|
glob = @copy[:include]
|
168
168
|
exclude = @copy[:exclude]
|
169
169
|
scope = @copy[:scope]
|
170
170
|
also = @copy[:also]
|
171
171
|
create = @copy[:create]
|
172
|
+
else
|
173
|
+
glob = kwargs[:include]
|
174
|
+
exclude = kwargs[:exclude]
|
172
175
|
end
|
173
176
|
items = []
|
174
177
|
items << @workspace.home if build? && path != @workspace.home && @workspace.home?
|
data/squared.gemspec
CHANGED
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.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- An Pham
|
8
8
|
bindir: exe
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-
|
10
|
+
date: 2025-03-06 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: rake
|
@@ -51,6 +51,20 @@ dependencies:
|
|
51
51
|
- - ">="
|
52
52
|
- !ruby/object:Gem::Version
|
53
53
|
version: '0'
|
54
|
+
- !ruby/object:Gem::Dependency
|
55
|
+
name: readline
|
56
|
+
requirement: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '0'
|
61
|
+
type: :runtime
|
62
|
+
prerelease: false
|
63
|
+
version_requirements: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0'
|
54
68
|
description: Rake task generator for managing multi-language workspaces.
|
55
69
|
email:
|
56
70
|
- anpham6@gmail.com
|