squared 0.3.9 → 0.3.11

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c3ecf3c0d10f36460a83779df904d378fbca6fa8d5b08e9813f1b5e8d1d91952
4
- data.tar.gz: a12c3454145efdb8319d72240f53ccda0eeabbe4779055c0e7c7180a8621e8af
3
+ metadata.gz: 249f3799dc2e8a511a03aec91e04dc84f707cf7b21eb194b89e53805321001c6
4
+ data.tar.gz: 4906775ef2c64fae979a3b21a142a19b1f4d17ad4e659b577a41dc971e1c7b4d
5
5
  SHA512:
6
- metadata.gz: 408330c1da4bec81cb8170ba606001b3491c0d4061a9e32492714f15941d6043a9fa5e0b62e831dc46977e0abf91b9617bd704f4142f66cbb47fb2e69a9f639e
7
- data.tar.gz: 3bf4983b1e3cb87a57611f66f6d8a4f6d79f8d056855358d1bf75f43ed6459fa8aef21daf7a8afc3025f89f40a95c5247d8a1a90c9c21991e14cc281bb83ed8e
6
+ metadata.gz: a575c60ad790e1852dad7220d2783bd32e03bfd62d0a04326e5ee72a1868d89ed49b3a50f85504d097ba06d9bd673997770abd091fc0a6da661c7253186b861f
7
+ data.tar.gz: fb026dc84454c92e2c09ee52d1fc3fddf0f6f33a071f389abbbc0de6ec584d696e1feed133e05502d5f431d2b67998133e6e5f79b98dd5d382c337e000469d98
data/CHANGELOG.md CHANGED
@@ -1,5 +1,56 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.3.11] - 2025-05-15
4
+
5
+ - See `0.2.11`.
6
+
7
+ ## [0.2.11] - 2025-05-15
8
+
9
+ ### Fixed
10
+
11
+ - Disabled batch and alias tasks were not hidden.
12
+ - Workspace git did not parse multiple download URIs.
13
+
14
+ ## [0.1.8] - 2025-05-15
15
+
16
+ ### Fixed
17
+
18
+ - Disabled batch and alias tasks were not hidden.
19
+ - Log messages were written to terminal twice when emphasized.
20
+ - Node outdated interactive for major would sometimes deactivate.
21
+ - Node outdated interactive for major was mislabeled as minor.
22
+
23
+ ## [0.3.10] - 2025-04-27
24
+
25
+ ### Fixed
26
+
27
+ - Git command reset action commit used invalid delimeter.
28
+ - Git single option values were not merged as per specification.
29
+ - Project script task did not fire first and last callbacks.
30
+ - Git task status did not display branch information.
31
+ - Git checkout action commit did not include options.
32
+
33
+ ### Removed
34
+
35
+ - Git command files action ignored could not be used alone.
36
+
37
+ ## [0.2.10] - 2025-04-27
38
+
39
+ ### Fixed
40
+
41
+ - Project run and script tasks did not fire first and last callbacks.
42
+ - Git command clone did not read booleans for recurse-submodules.
43
+
44
+ ## [0.1.7] - 2025-04-27
45
+
46
+ ### Fixed
47
+
48
+ - Project directory context method option pass was inverted.
49
+ - Shell options with spaces and without quotes were not escaped.
50
+ - Git task status did not display branch information.
51
+ - Ruby copy method argument include was ignored when used directly.
52
+ - Git commit could not push branch without same name as remote.
53
+
3
54
  ## [0.3.9] - 2025-04-17
4
55
 
5
56
  ### Fixed
@@ -370,6 +421,8 @@
370
421
 
371
422
  - Changelog was created.
372
423
 
424
+ [0.3.11]: https://github.com/anpham6/squared/releases/tag/v0.3.11-ruby
425
+ [0.3.10]: https://github.com/anpham6/squared/releases/tag/v0.3.10-ruby
373
426
  [0.3.9]: https://github.com/anpham6/squared/releases/tag/v0.3.9-ruby
374
427
  [0.3.8]: https://github.com/anpham6/squared/releases/tag/v0.3.8-ruby
375
428
  [0.3.7]: https://github.com/anpham6/squared/releases/tag/v0.3.7-ruby
@@ -380,6 +433,8 @@
380
433
  [0.3.2]: https://github.com/anpham6/squared/releases/tag/v0.3.2-ruby
