squared 0.4.30 → 0.4.32
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 +28 -0
- data/README.md +35 -26
- data/lib/squared/common/class.rb +17 -6
- data/lib/squared/common/format.rb +8 -6
- data/lib/squared/common/shell.rb +7 -2
- data/lib/squared/config.rb +9 -5
- data/lib/squared/version.rb +1 -1
- data/lib/squared/workspace/application.rb +6 -4
- data/lib/squared/workspace/project/base.rb +30 -33
- data/lib/squared/workspace/project/git.rb +16 -16
- data/lib/squared/workspace/project/node.rb +6 -4
- data/lib/squared/workspace/project/python.rb +5 -5
- data/lib/squared/workspace/project/ruby.rb +24 -25
- data/lib/squared/workspace/project/support/class.rb +20 -13
- data/lib/squared/workspace/repo.rb +2 -2
- data/lib/squared/workspace.rb +5 -3
- 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: 913d20d3c4a6de7260752fb6603305cee9af765f2885ae74a57d145abe0c2e4e
|
|
4
|
+
data.tar.gz: 4c07a15fb013d871a8ebf0f93343146b4366a127ca1f1c18467648d9f7c4ca44
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 13a87e14e520b801a71e00c5012eb06e8a557b1f6c7d14cf30702e0a4b2ed0d87bb5535d8ffc970275da0f7a65958562e4ca586cebca847c886a80a6df438d5b
|
|
7
|
+
data.tar.gz: 48626887ad8b660747dc389e321c2b179b9855cba8ddc9c98d3e48416b87d3ab5899de9f416db068ce47e983f56ce27174057ebed38b148b5331cc4088e12e9c
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.4.32] - 2025-11-25
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- Git method commit did not include --dry-run with add command.
|
|
8
|
+
- JoinSet method include? did not always search to start of delimiter.
|
|
9
|
+
- Config viewer did not check for a readable package registry document.
|
|
10
|
+
- Powershell executable did not check for alternate path location.
|
|
11
|
+
|
|
12
|
+
## [0.4.31] - 2025-11-22
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
|
|
16
|
+
- Project base attribute project was converted into an accessor.
|
|
17
|
+
- Ruby command flag is given precedence to a program file.
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
|
|
21
|
+
- Repo application tasks are not created on Windows.
|
|
22
|
+
- Repo module used conflicting REPO_URL with Repo application.
|
|
23
|
+
- Project task outdated did not check pass and only exclusions.
|
|
24
|
+
- Workspace static method resolve did nothing when given a String.
|
|
25
|
+
- Project base run command types did not include Struct.
|
|
26
|
+
- Project change directory context did not always restore when raised.
|
|
27
|
+
- Ruby file method attributes did not always return nil.
|
|
28
|
+
- JoinSet with a delimiter did not report correct size.
|
|
29
|
+
|
|
3
30
|
## [0.4.30] - 2025-11-14
|
|
4
31
|
|
|
5
32
|
### Added
|
|
@@ -1103,6 +1130,7 @@
|
|
|
1103
1130
|
|
|
1104
1131
|
- Changelog was created.
|
|
1105
1132
|
|
|
1133
|
+
[0.4.31]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.31
|
|
1106
1134
|
[0.4.30]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.30
|
|
1107
1135
|
[0.4.29]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.29
|
|
1108
1136
|
[0.4.28]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.28
|
data/README.md
CHANGED
|
@@ -20,23 +20,9 @@ The range chart indicates the latest Ruby tested against at the time of release.
|
|
|
20
20
|
gem install squared
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
### Optional
|
|
24
|
-
|
|
25
|
-
* [Repo](https://source.android.com/docs/setup/reference/repo)
|
|
26
|
-
* https://github.com/anpham6/squared-repo
|
|
27
|
-
* Python 3.6
|
|
28
|
-
* Not compatible with Windows
|
|
29
|
-
|
|
30
|
-
```sh
|
|
31
|
-
mkdir -p ~/.bin
|
|
32
|
-
PATH="${HOME}/.bin:${PATH}"
|
|
33
|
-
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/.bin/repo
|
|
34
|
-
chmod a+rx ~/.bin/repo
|
|
35
|
-
```
|
|
36
|
-
|
|
37
23
|
## Example - Rakefile
|
|
38
24
|
|
|
39
|
-
Projects from any accessible folder can be added relative to the parent directory
|
|
25
|
+
Projects from any accessible folder can be added relative to the parent directory or absolutely. Missing projects will simply be excluded from the task runner.
|
|
40
26
|
|
|
41
27
|
```ruby
|
|
42
28
|
require "squared"
|
|
@@ -52,14 +38,6 @@ require "squared/app" # All workspace related mod
|
|
|
52
38
|
|
|
53
39
|
# NODE_ENV = production
|
|
54
40
|
|
|
55
|
-
# REPO_ROOT = /workspaces |
|
|
56
|
-
# REPO_HOME = /workspaces/squared | Dir.pwd
|
|
57
|
-
# rake = /workspaces/squared/Rakefile | main?
|
|
58
|
-
# OR
|
|
59
|
-
# REPO_ROOT = /workspaces | Dir.pwd
|
|
60
|
-
# rake = /workspaces/Rakefile |
|
|
61
|
-
# REPO_HOME = /workspaces/squared | main: "squared"
|
|
62
|
-
|
|
63
41
|
# pathname = /workspaces/pathname
|
|
64
42
|
# optparse = /workspaces/optparse
|
|
65
43
|
# log = /workspaces/logger
|
|
@@ -74,7 +52,6 @@ require "squared/app" # All workspace related mod
|
|
|
74
52
|
Workspace::Application
|
|
75
53
|
.new(Dir.pwd, main: "squared") # Dir.pwd? (main? is implicitly basename)
|
|
76
54
|
.banner("group", "project", styles: ["yellow", "black"], border: "bold") # name | project | path | ref | group? | parent? | version?
|
|
77
|
-
.repo("https://github.com/anpham6/squared-repo", "nightly", script: ["build:dev", "build:prod"], ref: :node) # Repo (optional)
|
|
78
55
|
.run("rake install", ref: :ruby)
|
|
79
56
|
.depend(false, group: "default")
|
|
80
57
|
.clean("rake clean", group: "default")
|
|
@@ -708,7 +685,37 @@ DOCKER_Y=1 # confirm all
|
|
|
708
685
|
|
|
709
686
|
### Repo
|
|
710
687
|
|
|
711
|
-
|
|
688
|
+
* [Repo](https://source.android.com/docs/setup/reference/repo)
|
|
689
|
+
* https://github.com/anpham6/squared-repo
|
|
690
|
+
* Python 3.6
|
|
691
|
+
* Not compatible with Windows
|
|
692
|
+
|
|
693
|
+
```sh
|
|
694
|
+
mkdir -p ~/.bin
|
|
695
|
+
PATH="${HOME}/.bin:${PATH}"
|
|
696
|
+
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/.bin/repo
|
|
697
|
+
chmod a+rx ~/.bin/repo
|
|
698
|
+
```
|
|
699
|
+
|
|
700
|
+
```ruby
|
|
701
|
+
# REPO_ROOT = /workspaces |
|
|
702
|
+
# REPO_HOME = /workspaces/squared | Dir.pwd
|
|
703
|
+
# rake = /workspaces/squared/Rakefile | main?
|
|
704
|
+
#
|
|
705
|
+
# OR
|
|
706
|
+
#
|
|
707
|
+
# REPO_ROOT = /workspaces | Dir.pwd
|
|
708
|
+
# rake = /workspaces/Rakefile |
|
|
709
|
+
# REPO_HOME = /workspaces/squared | main: "squared"
|
|
710
|
+
|
|
711
|
+
Workspace::Application
|
|
712
|
+
.new(main: "squared")
|
|
713
|
+
.repo("https://github.com/anpham6/squared-repo", "nightly", script: ["build:dev", "prod"], ref: :node)
|
|
714
|
+
.add("squared", script: ["build:stage1", "build:stage2"])
|
|
715
|
+
.build
|
|
716
|
+
```
|
|
717
|
+
|
|
718
|
+
These global options also can target the application main suffix `${NAME}`. (e.g. *REPO_ROOT_SQUARED*)
|
|
712
719
|
|
|
713
720
|
```sh
|
|
714
721
|
REPO_ROOT # parent dir
|
|
@@ -720,7 +727,7 @@ REPO_DEV # pattern,0,1
|
|
|
720
727
|
REPO_PROD # pattern,0,1
|
|
721
728
|
REPO_WARN # 0,1
|
|
722
729
|
REPO_SYNC # 0,1
|
|
723
|
-
|
|
730
|
+
REPO_GIT # manifest repository
|
|
724
731
|
REPO_MANIFEST # e.g. latest,nightly,prod
|
|
725
732
|
REPO_GROUPS # e.g. base,prod,docs
|
|
726
733
|
REPO_STAGE # 0,1,2,3,4
|
|
@@ -728,6 +735,8 @@ REPO_SUBMODULLES # 0,1
|
|
|
728
735
|
REPO_TIMEOUT # confirm dialog (seconds)
|
|
729
736
|
```
|
|
730
737
|
|
|
738
|
+
Other similarly cloned `Repo` repositories can be managed remotely by setting the `REPO_ROOT` environment variable to the location.
|
|
739
|
+
|
|
731
740
|
## LICENSE
|
|
732
741
|
|
|
733
742
|
BSD 3-Clause
|
data/lib/squared/common/class.rb
CHANGED
|
@@ -134,8 +134,15 @@ module Squared
|
|
|
134
134
|
extras!(obj) || super
|
|
135
135
|
end
|
|
136
136
|
|
|
137
|
-
def
|
|
138
|
-
|
|
137
|
+
def size
|
|
138
|
+
super + extras.size
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
def include?(obj)
|
|
142
|
+
return true if super
|
|
143
|
+
return extras.include?(obj) unless (n = extras.index(@partition))
|
|
144
|
+
|
|
145
|
+
extras[0..n].include?(obj)
|
|
139
146
|
end
|
|
140
147
|
|
|
141
148
|
def to_a
|
|
@@ -143,21 +150,25 @@ module Squared
|
|
|
143
150
|
end
|
|
144
151
|
|
|
145
152
|
def to_s
|
|
146
|
-
|
|
153
|
+
to_a.join(@delim)
|
|
147
154
|
end
|
|
148
155
|
|
|
149
156
|
def to_enum(*args)
|
|
150
|
-
|
|
157
|
+
to_a.to_enum(*args)
|
|
151
158
|
end
|
|
152
159
|
|
|
153
160
|
def to_json(*args)
|
|
154
|
-
|
|
161
|
+
to_a.to_json(*args)
|
|
155
162
|
end
|
|
156
163
|
|
|
157
164
|
def to_yaml(*args)
|
|
158
|
-
|
|
165
|
+
to_a.to_yaml(*args)
|
|
159
166
|
end
|
|
160
167
|
|
|
168
|
+
alias add :<<
|
|
169
|
+
alias add? :<<
|
|
170
|
+
alias member? include?
|
|
171
|
+
|
|
161
172
|
private
|
|
162
173
|
|
|
163
174
|
def extras!(obj)
|
|
@@ -67,6 +67,7 @@ module Squared
|
|
|
67
67
|
end
|
|
68
68
|
wrap = ->(s, n) { "\x1B[#{n.join(';')}m#{s}\x1B[0m" }
|
|
69
69
|
code = []
|
|
70
|
+
args.clear if args.size == 1 && args.first.nil?
|
|
70
71
|
args.concat(Array(styles)).flatten.each_with_index do |type, i|
|
|
71
72
|
next unless type
|
|
72
73
|
|
|
@@ -178,19 +179,20 @@ module Squared
|
|
|
178
179
|
args = args.map(&:to_s)
|
|
179
180
|
if level.is_a?(::Numeric)
|
|
180
181
|
if append && respond_to?(:log)
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
end
|
|
182
|
+
ref = log rescue nil
|
|
183
|
+
ref.add(level, message(subject, *args, hint: hint, space: ', ')) if ref.is_a?(::Logger)
|
|
184
184
|
end
|
|
185
|
-
return false
|
|
185
|
+
return false unless pass || level >= ARG[:LEVEL]
|
|
186
186
|
end
|
|
187
|
-
if
|
|
187
|
+
if hint.nil? ? args.size > 1 : !hint
|
|
188
188
|
title = log_title(level, color: false)
|
|
189
189
|
sub = [pat: /\A(#{Regexp.escape(title)})(.*)\z/m, styles: __get__(:theme)[:logger][log_sym(level)]] if color
|
|
190
190
|
emphasize(args, title: title + (subject ? " #{subject}" : ''), sub: sub, pipe: -1)
|
|
191
191
|
else
|
|
192
192
|
msg = [log_title(level, color: color)]
|
|
193
|
-
|
|
193
|
+
if subject
|
|
194
|
+
msg << (color ? sub_style(subject.to_s, (@theme.is_a?(::Hash) && @theme[:subject]) || :bold) : subject)
|
|
195
|
+
end
|
|
194
196
|
msg << args.shift if msg.size == 1
|
|
195
197
|
message(msg.join(' '), *args, hint: hint)
|
|
196
198
|
end
|
data/lib/squared/common/shell.rb
CHANGED
|
@@ -78,7 +78,11 @@ module Squared
|
|
|
78
78
|
end
|
|
79
79
|
sep = unless flag.empty?
|
|
80
80
|
if flag[0] == '-'
|
|
81
|
-
flag[1] == '-'
|
|
81
|
+
if flag[1] == '-'
|
|
82
|
+
'='
|
|
83
|
+
else
|
|
84
|
+
merge ? '' : ' '
|
|
85
|
+
end
|
|
82
86
|
elsif flag.size == 1
|
|
83
87
|
pre = '-'
|
|
84
88
|
merge ? '' : ' '
|
|
@@ -106,7 +110,8 @@ module Squared
|
|
|
106
110
|
end
|
|
107
111
|
|
|
108
112
|
def shell_bin(name, env: true)
|
|
109
|
-
key = name.upcase
|
|
113
|
+
key = name.to_s.upcase
|
|
114
|
+
key = File.basename(key, '.*') if Rake::Win32.windows?
|
|
110
115
|
shell_quote((env && ENV["PATH_#{key}"]) || PATH[key] || PATH[key.to_sym] || name,
|
|
111
116
|
option: false, force: false, double: true)
|
|
112
117
|
end
|
data/lib/squared/config.rb
CHANGED
|
@@ -22,8 +22,8 @@ module Squared
|
|
|
22
22
|
nil
|
|
23
23
|
end
|
|
24
24
|
|
|
25
|
-
def link(project, main = project.dependfile
|
|
26
|
-
return unless project.enabled?
|
|
25
|
+
def link(project, main = project.dependfile&.basename, name = nil, **kwargs, &blk)
|
|
26
|
+
return unless project.enabled? && main
|
|
27
27
|
|
|
28
28
|
ret = Viewer.new(main, name, project: project, **kwargs)
|
|
29
29
|
ret.instance_eval(&blk) if block_given?
|
|
@@ -159,7 +159,7 @@ module Squared
|
|
|
159
159
|
end
|
|
160
160
|
|
|
161
161
|
def also(path, type = nil, name: nil, **kwargs)
|
|
162
|
-
return self
|
|
162
|
+
return self unless (file = basepath(path)).exist? && !@mime.frozen?
|
|
163
163
|
|
|
164
164
|
ext = mimetype file
|
|
165
165
|
type ||= ext
|
|
@@ -321,7 +321,9 @@ module Squared
|
|
|
321
321
|
end
|
|
322
322
|
|
|
323
323
|
def warning?
|
|
324
|
-
|
|
324
|
+
return true unless project
|
|
325
|
+
|
|
326
|
+
project.workspace.warning
|
|
325
327
|
end
|
|
326
328
|
|
|
327
329
|
def stdin?
|
|
@@ -346,7 +348,9 @@ module Squared
|
|
|
346
348
|
end
|
|
347
349
|
|
|
348
350
|
def basepath(*args)
|
|
349
|
-
|
|
351
|
+
return Pathname.pwd.join(*args) unless project
|
|
352
|
+
|
|
353
|
+
project.basepath(*args)
|
|
350
354
|
end
|
|
351
355
|
end
|
|
352
356
|
end
|
data/lib/squared/version.rb
CHANGED
|
@@ -83,7 +83,7 @@ module Squared
|
|
|
83
83
|
basename = @home.basename.to_s
|
|
84
84
|
if main
|
|
85
85
|
@main = main.to_s.freeze
|
|
86
|
-
@home += @main unless @main == basename || (windows? && @main.
|
|
86
|
+
@home += @main unless @main == basename || (windows? && @main.casecmp?(basename))
|
|
87
87
|
else
|
|
88
88
|
@main = basename.freeze
|
|
89
89
|
end
|
|
@@ -178,7 +178,9 @@ module Squared
|
|
|
178
178
|
self
|
|
179
179
|
end
|
|
180
180
|
|
|
181
|
-
def with(*val, group: nil, **kwargs, &blk)
|
|
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) })
|
|
183
|
+
|
|
182
184
|
@group = nil
|
|
183
185
|
@ref = nil
|
|
184
186
|
@withargs = kwargs.empty? ? nil : kwargs
|
|
@@ -488,7 +490,7 @@ module Squared
|
|
|
488
490
|
if (base = task_base?(key))
|
|
489
491
|
tasks << key if obj.has?(key, baseref)
|
|
490
492
|
elsif (batch = series.batch_get(key))
|
|
491
|
-
obj.allref
|
|
493
|
+
obj.allref do |ref|
|
|
492
494
|
next unless obj.has?(key, ref) && (data = batch[ref])
|
|
493
495
|
|
|
494
496
|
data.each do |val|
|
|
@@ -507,7 +509,7 @@ module Squared
|
|
|
507
509
|
if tasks.empty?
|
|
508
510
|
return [] if (base && !obj.ref?(baseref)) || !(data = series.alias_get(key))
|
|
509
511
|
|
|
510
|
-
obj.allref
|
|
512
|
+
obj.allref do |ref|
|
|
511
513
|
next unless obj.has?(key, ref) && (alt = data[ref])
|
|
512
514
|
|
|
513
515
|
ret = task_resolve(obj, alt)
|
|
@@ -72,9 +72,9 @@ module Squared
|
|
|
72
72
|
'unpack' => %i[zip tar gem ext].freeze
|
|
73
73
|
})
|
|
74
74
|
|
|
75
|
-
attr_reader :name, :
|
|
75
|
+
attr_reader :name, :workspace, :path, :theme, :group, :parent, :dependfile,
|
|
76
76
|
:exception, :pipe, :verbose
|
|
77
|
-
attr_accessor :global
|
|
77
|
+
attr_accessor :global, :project
|
|
78
78
|
|
|
79
79
|
def initialize(workspace, path, name, *, group: nil, first: {}, last: {}, error: {}, common: ARG[:COMMON],
|
|
80
80
|
**kwargs)
|
|
@@ -332,7 +332,7 @@ module Squared
|
|
|
332
332
|
|
|
333
333
|
format_desc action, flag, '(-)project*'
|
|
334
334
|
task flag do |_, args|
|
|
335
|
-
args = args.to_a.reject { |val| name == val
|
|
335
|
+
args = args.to_a.reject { |val| name == val }
|
|
336
336
|
if flag == :run
|
|
337
337
|
graph args
|
|
338
338
|
else
|
|
@@ -447,9 +447,9 @@ module Squared
|
|
|
447
447
|
if args.empty?
|
|
448
448
|
return unless from == :run
|
|
449
449
|
|
|
450
|
-
run_b(@run, sync: sync, from: from) if series?(@run)
|
|
451
|
-
args = @output
|
|
452
450
|
banner = verbosetype > 1 if from_base?('build')
|
|
451
|
+
run_b(@run, sync: sync, from: from, banner: banner) if series?(@run)
|
|
452
|
+
args = @output
|
|
453
453
|
end
|
|
454
454
|
if args.first.is_a?(Struct)
|
|
455
455
|
f, blk = args.first.to_a
|
|
@@ -812,7 +812,7 @@ module Squared
|
|
|
812
812
|
def run(cmd = @session, var = nil, exception: self.exception, sync: true, from: nil, banner: true, chdir: path,
|
|
813
813
|
interactive: nil, hint: nil, **)
|
|
814
814
|
unless cmd
|
|
815
|
-
print_error('no command
|
|
815
|
+
print_error('no command session started', subject: project, hint: from || 'unknown', pass: true)
|
|
816
816
|
return
|
|
817
817
|
end
|
|
818
818
|
cmd = cmd.target if cmd.is_a?(OptionPartition)
|
|
@@ -1005,8 +1005,8 @@ module Squared
|
|
|
1005
1005
|
@log = Logger.new(enabled? ? @log.first : nil, **@log.last)
|
|
1006
1006
|
end
|
|
1007
1007
|
|
|
1008
|
-
def allref
|
|
1009
|
-
@ref.reverse_each
|
|
1008
|
+
def allref(&blk)
|
|
1009
|
+
@ref.reverse_each(&blk)
|
|
1010
1010
|
end
|
|
1011
1011
|
|
|
1012
1012
|
def basepath(*args)
|
|
@@ -1020,7 +1020,7 @@ module Squared
|
|
|
1020
1020
|
path.parent.ascend.each do |dir|
|
|
1021
1021
|
target = dir.join(*args)
|
|
1022
1022
|
return target if target.exist?
|
|
1023
|
-
break if (ascend && dir.join(ascend).exist?) || workspace.root == dir || parent&.path == dir
|
|
1023
|
+
break if (ascend.is_a?(String) && dir.join(ascend).exist?) || workspace.root == dir || parent&.path == dir
|
|
1024
1024
|
end
|
|
1025
1025
|
ret
|
|
1026
1026
|
end
|
|
@@ -1061,8 +1061,8 @@ module Squared
|
|
|
1061
1061
|
def run_b(obj, **kwargs)
|
|
1062
1062
|
case obj
|
|
1063
1063
|
when Struct
|
|
1064
|
-
if (
|
|
1065
|
-
run_b(
|
|
1064
|
+
if (val = instance_eval(&obj.block) || obj.run)
|
|
1065
|
+
run_b(val, **kwargs)
|
|
1066
1066
|
end
|
|
1067
1067
|
when Proc
|
|
1068
1068
|
instance_eval(&obj)
|
|
@@ -1290,7 +1290,9 @@ module Squared
|
|
|
1290
1290
|
end
|
|
1291
1291
|
|
|
1292
1292
|
def print_error(*args, loglevel: Logger::WARN, **kwargs)
|
|
1293
|
-
|
|
1293
|
+
return unless warning?
|
|
1294
|
+
|
|
1295
|
+
warn log_message(loglevel, *args, **kwargs)
|
|
1294
1296
|
end
|
|
1295
1297
|
|
|
1296
1298
|
def print_item(*val)
|
|
@@ -1444,8 +1446,8 @@ module Squared
|
|
|
1444
1446
|
"#{msg}#{!always && (!obj || obj == 0 || obj.to_s.empty?) ? '' : message(hint: message(title, obj.to_s))}"
|
|
1445
1447
|
end
|
|
1446
1448
|
|
|
1447
|
-
def append_repeat(flag, opts, target: @session)
|
|
1448
|
-
opts.each { |val| target << shell_option(flag, val) }
|
|
1449
|
+
def append_repeat(flag, opts, target: @session, **kwargs)
|
|
1450
|
+
opts.each { |val| target << shell_option(flag, val, **kwargs) }
|
|
1449
1451
|
end
|
|
1450
1452
|
|
|
1451
1453
|
def append_hash(data, target: @session || [], build: false)
|
|
@@ -1471,6 +1473,8 @@ module Squared
|
|
|
1471
1473
|
target << basic_option(key, val)
|
|
1472
1474
|
when FalseClass
|
|
1473
1475
|
target << shell_option(key).sub(/^--(?!no-)/, '--no-')
|
|
1476
|
+
when Pathname
|
|
1477
|
+
target << shell_option(key, val, escape: false)
|
|
1474
1478
|
else
|
|
1475
1479
|
target << shell_option(key, val.is_a?(String) ? val : nil)
|
|
1476
1480
|
end
|
|
@@ -1674,7 +1678,7 @@ module Squared
|
|
|
1674
1678
|
end
|
|
1675
1679
|
if values
|
|
1676
1680
|
ret = Array(ret)
|
|
1677
|
-
values.each do |val|
|
|
1681
|
+
Array(values).each do |val|
|
|
1678
1682
|
if val.is_a?(Array)
|
|
1679
1683
|
val, force = val
|
|
1680
1684
|
else
|
|
@@ -1709,7 +1713,7 @@ module Squared
|
|
|
1709
1713
|
def command(*args)
|
|
1710
1714
|
return args.join(' && ') unless workspace.powershell?
|
|
1711
1715
|
|
|
1712
|
-
"powershell.exe -Command
|
|
1716
|
+
"#{shell_bin('powershell.exe')} -Command \"& {#{args.join(' ; ')}}\""
|
|
1713
1717
|
end
|
|
1714
1718
|
|
|
1715
1719
|
def relativepath(*list, all: false)
|
|
@@ -1855,17 +1859,15 @@ module Squared
|
|
|
1855
1859
|
pwd = Pathname.pwd
|
|
1856
1860
|
if block_given?
|
|
1857
1861
|
begin
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
Dir.chdir path
|
|
1862
|
-
ret = yield
|
|
1863
|
-
Dir.chdir pwd
|
|
1862
|
+
unless (path == pwd || pass == true) && (workspace.mri? || !workspace.windows?)
|
|
1863
|
+
restore = true
|
|
1864
|
+
Dir.chdir(path)
|
|
1864
1865
|
end
|
|
1866
|
+
yield
|
|
1865
1867
|
rescue StandardError => e
|
|
1866
1868
|
on_error(e, from, dryrun: dryrun)
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
+
ensure
|
|
1870
|
+
Dir.chdir(pwd) if restore
|
|
1869
1871
|
end
|
|
1870
1872
|
elsif @pwd == pwd
|
|
1871
1873
|
@pwd = nil
|
|
@@ -2052,7 +2054,7 @@ module Squared
|
|
|
2052
2054
|
|
|
2053
2055
|
def runnable?(val)
|
|
2054
2056
|
case val
|
|
2055
|
-
when String, Enumerable, Proc, Method
|
|
2057
|
+
when String, Enumerable, Proc, Method, Struct
|
|
2056
2058
|
true
|
|
2057
2059
|
else
|
|
2058
2060
|
false
|
|
@@ -2111,14 +2113,9 @@ module Squared
|
|
|
2111
2113
|
end
|
|
2112
2114
|
|
|
2113
2115
|
def has_value?(data, other)
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
when Enumerable
|
|
2118
|
-
other.is_a?(Enumerable) ? other.any? { |obj| data.include?(obj) } : data.include?(other)
|
|
2119
|
-
else
|
|
2120
|
-
false
|
|
2121
|
-
end
|
|
2116
|
+
return false unless data.is_a?(Enumerable)
|
|
2117
|
+
|
|
2118
|
+
other.is_a?(Enumerable) ? other.any? { |obj,| data.include?(obj) } : data.include?(other)
|
|
2122
2119
|
end
|
|
2123
2120
|
|
|
2124
2121
|
def variables
|
|
@@ -134,7 +134,7 @@ module Squared
|
|
|
134
134
|
File.write(@revfile, JSON.pretty_generate(@revdoc))
|
|
135
135
|
rescue StandardError => e
|
|
136
136
|
log&.debug e
|
|
137
|
-
warn log_message(Logger::WARN, e, pass: true) if warning
|
|
137
|
+
warn log_message(Logger::WARN, e, pass: true) if warning
|
|
138
138
|
ensure
|
|
139
139
|
@revlock = false
|
|
140
140
|
end
|
|
@@ -1460,7 +1460,7 @@ module Squared
|
|
|
1460
1460
|
co = git_session('commit', options: false)
|
|
1461
1461
|
pu = git_output 'push', upstream && '--set-upstream'
|
|
1462
1462
|
if dryrun
|
|
1463
|
-
op.
|
|
1463
|
+
op.adjoin('--dry-run')
|
|
1464
1464
|
co << '--dry-run'
|
|
1465
1465
|
pu << '--dry-run'
|
|
1466
1466
|
end
|
|
@@ -1472,7 +1472,6 @@ module Squared
|
|
|
1472
1472
|
end
|
|
1473
1473
|
pu << '--force-with-lease' if amend
|
|
1474
1474
|
pu.merge(repotrack(origin, branch))
|
|
1475
|
-
puts if pass
|
|
1476
1475
|
source op
|
|
1477
1476
|
source co
|
|
1478
1477
|
source pu
|
|
@@ -1696,7 +1695,7 @@ module Squared
|
|
|
1696
1695
|
cmd, opts = git_session('rev-parse', opts: opts)
|
|
1697
1696
|
case flag
|
|
1698
1697
|
when :commit
|
|
1699
|
-
cmd << (
|
|
1698
|
+
cmd << (size.to_i.zero? ? '--verify' : basic_option('short', [size.to_i, 5].max))
|
|
1700
1699
|
append_commit(ref, head: true)
|
|
1701
1700
|
when :branch
|
|
1702
1701
|
cmd << '--abbrev-ref'
|
|
@@ -1760,12 +1759,11 @@ module Squared
|
|
|
1760
1759
|
grep, list = op.partition { |val| OptionPartition.pattern?(val) }
|
|
1761
1760
|
unless grep.empty? && !list.empty?
|
|
1762
1761
|
grep.map! { |val| Regexp.new(val[1..-2]) }
|
|
1763
|
-
files = []
|
|
1764
|
-
|
|
1765
|
-
|
|
1762
|
+
files = []
|
|
1763
|
+
status_data.each do |a, b|
|
|
1764
|
+
next if b.strip.empty? || (!grep.empty? && grep.none? { |pat| pat.match?(a) })
|
|
1766
1765
|
|
|
1767
|
-
|
|
1768
|
-
end
|
|
1766
|
+
files << "#{sub_style(b, styles: color(:red))} #{a}"
|
|
1769
1767
|
end
|
|
1770
1768
|
unless files.empty?
|
|
1771
1769
|
files = choice_index('Select files', files, multiple: true, force: true, trim: /^\S+\s/,
|
|
@@ -1921,7 +1919,7 @@ module Squared
|
|
|
1921
1919
|
end
|
|
1922
1920
|
args = []
|
|
1923
1921
|
args << quote_option('sort', sort) if sort
|
|
1924
|
-
args <<
|
|
1922
|
+
args << basic_option('count', env('GIT_COUNT', ARG[:CHOICE])) if count
|
|
1925
1923
|
choice_index(msg, foreachref(type, *args, format: format), trim: trim, **kwargs)
|
|
1926
1924
|
end
|
|
1927
1925
|
|
|
@@ -1954,13 +1952,13 @@ module Squared
|
|
|
1954
1952
|
end
|
|
1955
1953
|
|
|
1956
1954
|
def status_data(*args)
|
|
1957
|
-
[]
|
|
1958
|
-
|
|
1959
|
-
|
|
1955
|
+
ret = []
|
|
1956
|
+
git_spawn('status -z -uall', *args).split("\x0").each do |line|
|
|
1957
|
+
next unless line =~ /^(.)(.) (.+)$/
|
|
1960
1958
|
|
|
1961
|
-
|
|
1962
|
-
end
|
|
1959
|
+
ret << [$3, $2, $1]
|
|
1963
1960
|
end
|
|
1961
|
+
ret
|
|
1964
1962
|
end
|
|
1965
1963
|
|
|
1966
1964
|
def append_pull(opts, list, target: @session, flag: nil, no: nil, remote: nil, from: nil)
|
|
@@ -2037,7 +2035,9 @@ module Squared
|
|
|
2037
2035
|
|
|
2038
2036
|
def append_message(val = nil, target: @session)
|
|
2039
2037
|
val = messageopt if val.to_s.empty?
|
|
2040
|
-
|
|
2038
|
+
return unless val
|
|
2039
|
+
|
|
2040
|
+
target << quote_option('message', val)
|
|
2041
2041
|
end
|
|
2042
2042
|
|
|
2043
2043
|
def append_head(val = nil, target: @session)
|
|
@@ -158,7 +158,8 @@ module Squared
|
|
|
158
158
|
elsif exception
|
|
159
159
|
indexerror n, list
|
|
160
160
|
else
|
|
161
|
-
|
|
161
|
+
log.warn "run script #{n} of #{list.size} (out of range)"
|
|
162
|
+
next
|
|
162
163
|
end
|
|
163
164
|
run compose(val, script: true)
|
|
164
165
|
else
|
|
@@ -269,6 +270,8 @@ module Squared
|
|
|
269
270
|
|
|
270
271
|
def copy(from: 'build', into: 'node_modules', scope: nil, also: nil, create: nil, files: nil, workspace: false,
|
|
271
272
|
link: false, force: false, override: false, sync: invoked_sync?('copy'), **kwargs)
|
|
273
|
+
return if @copy == false
|
|
274
|
+
|
|
272
275
|
glob = kwargs[:include]
|
|
273
276
|
pass = kwargs[:exclude]
|
|
274
277
|
if @copy && !override
|
|
@@ -285,8 +288,6 @@ module Squared
|
|
|
285
288
|
create = @copy[:create] if @copy.key?(:create)
|
|
286
289
|
glob = @copy[:include] if @copy.key?(:include)
|
|
287
290
|
pass = @copy[:exclude] if @copy.key?(:exclude)
|
|
288
|
-
elsif @copy == false
|
|
289
|
-
return
|
|
290
291
|
end
|
|
291
292
|
items = []
|
|
292
293
|
if build? && path != @workspace.home && @workspace.home?
|
|
@@ -623,6 +624,7 @@ module Squared
|
|
|
623
624
|
else
|
|
624
625
|
footer.call(0, found.size)
|
|
625
626
|
end
|
|
627
|
+
printsucc
|
|
626
628
|
commit(:add, ['package.json'], pass: true)
|
|
627
629
|
end
|
|
628
630
|
elsif !avail.empty?
|
|
@@ -857,7 +859,7 @@ module Squared
|
|
|
857
859
|
end
|
|
858
860
|
|
|
859
861
|
def outdated?
|
|
860
|
-
dependfile.exist?
|
|
862
|
+
dependfile.exist? && !task_pass?('outdated')
|
|
861
863
|
end
|
|
862
864
|
|
|
863
865
|
def update?
|
|
@@ -8,7 +8,7 @@ module Squared
|
|
|
8
8
|
DIR_PYTHON = (DEP_PYTHON + %w[README.rst]).freeze
|
|
9
9
|
OPT_PYTHON = {
|
|
10
10
|
common: %w[b B d E h i I O P q s S u v x c=q m=b W=b X=q check-hash-based-pycs=b].freeze,
|
|
11
|
-
build: %w[n|no-isolation s|sdist x|skip-dependency-check v|verbose w|wheel
|
|
11
|
+
build: %w[C=bm n|no-isolation s|sdist x|skip-dependency-check v|verbose w|wheel config-setting=q installer=b
|
|
12
12
|
o|outdir=p].freeze,
|
|
13
13
|
venv: %w[clear copies symlinks system-site-packages upgrade upgrade-deps without-scm-ignore-files without-pip
|
|
14
14
|
prompt=q].freeze
|
|
@@ -602,7 +602,7 @@ module Squared
|
|
|
602
602
|
end
|
|
603
603
|
|
|
604
604
|
def outdated?
|
|
605
|
-
dependtype > 0
|
|
605
|
+
dependtype > 0 && !task_pass?('outdated')
|
|
606
606
|
end
|
|
607
607
|
|
|
608
608
|
private
|
|
@@ -614,7 +614,7 @@ module Squared
|
|
|
614
614
|
def python_session(*cmd, opts: nil)
|
|
615
615
|
return session('python', *preopts(quiet: false), *cmd, path: venv.nil?) unless opts
|
|
616
616
|
|
|
617
|
-
op = OptionPartition.new(opts, OPT_PYTHON[:common], project: self, single:
|
|
617
|
+
op = OptionPartition.new(opts, OPT_PYTHON[:common], project: self, single: singleopt(:python))
|
|
618
618
|
ret = session('python', *op.to_a, *cmd, path: venv.nil?)
|
|
619
619
|
[ret, op.extras]
|
|
620
620
|
end
|
|
@@ -712,7 +712,7 @@ module Squared
|
|
|
712
712
|
quote_option('cache-dir', basepath(val))
|
|
713
713
|
end
|
|
714
714
|
end
|
|
715
|
-
target <<
|
|
715
|
+
target << quote_option('proxy', val) if (val = option('proxy', target: target))
|
|
716
716
|
target << quote_option('python', basepath(val)) if (val = option('python', target: target))
|
|
717
717
|
append_nocolor(target: target)
|
|
718
718
|
end
|
|
@@ -793,7 +793,7 @@ module Squared
|
|
|
793
793
|
def singleopt(flag = nil)
|
|
794
794
|
case flag
|
|
795
795
|
when :python
|
|
796
|
-
/\A(?:v+|q+|b+)\z/
|
|
796
|
+
/\A(?:v+|q+|b+|V+|O+)\z/
|
|
797
797
|
when :twine
|
|
798
798
|
nil
|
|
799
799
|
else
|
|
@@ -288,6 +288,8 @@ module Squared
|
|
|
288
288
|
end
|
|
289
289
|
|
|
290
290
|
def copy(from: gemlib, into: @gemdir, override: false, **kwargs)
|
|
291
|
+
return if @copy == false
|
|
292
|
+
|
|
291
293
|
glob = kwargs[:include]
|
|
292
294
|
pass = kwargs[:exclude]
|
|
293
295
|
if @copy && !override
|
|
@@ -297,8 +299,6 @@ module Squared
|
|
|
297
299
|
glob = @copy[:include] if @copy.key?(:include)
|
|
298
300
|
pass = @copy[:exclude] if @copy.key?(:exclude)
|
|
299
301
|
into = @copy[:into] if @copy.key?(:into)
|
|
300
|
-
elsif @copy == false
|
|
301
|
-
return
|
|
302
302
|
end
|
|
303
303
|
return unless into
|
|
304
304
|
|
|
@@ -462,13 +462,15 @@ module Squared
|
|
|
462
462
|
case flag
|
|
463
463
|
when :file, :script
|
|
464
464
|
op = OptionPartition.new(opts, OPT_RUBY[:ruby], ruby_session, project: self, args: true)
|
|
465
|
-
if
|
|
466
|
-
op.unshift(shell_quote(basepath(file)))
|
|
467
|
-
elsif command
|
|
465
|
+
if command
|
|
468
466
|
op << quote_option('e', command, option: false)
|
|
467
|
+
elsif file
|
|
468
|
+
op.unshift(basepath(file))
|
|
469
|
+
end
|
|
470
|
+
unless op.arg?('e')
|
|
471
|
+
op.push(args) if args
|
|
472
|
+
op.append(delim: true, escape: false, quote: false) unless op.empty?
|
|
469
473
|
end
|
|
470
|
-
op.push(args) if args
|
|
471
|
-
op.append(delim: true, escape: false, quote: false) unless op.empty?
|
|
472
474
|
when :version
|
|
473
475
|
pwd_set do
|
|
474
476
|
out = []
|
|
@@ -763,7 +765,7 @@ module Squared
|
|
|
763
765
|
else
|
|
764
766
|
[name[0, n], name[(n + 1)..-1]]
|
|
765
767
|
end
|
|
766
|
-
op.adjoin(pre,
|
|
768
|
+
op.adjoin(pre, basic_option('version', ver))
|
|
767
769
|
.clear
|
|
768
770
|
elsif flag == :install
|
|
769
771
|
op.append_any
|
|
@@ -828,13 +830,8 @@ module Squared
|
|
|
828
830
|
end
|
|
829
831
|
|
|
830
832
|
def gemspec
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
@gemspec = if gemfile
|
|
834
|
-
Gem::Specification.load(gemfile.to_s) rescue false
|
|
835
|
-
else
|
|
836
|
-
false
|
|
837
|
-
end
|
|
833
|
+
@gemspec = !gemfile.nil? && Gem::Specification.load(gemfile.to_s) rescue false if @gemspec.nil?
|
|
834
|
+
@gemspec || nil
|
|
838
835
|
end
|
|
839
836
|
|
|
840
837
|
def gemname
|
|
@@ -924,7 +921,7 @@ module Squared
|
|
|
924
921
|
end
|
|
925
922
|
|
|
926
923
|
def outdated?
|
|
927
|
-
dependtype > 0
|
|
924
|
+
dependtype > 0 && !task_pass?('outdated')
|
|
928
925
|
end
|
|
929
926
|
|
|
930
927
|
private
|
|
@@ -994,10 +991,11 @@ module Squared
|
|
|
994
991
|
end
|
|
995
992
|
|
|
996
993
|
def rakefile
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
994
|
+
if @rakefile.nil?
|
|
995
|
+
file = Rake::Application::DEFAULT_RAKEFILES.find { |val| basepath(val).exist? }
|
|
996
|
+
@rakefile = !file.nil? && basepath(file)
|
|
997
|
+
end
|
|
998
|
+
@rakefile || nil
|
|
1001
999
|
end
|
|
1002
1000
|
|
|
1003
1001
|
def rakepwd
|
|
@@ -1026,11 +1024,12 @@ module Squared
|
|
|
1026
1024
|
end
|
|
1027
1025
|
|
|
1028
1026
|
def gemfile
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1027
|
+
if @gemfile.nil?
|
|
1028
|
+
@gemfile = [project, name].map! { |val| basepath("#{val}.gemspec") }
|
|
1029
|
+
.concat(Dir.glob(basepath('*.gemspec')))
|
|
1030
|
+
.find { |file| File.exist?(file) } || false
|
|
1031
|
+
end
|
|
1032
|
+
@gemfile || nil
|
|
1034
1033
|
end
|
|
1035
1034
|
|
|
1036
1035
|
def gemlib
|
|
@@ -29,15 +29,15 @@ module Squared
|
|
|
29
29
|
pat, s = Array(strip)
|
|
30
30
|
ret.map! { |val| val.is_a?(String) ? val.gsub(pat, s || '') : val }
|
|
31
31
|
end
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
32
|
+
ret.map! do |val|
|
|
33
|
+
next val if opt?(val)
|
|
34
|
+
|
|
35
|
+
if quote || val.is_a?(Pathname)
|
|
36
|
+
shell_quote(val, force: force, double: double)
|
|
37
|
+
elsif escape
|
|
38
|
+
shell_escape(val, quote: quote, double: double)
|
|
39
|
+
else
|
|
40
|
+
val
|
|
41
41
|
end
|
|
42
42
|
end
|
|
43
43
|
if target.is_a?(Set)
|
|
@@ -88,7 +88,7 @@ module Squared
|
|
|
88
88
|
|
|
89
89
|
def arg?(target, *args, value: false, **)
|
|
90
90
|
r, s = args.partition { |val| val.is_a?(Regexp) }
|
|
91
|
-
r << matchopts(s, value
|
|
91
|
+
r << matchopts(s, value) unless s.empty?
|
|
92
92
|
a = target.to_a.compact
|
|
93
93
|
if (n = a.index('--'))
|
|
94
94
|
a = a[0..n]
|
|
@@ -300,12 +300,14 @@ module Squared
|
|
|
300
300
|
self
|
|
301
301
|
end
|
|
302
302
|
|
|
303
|
-
def append_any(*args, **kwargs)
|
|
303
|
+
def append_any(*args, quote: true, **kwargs)
|
|
304
304
|
(args.empty? ? extras : args.flatten).each do |val|
|
|
305
305
|
if exist?(val)
|
|
306
306
|
add_path(val, **kwargs)
|
|
307
|
-
|
|
307
|
+
elsif quote
|
|
308
308
|
add_quote(val, **kwargs)
|
|
309
|
+
else
|
|
310
|
+
add val
|
|
309
311
|
end
|
|
310
312
|
end
|
|
311
313
|
self
|
|
@@ -387,7 +389,7 @@ module Squared
|
|
|
387
389
|
end
|
|
388
390
|
|
|
389
391
|
def add_path(*args, **kwargs)
|
|
390
|
-
add shell_quote(path ? path.join(*args) : File.join(*args), **kwargs)
|
|
392
|
+
add shell_quote(path ? path.join(*args) : File.join(*args), option: false, **kwargs)
|
|
391
393
|
self
|
|
392
394
|
end
|
|
393
395
|
|
|
@@ -397,6 +399,11 @@ module Squared
|
|
|
397
399
|
self
|
|
398
400
|
end
|
|
399
401
|
|
|
402
|
+
def delim
|
|
403
|
+
add '--'
|
|
404
|
+
self
|
|
405
|
+
end
|
|
406
|
+
|
|
400
407
|
def splice(*exclude, quote: true, delim: true, path: false, pattern: false, &blk)
|
|
401
408
|
found, other = if block_given?
|
|
402
409
|
partition(&blk)
|
|
@@ -158,7 +158,7 @@ module Squared
|
|
|
158
158
|
desc.call("init[manifest?=#{target},groups?,{0}]", target)
|
|
159
159
|
task 'init' do |_, args|
|
|
160
160
|
args = args.to_a
|
|
161
|
-
u = env('
|
|
161
|
+
u = env('REPO_GIT') || manifest_url
|
|
162
162
|
m = args.first && !opts.include?(args.first) ? args.shift : target
|
|
163
163
|
g = args.first && !opts.include?(args.first) ? args.shift : nil
|
|
164
164
|
g = case (val = env('REPO_GROUPS'))
|
|
@@ -251,7 +251,7 @@ module Squared
|
|
|
251
251
|
end
|
|
252
252
|
|
|
253
253
|
def repo?
|
|
254
|
-
return false unless manifest_url
|
|
254
|
+
return false unless manifest_url && !windows?
|
|
255
255
|
|
|
256
256
|
repo_install? || @repo_override == true
|
|
257
257
|
end
|
data/lib/squared/workspace.rb
CHANGED
|
@@ -5,12 +5,14 @@ module Squared
|
|
|
5
5
|
class << self
|
|
6
6
|
include Common
|
|
7
7
|
|
|
8
|
-
def resolve(*args)
|
|
8
|
+
def resolve(*args, base: '..')
|
|
9
|
+
values = __get__(:project).values
|
|
9
10
|
ret = args.map do |id|
|
|
10
11
|
if id.is_a?(Symbol)
|
|
11
12
|
project id
|
|
12
13
|
else
|
|
13
|
-
|
|
14
|
+
values.find { |proj| proj.name == id } || values.find { |proj| proj.project == id } ||
|
|
15
|
+
values.find { |proj| proj.path.to_s == File.expand_path(id, base) }
|
|
14
16
|
end
|
|
15
17
|
end
|
|
16
18
|
ret.size == 1 ? ret.first : ret
|
|
@@ -18,7 +20,7 @@ module Squared
|
|
|
18
20
|
|
|
19
21
|
def expect(name)
|
|
20
22
|
ret = project name
|
|
21
|
-
return ret if ret&.path&.directory?
|
|
23
|
+
return ret if ret&.path&.directory? && !ret.path.empty?
|
|
22
24
|
|
|
23
25
|
raise NoMethodError, "project is not initialized (#{name})"
|
|
24
26
|
end
|
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.4.
|
|
4
|
+
version: 0.4.32
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- An Pham
|
|
@@ -125,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
125
125
|
- !ruby/object:Gem::Version
|
|
126
126
|
version: '0'
|
|
127
127
|
requirements: []
|
|
128
|
-
rubygems_version: 3.
|
|
128
|
+
rubygems_version: 3.6.9
|
|
129
129
|
specification_version: 4
|
|
130
130
|
summary: Rake task generator for managing multi-language workspaces.
|
|
131
131
|
test_files: []
|