squared 0.7.10 → 0.8.0

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.
@@ -20,7 +20,7 @@ module Squared
20
20
  elsif !repo_install? && !repo_confirm
21
21
  @root = nil
22
22
  end
23
- raise_error Errno::EEXIST, path.cleanpath, hint: 'REPO_HOME' unless @root
23
+ raise Errno::EEXIST, message(path.cleanpath, hint: 'REPO_HOME') unless @root
24
24
  end
25
25
  path.realdirpath
26
26
  elsif (val = env('REPO_ROOT'))
@@ -28,7 +28,7 @@ module Squared
28
28
  if !@root.exist?
29
29
  @root.mkpath
30
30
  elsif !repo_install?(parent: true) && !repo_confirm
31
- raise_error Errno::EEXIST, @root, hint: 'REPO_ROOT'
31
+ raise Errno::EEXIST, message(@root, hint: 'REPO_ROOT')
32
32
  end
33
33
  @root.join(main).realdirpath
34
34
  elsif repo_install?(parent: true) && (!home.exist? || @root + main == home)
@@ -157,6 +157,8 @@ module Squared
157
157
  [proj, proj.build? && (script || run), doc && proj.doc?, lint && proj.lint?, test && proj.test?]
158
158
  end
159
159
  .select do |proj, run, doc, lint, test|
160
+ next unless proj
161
+
160
162
  proj.doc(sync: true) if doc
161
163
  proj.build(sync: true) if run
162
164
  next if n.anybits?(4)
@@ -184,7 +186,8 @@ module Squared
184
186
  end
185
187
  env('REPO_GROUPS', **envargs) do |val|
186
188
  g = case val
187
- when '0', 'false' then nil
189
+ when '0', 'false'
190
+ nil
188
191
  else
189
192
  val
190
193
  end
@@ -274,7 +277,7 @@ module Squared
274
277
  end
275
278
  end
276
279
 
277
- def repo_run(cmd, opts = [], exception: false, options: true, **kwargs)
280
+ def repo_run(cmd, opts = [], exception: exception?, options: true, **kwargs)
278
281
  cmd = [repo_bin, cmd]
279
282
  cmd << opts.uniq.join(' ') unless opts.empty?
280
283
  env('REPO_OPTIONS', **kwargs) { |val| cmd << val } if options
@@ -307,7 +310,7 @@ module Squared
307
310
  r = r.keys
308
311
  pass = g.empty? && r.empty?
309
312
  select do |proj|
310
- next unless proj.enabled?(baseref)
313
+ next unless proj.enabled?(ref: baseref)
311
314
 
312
315
  proj.global_set(name)
313
316
  i = -1
@@ -338,7 +341,7 @@ module Squared
338
341
  task_invoke(name, **proj.workspace.invokeargs)
339
342
  end
340
343
  rescue => e
341
- raise if exception
344
+ raise if exception?
342
345
 
343
346
  warn log_warn(e, pass: true) if warning
344
347
  end
@@ -38,10 +38,18 @@ module Squared
38
38
  end
39
39
  end
40
40
  if (args = obj.batchargs)
41
- batch_set(*args)
41
+ if args.first.is_a?(Hash)
42
+ batch_set(obj.ref, *args)
43
+ else
44
+ batch_set(*args)
45
+ end
42
46
  end
43
47
  if (args = obj.aliasargs)
44
- alias_set(*args)
48
+ if args.first.is_a?(Hash)
49
+ alias_set(obj.ref, *args)
50
+ else
51
+ alias_set(*args)
52
+ end
45
53
  end
46
54
  end
47
55
  workspace.config_get(:batch)&.each { |args| batch_set(*args) }
@@ -209,9 +217,8 @@ module Squared
209
217
  already_invoked? parallel, val
210
218
  end
211
219
 
212
- def exclude?(key, fallback = false, empty: nil)
213
- fallback = empty unless empty.nil?
214
- @exclude.include?(key) || (fallback && (!key?(key) || self[key].empty?))
220
+ def exclude?(key, empty = false)
221
+ @exclude.include?(key) || (empty && (!key?(key) || self[key].empty?))
215
222
  end
216
223
 
217
224
  private
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.7.10
4
+ version: 0.8.0
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: 4.0.15
128
+ rubygems_version: 4.0.10
129
129
  specification_version: 4
130
130
  summary: Rake task generator for managing multi-language workspaces.
131
131
  test_files: []