381
434
  [0.3.1]: https://github.com/anpham6/squared/releases/tag/v0.3.1-ruby
382
435
  [0.3.0]: https://github.com/anpham6/squared/releases/tag/v0.3.0-ruby
436
+ [0.2.11]: https://github.com/anpham6/squared/releases/tag/v0.2.11-ruby
437
+ [0.2.10]: https://github.com/anpham6/squared/releases/tag/v0.2.10-ruby
383
438
  [0.2.9]: https://github.com/anpham6/squared/releases/tag/v0.2.9-ruby
384
439
  [0.2.8]: https://github.com/anpham6/squared/releases/tag/v0.2.8-ruby
385
440
  [0.2.7]: https://github.com/anpham6/squared/releases/tag/v0.2.7-ruby
@@ -390,6 +445,8 @@
390
445
  [0.2.2]: https://github.com/anpham6/squared/releases/tag/v0.2.2-ruby
391
446
  [0.2.1]: https://github.com/anpham6/squared/releases/tag/v0.2.1-ruby
392
447
  [0.2.0]: https://github.com/anpham6/squared/releases/tag/v0.2.0-ruby
448
+ [0.1.8]: https://github.com/anpham6/squared/releases/tag/v0.1.8-ruby
449
+ [0.1.7]: https://github.com/anpham6/squared/releases/tag/v0.1.7-ruby
393
450
  [0.1.6]: https://github.com/anpham6/squared/releases/tag/v0.1.6-ruby
394
451
  [0.1.5]: https://github.com/anpham6/squared/releases/tag/v0.1.5-ruby
395
452
  [0.1.4]: https://github.com/anpham6/squared/releases/tag/v0.1.4-ruby
data/README.ruby.md CHANGED
@@ -433,7 +433,7 @@ Most project classes will inherit from `Git` which enables these tasks:
433
433
  | commit | commit | add all amend amend-orig |
434
434
  | diff | diff | head cached branch files between contain |
435
435
  | fetch | fetch | origin remote |
436
- | files | ls-files | cached modified deleted others ignored |
436
+ | files | ls-files | cached modified deleted others |
437
437
  | pull | pull | origin remote |
438
438
  | rebase | rebase | branch onto send |
439
439
  | refs | ls-remote --refs | heads tags remote |
@@ -53,7 +53,7 @@ module Squared
53
53
  end
54
54
  wrap = ->(s, n) { "\x1B[#{n.join(';')}m#{s}\x1B[0m" }
55
55
  code = []
56
- args.concat(as_a(styles)).each_with_index do |type, i|
56
+ args.concat(as_a(styles)).flatten.each_with_index do |type, i|
57
57
  next unless type
58
58
 
59
59
  if index == -1
@@ -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
@@ -21,7 +21,7 @@ module Squared
21
21
  return false
22
22
  end
23
23
  attempts -= 1
24
- exit 1 unless attempts >= 0
24
+ exit 1 unless attempts > 0
25
25
  end
26
26
  rescue Interrupt
27
27
  puts
@@ -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 if !data[2] || (!data[4] && data[5] =~ /\s/)
13
+ return val if !data[2] || (!data[4] && !data[5].match?(/\s/))
14
14
 
15
15
  join = ->(opt) { data[1] + data[3] + shell_quote(opt) }
16
16
  if data[4] == data[6]
@@ -21,7 +21,7 @@ module Squared
21
21
  elsif Rake::Win32.windows?
22
22
  quote ? shell_quote(val, force: force) : val
23
23
  else
24
- Shellwords.escape(val)
24
+ val.empty? ? '' : Shellwords.escape(val)
25
25
  end
26
26
  end
27
27
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Squared
4
- VERSION = '0.3.9'
4
+ VERSION = '0.3.11'
5
5
  end
@@ -455,7 +455,7 @@ module Squared
455
455
  tasks << key if obj.has?(key, baseref)
456
456
  elsif (batch = series.batch_get(key))
457
457
  obj.allref.each do |ref|
458
- next unless (data = batch[ref])
458
+ next unless obj.has?(key, ref) && (data = batch[ref])
459
459
 
460
460
  data.each do |val|
461
461
  if (items = task_resolve(obj, val)).empty?
@@ -474,7 +474,7 @@ module Squared
474
474
  return [] if (base && !obj.ref?(baseref)) || !(data = series.alias_get(key))
