squared 0.5.20 → 0.5.22
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 +46 -2
- data/lib/squared/common/format.rb +5 -1
- data/lib/squared/common/prompt.rb +5 -1
- data/lib/squared/version.rb +1 -1
- data/lib/squared/workspace/application.rb +20 -3
- data/lib/squared/workspace/project/base.rb +7 -6
- data/lib/squared/workspace/project/docker.rb +4 -4
- data/lib/squared/workspace/project/git.rb +4 -4
- data/lib/squared/workspace/project/node.rb +15 -7
- data/lib/squared/workspace/project/python.rb +10 -2
- data/lib/squared/workspace/project/ruby.rb +17 -21
- data/lib/squared/workspace/project/support/class.rb +12 -6
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz: '
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '06381e5c59519169c2d591b16869b5d8cf241dbf5b0dc8a84ba697da432e9aa3'
|
|
4
|
+
data.tar.gz: 0f4f6b05caa95e9ac59540505c1eb56825817cd1bff9ff46abe3fd11b1a53918
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e1f1afdae59763ad88da3466a07c8f1acbea78d3738173bc9ba13606b0977a2bddec6b31ce49eb5e2b7ce5b1e952da53573da51ba3e693b2dcefbce3f90f9f46
|
|
7
|
+
data.tar.gz: 8a6eef1e7cd3f666091714cdce7e171efc36d9e662e1f14e77e983bb9d017b6bfef8ae5cf4e34f4c55ea1852ef4e7fc65a7b050f1841ba8633771456e4caba7d
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,45 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.5.22] - 2026-03-11
|
|
4
|
+
|
|
5
|
+
- Project base run command was not covered due to lack of type checking.
|
|
6
|
+
|
|
7
|
+
## [0.4.36] - 2026-03-11
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- Python venv initialization installs setuptools when detected.
|
|
12
|
+
- Node task depend adds prod option flags when NODE_ENV=production.
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
|
|
16
|
+
- Application method with using hide and pass compatibility was implemented.
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
|
|
20
|
+
- Docker task clean does not run in parallel without ENV override.
|
|
21
|
+
- OptionPartition methods with escape parameter were reordered.
|
|
22
|
+
- OptionPartition methods with quote parameter were revised.
|
|
23
|
+
|
|
24
|
+
## [0.5.21] - 2025-12-31
|
|
25
|
+
|
|
26
|
+
### Fixed
|
|
27
|
+
|
|
28
|
+
- See `0.4.35`.
|
|
29
|
+
|
|
30
|
+
## [0.4.35] - 2025-12-31
|
|
31
|
+
|
|
32
|
+
### Changed
|
|
33
|
+
|
|
34
|
+
- Ruby task copy uses GEM_HOME as fallback for autodetect.
|
|
35
|
+
|
|
36
|
+
### Fixed
|
|
37
|
+
|
|
38
|
+
- Git commands [rebase|clone] did not forward sync flag.
|
|
39
|
+
- Pip command install carelessly used an undefined method.
|
|
40
|
+
- Common prompt method readline with multiline did not permit empty lines.
|
|
41
|
+
- Application method with using pass did not ignore exceptions.
|
|
42
|
+
|
|
3
43
|
## [0.5.20] - 2025-12-26
|
|
4
44
|
|
|
5
45
|
### Fixed
|
|
@@ -1305,7 +1345,7 @@
|
|
|
1305
1345
|
- Rake did not set original rakefile when calling itself.
|
|
1306
1346
|
- Extended tasks were not associated to their supporting class method.
|
|
1307
1347
|
|
|
1308
|
-
## [0.1.0] - 2024-12-
|
|
1348
|
+
## [0.1.0] - 2024-12-07
|
|
1309
1349
|
|
|
1310
1350
|
### Added
|
|
1311
1351
|
|
|
@@ -1326,12 +1366,14 @@
|
|
|
1326
1366
|
- Git pull did not display colors for diff bar chart.
|
|
1327
1367
|
- Git commit did not fetch latest refs before submitting.
|
|
1328
1368
|
|
|
1329
|
-
## [0.0.12] - 2024-12-
|
|
1369
|
+
## [0.0.12] - 2024-12-01
|
|
1330
1370
|
|
|
1331
1371
|
### Added
|
|
1332
1372
|
|
|
1333
1373
|
- Changelog was created.
|
|
1334
1374
|
|
|
1375
|
+
[0.5.22]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.22
|
|
1376
|
+
[0.5.21]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.21
|
|
1335
1377
|
[0.5.20]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.20
|
|
1336
1378
|
[0.5.19]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.19
|
|
1337
1379
|
[0.5.18]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.18
|
|
@@ -1353,6 +1395,8 @@
|
|
|
1353
1395
|
[0.5.2]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.2-ruby
|
|
1354
1396
|
[0.5.1]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.1-ruby
|
|
1355
1397
|
[0.5.0]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.0-ruby
|
|
1398
|
+
[0.4.36]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.36
|
|
1399
|
+
[0.4.35]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.35
|
|
1356
1400
|
[0.4.34]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.34
|
|
1357
1401
|
[0.4.33]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.33
|
|
1358
1402
|
[0.4.32]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.32
|
|
@@ -188,7 +188,9 @@ module Squared
|
|
|
188
188
|
end
|
|
189
189
|
if hint.nil? ? args.size > 1 : !hint
|
|
190
190
|
title = log_title(level, color: false)
|
|
191
|
-
|
|
191
|
+
if color
|
|
192
|
+
sub = [{ pat: /\A(#{Regexp.escape(title)})(.*)\z/m, styles: __get__(:theme)[:logger][log_sym(level)] }]
|
|
193
|
+
end
|
|
192
194
|
emphasize(args, title: title + (subject ? " #{subject}" : ''), sub: sub, pipe: -1)
|
|
193
195
|
else
|
|
194
196
|
msg = [log_title(level, color: color)]
|
|
@@ -239,6 +241,8 @@ module Squared
|
|
|
239
241
|
lines = val.to_s.lines(chomp: true)
|
|
240
242
|
lines[0] = "#{val.class}: #{lines.first}" if (err = val.is_a?(::StandardError))
|
|
241
243
|
end
|
|
244
|
+
return if lines.empty?
|
|
245
|
+
|
|
242
246
|
n = cols || max.call(lines)
|
|
243
247
|
if $stdout.tty?
|
|
244
248
|
require 'io/console'
|
|
@@ -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)
|
|
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
|
data/lib/squared/version.rb
CHANGED
|
@@ -178,8 +178,25 @@ module Squared
|
|
|
178
178
|
self
|
|
179
179
|
end
|
|
180
180
|
|
|
181
|
-
def with(*val,
|
|
182
|
-
|
|
181
|
+
def with(*val, hide: nil, group: nil, **kwargs, &blk)
|
|
182
|
+
if hide.nil? && kwargs.key?(:pass)
|
|
183
|
+
pass = kwargs[:pass]
|
|
184
|
+
case pass
|
|
185
|
+
when true, false
|
|
186
|
+
hide = pass
|
|
187
|
+
kwargs.delete(:pass)
|
|
188
|
+
else
|
|
189
|
+
hide, pass = Array(pass).partition { |s| respond_to?(s) || s.to_s.end_with?('?') }
|
|
190
|
+
if pass.empty?
|
|
191
|
+
kwargs.delete(:pass)
|
|
192
|
+
elsif hide.empty?
|
|
193
|
+
hide = nil
|
|
194
|
+
else
|
|
195
|
+
kwargs[:pass] = pass
|
|
196
|
+
end
|
|
197
|
+
end
|
|
198
|
+
end
|
|
199
|
+
return self if hide == true || (hide && Array(hide).any? { |s| respond_to?(s) && __send__(s) rescue nil })
|
|
183
200
|
|
|
184
201
|
@group = nil
|
|
185
202
|
@ref = nil
|
|
@@ -817,7 +834,7 @@ module Squared
|
|
|
817
834
|
' (sync)'
|
|
818
835
|
end}"
|
|
819
836
|
emphasize(grp, title: title, cols: [cols, title.size].max, border: theme[:border],
|
|
820
|
-
sub: [pat: /\A(Step \d+)(.*)\z/, styles: theme[:header]])
|
|
837
|
+
sub: [{ pat: /\A(Step \d+)(.*)\z/, styles: theme[:header] }])
|
|
821
838
|
end
|
|
822
839
|
end
|
|
823
840
|
end
|
|
@@ -499,7 +499,7 @@ module Squared
|
|
|
499
499
|
args[0] = instance_eval(&blk) || f
|
|
500
500
|
return unless args.first
|
|
501
501
|
end
|
|
502
|
-
if args.all?
|
|
502
|
+
if args.all?(Array)
|
|
503
503
|
cmd = []
|
|
504
504
|
var = {}
|
|
505
505
|
args.each do |val|
|
|
@@ -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
|
-
|
|
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
|
|
@@ -1185,6 +1184,8 @@ module Squared
|
|
|
1185
1184
|
else
|
|
1186
1185
|
items = check.call(data[start])
|
|
1187
1186
|
end
|
|
1187
|
+
return done if items.empty?
|
|
1188
|
+
|
|
1188
1189
|
if out
|
|
1189
1190
|
a, b, c, d, e = ARG[:GRAPH]
|
|
1190
1191
|
f = tag.call(target)
|
|
@@ -1951,7 +1952,7 @@ module Squared
|
|
|
1951
1952
|
ret = []
|
|
1952
1953
|
if data[:command]
|
|
1953
1954
|
ret[0] = data[:command]
|
|
1954
|
-
ret[1] = data[:opts] unless
|
|
1955
|
+
ret[1] = data[:opts] unless noopt
|
|
1955
1956
|
ret[3] = data[:args]
|
|
1956
1957
|
elsif data[:script]
|
|
1957
1958
|
ret[1] = data[:script]
|
|
@@ -1960,12 +1961,12 @@ module Squared
|
|
|
1960
1961
|
else
|
|
1961
1962
|
ret[0] = false
|
|
1962
1963
|
end
|
|
1963
|
-
ret[2] = data[:env] unless
|
|
1964
|
+
ret[2] = data[:env] unless noenv
|
|
1964
1965
|
ret
|
|
1965
1966
|
end
|
|
1966
1967
|
case cmd
|
|
1967
1968
|
when Array
|
|
1968
|
-
@output = if cmd.all?
|
|
1969
|
+
@output = if cmd.all?(Hash)
|
|
1969
1970
|
noopt = false
|
|
1970
1971
|
noenv = false
|
|
1971
1972
|
cmd.map { |data| parse.call(data) }
|
|
@@ -254,8 +254,8 @@ module Squared
|
|
|
254
254
|
def clean(*, sync: invoked_sync?('clean'), **)
|
|
255
255
|
if runnable?(@clean)
|
|
256
256
|
super
|
|
257
|
-
|
|
258
|
-
image
|
|
257
|
+
elsif sync || option('y', prefix: 'docker')
|
|
258
|
+
image :rm
|
|
259
259
|
end
|
|
260
260
|
end
|
|
261
261
|
|
|
@@ -693,8 +693,8 @@ module Squared
|
|
|
693
693
|
end
|
|
694
694
|
end
|
|
695
695
|
|
|
696
|
-
def list_image(flag, cmd, hint: nil,
|
|
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))
|
|
@@ -1187,7 +1187,7 @@ module Squared
|
|
|
1187
1187
|
{ pat: /^(## )((?~\.{3}))(\.{3})(.+)$/, styles: [nil, g, nil, r], index: -1 }
|
|
1188
1188
|
]
|
|
1189
1189
|
else
|
|
1190
|
-
[pat: /^(\t+)([a-z]+: +.+)$/, styles: r, index: 2]
|
|
1190
|
+
[{ pat: /^(\t+)([a-z]+: +.+)$/, styles: r, index: 2 }]
|
|
1191
1191
|
end
|
|
1192
1192
|
end
|
|
1193
1193
|
out, banner, from = source(io: true)
|
|
@@ -1910,7 +1910,7 @@ module Squared
|
|
|
1910
1910
|
styles = theme.fetch(:banner, []).reject { |s| s.to_s.end_with?('!') }
|
|
1911
1911
|
styles << :bold if styles.size <= 1
|
|
1912
1912
|
puts print_footer("#{size} #{size == 1 ? type.sub(/(?:(?<!l)e)?s\z/, '') : type}",
|
|
1913
|
-
sub: [pat: /^(\d+)(.+)$/, styles: styles])
|
|
1913
|
+
sub: [{ pat: /^(\d+)(.+)$/, styles: styles }])
|
|
1914
1914
|
end
|
|
1915
1915
|
on :last, from
|
|
1916
1916
|
end
|
|
@@ -5,7 +5,7 @@ module Squared
|
|
|
5
5
|
module Project
|
|
6
6
|
class Node < Git
|
|
7
7
|
OPT_NPM = {
|
|
8
|
-
common: %w[dry-run=!? include-workspace-root=!?
|
|
8
|
+
common: %w[dry-run=!? force=!? loglevel=b include-workspace-root=!? workspaces=!? w|workspace=v].freeze,
|
|
9
9
|
install: %w[package-lock-only=!? prefer-dedupe=!? E|save-exact=!? before=q cpu=b libc=b os=b].freeze,
|
|
10
10
|
install_base: %w[audit=! bin-links=! foreground-scripts=!? fund=! ignore-scripts=!? install-links=!?
|
|
11
11
|
package-lock=! strict-peer-deps=!? include=b install-strategy=b omit=b].freeze,
|
|
@@ -435,13 +435,18 @@ module Squared
|
|
|
435
435
|
|
|
436
436
|
if (yarn = dependtype(:yarn)) > 0
|
|
437
437
|
cmd = session 'yarn'
|
|
438
|
-
if flag
|
|
438
|
+
if !flag && yarn > 1 && prod?
|
|
439
|
+
cmd << 'workspaces focus --all --production'
|
|
440
|
+
elsif flag == :add
|
|
439
441
|
cmd << 'add'
|
|
440
442
|
cmd << "--#{save}" unless save == 'prod'
|
|
441
443
|
cmd << '--exact' if exact
|
|
442
444
|
else
|
|
443
445
|
cmd << 'install'
|
|
444
|
-
|
|
446
|
+
if yarn == 1
|
|
447
|
+
cmd << '--production' if prod?
|
|
448
|
+
cmd << '--ignore-engines' unless option('ignore-engines', equals: '0')
|
|
449
|
+
end
|
|
445
450
|
end
|
|
446
451
|
elsif pnpm?
|
|
447
452
|
cmd = session 'pnpm'
|
|
@@ -451,6 +456,7 @@ module Squared
|
|
|
451
456
|
option('allow-build') { |val| cmd << quote_option('allow-build', val) }
|
|
452
457
|
else
|
|
453
458
|
cmd << 'install'
|
|
459
|
+
cmd << '--prod' if prod?
|
|
454
460
|
append_platform
|
|
455
461
|
end
|
|
456
462
|
option('public-hoist-pattern') do |val|
|
|
@@ -465,6 +471,7 @@ module Squared
|
|
|
465
471
|
cmd << "--save-#{save}"
|
|
466
472
|
cmd << '--save-exact' if exact
|
|
467
473
|
else
|
|
474
|
+
cmd << '--include=prod' if prod?
|
|
468
475
|
append_platform
|
|
469
476
|
end
|
|
470
477
|
cmd << '--workspaces=false' if env('NODE_WORKSPACES', equals: '0')
|
|
@@ -686,15 +693,16 @@ module Squared
|
|
|
686
693
|
log.info cmd.to_s
|
|
687
694
|
end
|
|
688
695
|
if sync
|
|
689
|
-
run(
|
|
696
|
+
run(sync: sync, from: from, interactive: !dryrun && "Publish #{sub_style(npmname, styles: theme[:active])}")
|
|
690
697
|
else
|
|
691
698
|
require 'open3'
|
|
692
699
|
on :first, from
|
|
693
700
|
pwd_set(from: from, dryrun: dryrun) do
|
|
694
701
|
cmd = session_done cmd
|
|
695
702
|
Open3.popen2e(cmd) do |_, out|
|
|
696
|
-
write_lines(out,
|
|
697
|
-
|
|
703
|
+
write_lines(out,
|
|
704
|
+
banner: format_banner(cmd),
|
|
705
|
+
sub: npmnotice + [{ pat: /^(.+)(Tarball .+)$/, styles: color(:bright_blue), index: 2 }])
|
|
698
706
|
end
|
|
699
707
|
end
|
|
700
708
|
on :last, from
|
|
@@ -808,7 +816,7 @@ module Squared
|
|
|
808
816
|
raise_error('version not found', hint: dependfile)
|
|
809
817
|
end
|
|
810
818
|
rescue StandardError => e
|
|
811
|
-
on_error
|
|
819
|
+
on_error(e, :bump, dryrun: dryrun?)
|
|
812
820
|
end
|
|
813
821
|
end
|
|
814
822
|
|
|
@@ -228,7 +228,7 @@ module Squared
|
|
|
228
228
|
if args.empty?
|
|
229
229
|
args = readline('Enter command', force: true).split(' ', 2)
|
|
230
230
|
elsif args.size == 1 && !option('interactive', prefix: 'venv', equals: '0')
|
|
231
|
-
args << readline('Enter arguments', force: false)
|
|
231
|
+
args << readline('Enter arguments', force: false) unless args.first.include?(' ')
|
|
232
232
|
end
|
|
233
233
|
venv_init
|
|
234
234
|
run args.join(' ')
|
|
@@ -896,10 +896,18 @@ module Squared
|
|
|
896
896
|
.clear(pass: false)
|
|
897
897
|
.arg?(/\A-v+\z/)
|
|
898
898
|
run(op, env, exception: true, banner: banner)
|
|
899
|
-
|
|
899
|
+
if poetry?
|
|
900
|
+
install(:upgrade, ['poetry'])
|
|
901
|
+
elsif setuptools?
|
|
902
|
+
install(:upgrade, ['setuptools', 'wheel'])
|
|
903
|
+
end
|
|
900
904
|
puts(dir.directory? ? "Success: #{dir}" : 'Failed') if banner && !status
|
|
901
905
|
end
|
|
902
906
|
|
|
907
|
+
def installable?
|
|
908
|
+
setuptools? || !!pyprojectfile
|
|
909
|
+
end
|
|
910
|
+
|
|
903
911
|
def setuptools?
|
|
904
912
|
dependtype == 2 || dependtype == 4
|
|
905
913
|
end
|
|
@@ -537,7 +537,7 @@ module Squared
|
|
|
537
537
|
`rvm current`[/^\S+/, 0]
|
|
538
538
|
when 'rbenv'
|
|
539
539
|
`rbenv version-name`.yield_self do |name|
|
|
540
|
-
name
|
|
540
|
+
(name =~ SEM_VER) == 0 ? "ruby #{name}" : name
|
|
541
541
|
end
|
|
542
542
|
when 'chruby.sh'
|
|
543
543
|
chruby = session_output 'source', val
|
|
@@ -806,7 +806,7 @@ module Squared
|
|
|
806
806
|
else
|
|
807
807
|
op.clear
|
|
808
808
|
end
|
|
809
|
-
elsif (n = op.index { |val| val.match?(/(\A|[
|
|
809
|
+
elsif (n = op.index { |val| val.match?(/(\A|[\w.-])@\d/) })
|
|
810
810
|
name = op.delete_at(n)
|
|
811
811
|
pre, ver = if (n = name.index('@')) == 0
|
|
812
812
|
[gemname, name[1..-1]]
|
|
@@ -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
|
-
|
|
919
|
-
|
|
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)
|
|
@@ -32,10 +32,10 @@ module Squared
|
|
|
32
32
|
ret.map! do |val|
|
|
33
33
|
next val if opt?(val)
|
|
34
34
|
|
|
35
|
-
if
|
|
36
|
-
shell_quote(val, force: force, double: double)
|
|
37
|
-
elsif escape
|
|
35
|
+
if !(pa = val.is_a?(Pathname)) && escape
|
|
38
36
|
shell_escape(val, quote: quote, double: double)
|
|
37
|
+
elsif quote || pa
|
|
38
|
+
shell_quote(val, force: force, double: double)
|
|
39
39
|
else
|
|
40
40
|
val
|
|
41
41
|
end
|
|
@@ -300,10 +300,13 @@ module Squared
|
|
|
300
300
|
self
|
|
301
301
|
end
|
|
302
302
|
|
|
303
|
-
def append_any(*args,
|
|
303
|
+
def append_any(*args, escape: false, **kwargs)
|
|
304
|
+
quote = kwargs.fetch(:quote, true)
|
|
304
305
|
(args.empty? ? extras : args.flatten).each do |val|
|
|
305
306
|
if exist?(val)
|
|
306
307
|
add_path(val, **kwargs)
|
|
308
|
+
elsif escape
|
|
309
|
+
add shell_escape(val, **kwargs)
|
|
307
310
|
elsif quote
|
|
308
311
|
add_quote(val, **kwargs)
|
|
309
312
|
else
|
|
@@ -427,6 +430,7 @@ module Squared
|
|
|
427
430
|
end
|
|
428
431
|
|
|
429
432
|
def add_quote(*args, **kwargs)
|
|
433
|
+
kwargs.delete(:quote)
|
|
430
434
|
args.compact!
|
|
431
435
|
merge(args.map! { |val| val == '--' || OptionPartition.opt?(val) ? val : shell_quote(val, **kwargs) })
|
|
432
436
|
self
|
|
@@ -443,10 +447,12 @@ module Squared
|
|
|
443
447
|
elsif exclude.first.is_a?(Symbol)
|
|
444
448
|
partition(&exclude.first)
|
|
445
449
|
else
|
|
450
|
+
exclude.map! { |pat| Regexp.new(pat) }
|
|
446
451
|
partition do |val|
|
|
447
|
-
|
|
452
|
+
val = val.to_s
|
|
453
|
+
next if pattern && OptionPartition.pattern?(val)
|
|
448
454
|
|
|
449
|
-
exclude.none? { |pat| val.match?(
|
|
455
|
+
exclude.none? { |pat| val.match?(pat) }
|
|
450
456
|
end
|
|
451
457
|
end
|
|
452
458
|
unless temp.empty?
|
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.
|
|
4
|
+
version: 0.5.22
|
|
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:
|
|
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: []
|