475
475
 
476
476
  obj.allref.each do |ref|
477
- next unless (alt = data[ref])
477
+ next unless obj.has?(key, ref) && (alt = data[ref])
478
478
 
479
479
  ret = task_resolve(obj, alt)
480
480
  break unless ret.empty?
@@ -407,6 +407,7 @@ module Squared
407
407
  return unless respond_to?(:compose)
408
408
 
409
409
  cmd = compose(as_get(opts), flags, script: true, args: scr, from: from)
410
+ from = :script if from == :run && script?
410
411
  end
411
412
  run(cmd, var, from: from, banner: banner, sync: sync)
412
413
  end
@@ -1314,7 +1315,7 @@ module Squared
1314
1315
  pwd = Pathname.pwd
1315
1316
  if block_given?
1316
1317
  begin
1317
- if path == pwd || pass == true || (pass.is_a?(String) && semscan(pass).join >= RUBY_VERSION)
1318
+ if path == pwd || pass == true || (pass.is_a?(String) && semscan(pass).join <= RUBY_VERSION)
1318
1319
  ret = instance_eval(&blk)
1319
1320
  else
1320
1321
  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 { |val| repo << proj if (proj = @project[val.to_s]) && check.(proj) }
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)
@@ -75,7 +79,7 @@ module Squared
75
79
  include Prompt
76
80
 
77
81
  OPT_GIT = {
78
- branch: %w[a|all create-reflog i|ignore-case q|quiet r|remotes v|verbose abbrev=i color=b column=b
82
+ branch: %w[a|all create-reflog i|ignore-case q|quiet r|remotes v|verbose vv abbrev=i color=b column=b
79
83
  contains=e format=q merged=e no-contains=e no-merged=e points-at=e u|set-upstream-to=e sort=q
80
84
  t|track=b].freeze,
81
85
  checkout: %w[l d|detach f|force ignore-other-worktrees ignore-skip-worktree-bits m|merge p|patch
@@ -88,7 +92,7 @@ module Squared
88
92
  fetch: {
89
93
  base: %w[multiple progress P|prune-tags refetch stdin u|update-head-ok
90
94
  recurse-submodules-default=b].freeze,
91
- pull: %w[4 6 n t a|append atomic dry-run f|force k|keep n|negotiate-only prefetch p|prune q|quiet
95
+ pull: %w[4 6 n t a|append atomic dry-run f|force k|keep negotiate-only prefetch p|prune q|quiet
92
96
  set-upstream unshallow update-shallow v|verbose deepen=i depth=i j|jobs=i negotiation-tip=q
93
97
  recurse-submodules=v refmap=q o|server-option=e shallow-exclude=e shallow-since=v
94
98
  upload-pack=e].freeze
@@ -104,40 +108,40 @@ module Squared
104
108
  exclude-hidden=b? glob=q grep=q grep-reflog=q L=q n|max-count=i max-parents=i min-parents=i
105
109
  no-walk=b? remotes=q? since=q since-as-filter=q skip=i tags=q? until=q].freeze,
106
110
  format: %w[t children combined-all-paths oneline left-right no-diff-merges parents relative-date
107
- show-signature date=q diff-merges=b encoding=b expand-tabs=i format=q notes=q pretty=q?
111
+ show-signature date=q diff-merges=b encoding=b expand-tabs=i format=q notes=b pretty=q?
108
112
  show-linear-break=q?].freeze,
109
113
  diff: %w[p R u z l=i G=q O=q S=q binary check compact-summary cumulative find-copies-harder full-index
110
114
  W|function-context w|ignore-all-space ignore-blank-lines ignore-cr-at-eol ignore-space-at-eol
111
115
  b|ignore-space-change D|irreversible-delete graph ita-invisible-in-index minimal name-only
112
116
  name-status no-color-moved-ws no-prefix no-renames numstat patch-with-raw patch-with-stat patience
113
117
  pickaxe-all pickaxe-regex raw shortstat summary a|text abbrev=i? anchored=q B|break-rewrites=e?
114
- color=b color-moved=b color-moved-ws=b color-words=q? diff-algorithm=b diff-filter=e? X|dirstat=q?
115
- dirstat-by-file=q? dst-prefix=q C|find-copies=i? find-object=e M|find-renames=i?
118
+ color=b color-moved=b color-moved-ws=b color-words=q? diff-algorithm=b diff-filter=e? X|dirstat=b?
119
+ dirstat-by-file=q? dst-prefix=q C|find-copies=b? find-object=e M|find-renames=b?
116
120
  I|ignore-matching-lines=q ignore-submodules=b inter-hunk-context=i line-prefix=q output=p
117
121
  output-indicator-context=q output-indicator-new=q output-indicator-old=q relative=p rotate-to=p
118
122
  skip-to=p src-prefix=q stat=q? stat-width=i stat-name-width=i stat-count=i submodule=b? U|unified=i
119
- word-diff=b? word-diff-regex=q ws-error-highligt=q].freeze
123
+ word-diff=b? word-diff-regex=q ws-error-highlight=b].freeze
120
124
  }.freeze,
121
- ls_files: %w[z debug deduplicate directory eol error-unmatch exclude-standard full-name k|killed
122
- no-empty-directory recurse-submodules sparse s|stage u|unmerged abbrev=i x|exclude=q
125
+ ls_files: %w[f t v z debug deduplicate directory eol error-unmatch exclude-standard full-name i|ignored
126
+ k|killed no-empty-directory recurse-submodules sparse s|stage u|unmerged abbrev=i x|exclude=q
123
127
  X|exclude-from=p exclude-per-directory=p format=q with-tree=q].freeze,
124
128
  ls_remote: %w[exit-code get-url q|quiet o|server-option=e symref sort=q upload-pack=e].freeze,
125
- pull: %w[e n allow-unrelated-histories ff-only S|gpg-sign=e log=i r|rebase=v? s|strategy=b
129
+ pull: %w[e n allow-unrelated-histories ff-only S|gpg-sign=b? log=i r|rebase=v? s|strategy=b
126
130
  X|strategy-option=e].freeze,
127
131
  rebase: %w[n C=i allow-empty-message apply committer-date-is-author-date edit-todo f|force-rebase ignore-date
128
- ignore-whitespace i|interactive keep-base m merge no-ff q|quiet quit r|rebase-merges=b?
129
- reset-author-date root show-current-patch signoff v|verbose empty=b S|gpg-sign=b onto=e
132
+ ignore-whitespace i|interactive keep-base m|merge no-ff q|quiet quit r|rebase-merges=b?
133
+ reset-author-date root show-current-patch signoff v|verbose empty=b S|gpg-sign=b? onto=e
130
134
  s|strategy=b X|strategy-option=b whitespace=e].freeze,
131
135
  reset: %w[N pathspec-file-nul q|quiet pathspec-from-file=p].freeze,
132
136
  restore: %w[ignore-unmerged ignore-skip-worktree-bits m|merge ours p|patch pathspec-file-nul S|staged theirs
133
137
  W|worktree conflict=b pathspec-from-file=p s|source=q].freeze,
134
138
  rev_parse: {
135
139
  output: %w[absolute-git-dir all flags git-common-dir git-dir is-bare-repository is-inside-git-dir
136
- is-inside-work-tree is-shallow-repository local-env-vars no-flags no-revs not q|quiet sq
137
- revs-only shared-index-path show-cdup show-prefix show-toplevel show-superproject-working-tree
138
- sq-quote symbolic symbolic-full-name verify abbrev-ref=b? after=q before=q default=e
139
- disambiguate=b exclude=q exclude-hidden=b glob=q git-path=p path-format=b? prefix=q branches=q?
140
- remotes=q? resolve-git-dir=p short=i? show-object-format=b? since=q tags=q? until=q].freeze,
140
+ is-inside-work-tree is-shallow-repository local-env-vars no-flags no-revs not q|quiet revs-only
141
+ shared-index-path show-cdup show-prefix show-toplevel show-superproject-working-tree sq sq-quote
142
+ symbolic symbolic-full-name verify abbrev-ref=b? after=q before=q default=e disambiguate=b
143
+ exclude=q exclude-hidden=b glob=q git-path=p path-format=b? prefix=q branches=q? remotes=q?
144
+ resolve-git-dir=p short=i? show-object-format=b? since=q tags=q? until=q].freeze,
141
145
  parseopt: %w[keep-dashdash stop-at-non-option stuck-long].freeze
142
146
  }.freeze,
143
147
  show: %w[t combined-all-paths no-diff-merges remerge-diff show-signature diff-merges=b encoding=b
@@ -230,7 +234,7 @@ module Squared
230
234
  'commit' => %i[add all amend amend-orig].freeze,
231
235
  'diff' => %i[head cached branch files view between contain].freeze,
232
236
  'fetch' => %i[origin remote].freeze,
233
- 'files' => %i[cached modified deleted others ignored].freeze,
237
+ 'files' => %i[cached modified deleted others].freeze,
234
238
  'log' => %i[view between contain].freeze,
235
239
  'pull' => %i[origin remote].freeze,
236
240
  'rebase' => %i[branch onto send].freeze,
@@ -402,7 +406,7 @@ module Squared
402
406
  format_desc action, flag, 'branch/commit,opts*'
403
407
  task flag, [:commit] do |_, args|
404
408
  commit = param_guard(action, flag, args: args, key: :commit)
405
- checkout(flag, commit: commit)
409
+ checkout(flag, args.extras, commit: commit)
406
410
  end
407
411
  when :detach
408
412
  format_desc action, flag, 'branch/commit?'
@@ -689,6 +693,7 @@ module Squared
689
693
  def status(*, sync: invoked_sync?('status'), **)
690
694
  cmd = git_session 'status'
691
695
  cmd << (option('long') ? '--long' : '--short')
696
+ cmd << '--branch' if option('branch')
692
697
  if (val = option('ignore-submodules', ignore: false))
693
698
  cmd << basic_option('ignore-submodules', case val
694
699
  when '0', 'none'
@@ -723,13 +728,11 @@ module Squared
723
728
  cmd = git_session 'reset'
724
729
  case flag
725
730
  when :commit, :index
726
- out = option_sanitize(opts, OPT_GIT[:reset] + VAL_GIT[:reset], no: OPT_GIT[:no][:reset]).first
731
+ refs = option_sanitize(opts, OPT_GIT[:reset] + VAL_GIT[:reset], no: OPT_GIT[:no][:reset]).first
727
732
  if flag == :commit
728
- append_value(commit, delim: true)
729
- option_clear out
733
+ append_value commit
734
+ option_clear refs
730
735
  ref = false
731
- else
732
- (refs ||= []).concat(out)
733
736
  end
734
737
  when :mode
735
738
  return unless VAL_GIT[:reset].include?(mode)
@@ -780,7 +783,7 @@ module Squared
780
783
  else
781
784
  out = option_sanitize(opts, OPT_GIT[:checkout], no: OPT_GIT[:no][:checkout]).first
782
785
  if flag == :commit
783
- append_value(commit, delim: true)
786
+ append_value commit
784
787
  option_clear out
785
788
  else
786
789
  append_head
@@ -831,7 +834,7 @@ module Squared
831
834
  cmd << shell_quote(range.join(flag == :between ? '..' : '...'))
832
835
  else
833
836
  commit, files = files.partition do |val|
834
- val.start_with?('^') || (!%r{^[.\\/]}.match?(val) && !%r{[\\/]$}.match?(val)) || commithash(val)
837
+ val.start_with?('^') || (!%r{^.(?:[\\/]|$)}.match?(val) && !%r{[\\/]$}.match?(val)) || commithash(val)
835
838
  end
836
839
  cmd.merge(commit.map { |val| commithash(val) || shell_quote(val) }) unless commit.empty?
837
840
  end
@@ -906,52 +909,39 @@ module Squared
906
909
  else
907
910
  "-- #{refs.join(' ')}"
908
911
  end
909
- origin = nil
912
+ format = '%(if)%(HEAD)%(then)%(refname:short)...%(upstream:short)...%(upstream:track)%(end)'
910
913
  branch = nil
911
- upstream = nil
912
- source(git_output('fetch --no-tags --quiet'), io: true, banner: false)
913
- source(git_output('branch -vv --list'), io: true, banner: false).first.each do |val|
914
- next unless (data = /^\*\s(\S+)\s+(\h+)(?:\s\[(.+?)(?=\]\s)\])?\s/.match(val))
915
-
916
- branch = data[1]
917
- if !data[3]
918
- unless (origin = option('repository', prefix: 'git', ignore: false))
919
- out = source(git_output('log -n1 --format=%h%d'), io: true, stdout: true, banner: false).first
920
- if out =~ /^#{data[2]} \(HEAD -> #{Regexp.escape(branch)}, (.+?)\)$/
921
- split_escape($1).each do |s|
922
- next unless s.end_with?("/#{branch}")
923
-
924
- origin = s[0, s.size - branch.size - 1]
925
- break
926
- end
927
- end
928
- end
929
- upstream = true if origin
930
- elsif data[3] =~ %r{^(.+)/#{Regexp.escape(branch)}$}
931
- origin = $1
914
+ origin = nil
915
+ source(git_output('fetch --no-tags --quiet'), io: true, banner: false, stdout: true)
916
+ cmd = git_output("for-each-ref --format=\"#{format}\" refs/heads")
917
+ source(cmd, io: true, banner: false).first.each do |line|
918
+ next if (line = line.chomp).empty?
919
+
920
+ branch, origin, hint = line.split('...')
921
+ if hint && !hint.match?(/^\[(\D+0,\D+0)\]$/)
922
+ raise_error('work tree is not usable', hint: hint[1..-2])
923
+ elsif origin.empty?
924
+ return nil if pass
925
+
926
+ raise_error('no remote upstream', hint: branch)
932
927
  end
933
928
  break
934
929
  end
935
- raise_error('commit', 'work tree is not usable') unless origin && branch
930
+ i = origin.index('/')
931
+ branch = "#{branch}:#{origin[i + 1..-1]}" unless origin.end_with?("/#{branch}")
932
+ origin = origin[0..i - 1]
936
933
  cmd = git_session('commit', option('dry-run') && '--dry-run', options: false)
937
- if amend
938
- cmd << '--amend'
939
- else
940
- cmd.delete('--amend')
941
- end
934
+ cmd << '--amend' if amend
942
935
  if message
943
936
  append_message message
944
937
  elsif flag == :'amend-orig' || option('no-edit')
945
938
  cmd << '--no-edit'
946
939
  end
947
940
  a = git_output 'add', '--verbose'
948
- b = git_output 'push', upstream && '--set-upstream'
949
- if dryrun?
950
- a << '--dry-run'
951
- b << '--dry-run'
952
- end
941
+ b = git_output 'push'
942
+ b << '--dry-run' if dryrun?
953
943
  a << pathspec
954
- b << '--force' if amend
944
+ b << '--force-with-lease' if amend
955
945
  b << origin << branch
956
946
  puts if pass
957
947
  source a
@@ -1304,16 +1294,22 @@ module Squared
1304
1294
  return unless (val = option('recurse-submodules', target: target, ignore: false))
1305
1295
 
1306
1296
  if from == :clone
1307
- projectmap(split_escape(val)).each do |path|
1308
- target << basic_option('recurse-submodules', path)
1297
+ case val
1298
+ when '0', 'false'
1299
+ target << '--no-recurse-submodules'
1300
+ when '1', 'true'
1301
+ target << '--recurse-submodules'
1302
+ else
1303
+ projectmap(split_escape(val)).each do |path|
1304
+ target << basic_option('recurse-submodules', path)
1305
+ end
1309
1306
  end
1310
- target
1311
1307
  else
1312
1308
  target << case val
1313
1309
  when 'no', '0'
1314
1310
  '--no-recurse-submodules'
1315
1311
  when 'yes', 'on-demand'
1316
- "--recurse-submodules#{from == :reset ? '' : "=#{val}"}"
1312
+ "--recurse-submodules=#{val}"
1317
1313
  else
1318
1314
  '--recurse-submodules'
1319
1315
  end
@@ -437,7 +437,7 @@ module Squared
437
437
  index = if a != c
438
438
  1
439
439
  elsif b != d
440
- 3
440
+ a == '0' ? 1 : 3
441
441
  else
442
442
  5
443
443
  end
@@ -471,7 +471,8 @@ module Squared
471
471
  col2 = size_col.(found, 1) + 4
472
472
  found.each_with_index do |item, i|
473
473
  a, b, c, d, e = item
474
- if inter && (rev != :major || e || semmajor?(item[5], item[6])) && !confirm_outdated(a, c, d, e)
474
+ f = inter && (rev != :major || e || semmajor?(item[5], item[6]))
475
+ if f && !confirm_outdated(a, c, d, e)
475
476
  cur = -1
476
477
  else
477
478
  cur = modified
@@ -699,12 +700,12 @@ module Squared
699
700
  run(from: :pack)
700
701
  end
701
702
 
702
- def compose(opts, flags = nil, script: false, args: nil, from: :build, **)
703
+ def compose(opts, flags = nil, script: false, args: nil, from: nil, **)
703
704
  return unless opts
704
705
 
705
706
  if script
706
707
  ret = session dependbin, 'run'
707
- raise_error("#{dependbin} run script: #{from}", hint: "given #{opts}") unless append_any(opts)
708
+ raise_error("#{dependbin} run script: given #{opts}", hint: from) unless append_any(opts)
708
709
  append_any flags if flags
709
710
  append_loglevel
710
711
  append_any(args, delim: true) if args
@@ -718,7 +719,7 @@ module Squared
718
719
  when Enumerable
719
720
  opts.to_a.join(' ')
720
721
  else
721
- raise_error("#{project}: #{from}", hint: "given #{opts}")
722
+ raise_error("#{project}: given #{opts}", hint: from)
722
723
  end
723
724
  end
724
725
  end
@@ -739,6 +740,10 @@ module Squared
739
740
  outdated?
740
741
  end
741
742
 
743
+ def refresh?
744
+ !Node.prod?
745
+ end
746
+
742
747
  def yarn?
743
748
  (@pm[:yarn] ||= if basepath('yarn.lock', ascend: dependext).exist?
744
749
  if (rc = basepath('.yarnrc.yml', ascend: dependext)).exist?
@@ -186,13 +186,15 @@ module Squared
186
186
  end
187
187
  end
188
188
 
189
- def copy(from: 'lib', include: nil, exclude: nil, into: @gemdir, override: false)
189
+ def copy(from: 'lib', into: @gemdir, override: false, **kwargs)
190
+ glob = kwargs[:include]
191
+ pass = kwargs[:exclude]
190
192
  if @copy && !override
191
193
  return super if runnable?(@copy)
192
194
 
193
195
  from = @copy[:from] if @copy.key?(:from)
194
196
  glob = @copy[:include] if @copy.key?(:include)
195
- exclude = @copy[:exclude] if @copy.key?(:exclude)
197
+ pass = @copy[:exclude] if @copy.key?(:exclude)
196
198
  into = @copy[:into] if @copy.key?(:into)
197
199
  end
198
200
  return unless into
@@ -204,10 +206,10 @@ module Squared
204
206
  as_a(from).each_with_index do |val, i|
205
207
  a = basepath(val)
206
208
  b = dest.join(val)
207
- c = glob[i] || glob[0]
209
+ c = glob[i] || glob.first
208
210
  log.info "cp #{a.join(c)} #{b}"
209
211
  begin
210
- copy_dir(a, b, c, pass: exclude, verbose: verbose)
212
+ copy_dir(a, b, c, pass: pass, verbose: verbose)
211
213
  rescue StandardError => e
212
214
  log.error e
213
215
  ret = on(:error, :copy, e)
@@ -3,8 +3,6 @@
3
3
  module Squared
4
4
  module Workspace
5
5
  module Repo
6
- include Common::Format
7
-
8
6
  class << self
9
7
  def read_manifest(path)
10
8
  require 'rexml/document'
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: squared
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.9
4
+ version: 0.3.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - An Pham
8
+ autorequire:
8
9
  bindir: exe
9
10
  cert_chain: []
10
- date: 1980-01-02 00:00:00.000000000 Z
11
+ date: 2025-05-15 00:00:00.000000000 Z
11
12
  dependencies:
12
13
  - !ruby/object:Gem::Dependency
13
14
  name: rake
@@ -106,6 +107,7 @@ metadata:
106
107
  homepage_uri: https://github.com/anpham6/squared
107
108
  source_code_uri: https://github.com/anpham6/squared
108
109
  documentation_uri: https://squared.readthedocs.io
110
+ post_install_message:
109
111
  rdoc_options: []
110
112
  require_paths:
111
113
  - lib
@@ -120,7 +122,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
120
122
  - !ruby/object:Gem::Version
121
123
  version: '0'
122
124
  requirements: []
123
- rubygems_version: 3.6.8
125
+ rubygems_version: 3.1.6
126
+ signing_key:
124
127
  specification_version: 4
125
128
  summary: Rake task generator for managing multi-language workspaces.
126
129
  test_files: []