squared 0.8.5 → 0.9.0.pre1

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: e486fab218bc18e8b6e3921184c1d4a9aeaf155e2d19f70b62062b279606714d
4
- data.tar.gz: c5d1cf6cabf110cce2befee1fc6d34dcb9f437d5c84b6dc552bd304b3f7af304
3
+ metadata.gz: ebde7859df22cda9eadd92f6bf88141ba9095a7528a8bba9e469333f1bb14370
4
+ data.tar.gz: af5a6e759a021e46d76f4043dcea544b1a7e25dacaddad8389824782fbd1fe78
5
5
  SHA512:
6
- metadata.gz: ba4f0d602d818ad424fc9fc940954f1c7a8d4fc138fd98e8ebb6f4b7d98baa45188a3f0476f4a7de0512c60e06d74f965da7f4a54a34cdcda76d7baec525e2d1
7
- data.tar.gz: 52f518b0aaeb168633399c34f62cf19cb14fc1ed463047cf795b527e82d9439e5c2266c3d0f0709777f6bdafdf40cd88f76bbb118e1236f4b8e8ca9a81741a16
6
+ metadata.gz: 3a00a2d227203bd36460e5a3242de692e7ae2822c1f2812a1a2ec271c4f5d8ffe32af050522e3e20e451920f57d8f5d7363933f7c5abdfb5cbe27e5989e7d41c
7
+ data.tar.gz: 29ef41a9d546d00b4701bc763362a61426312b530b8d5378e60f309cd5469960cab206f969da791936f4da68f9d25772bbfa44dd759c90a5a500b8c504defb44
data/CHANGELOG.md CHANGED
@@ -1,5 +1,47 @@
1
1
  # Changelog
2
2
 
3
+ ## Unreleased
4
+
5
+ ### Added
6
+
7
+ - Gem install global exe command "sqd" was created.
8
+ - Common base argument FORCE for session propagation was created.
9
+ - Common base argument YES for session propagation was created.
10
+ - Common base argument PAGE for prompt choice pagination was created.
11
+ - Ruby command gem action push option dry-run was implemented.
12
+ - Python task depend will install from pylock.toml when detected.
13
+ - Python task depend supports PDM package manager.
14
+ - Common base argument APP for application settings was created.
15
+ - Docker command network action [connect|disconnect] is interactive.
16
+ - Docker command run was implemented.
17
+ - Docker command container is interactive.
18
+ - Docker command network action rm is interactive.
19
+ - Docker command container action rm is interactive.
20
+ - Docker command run action entrypoint is interactive.
21
+
22
+ ### Changed
23
+
24
+ - Ruby required version was changed to 2.7.0.
25
+ - Git commit hash detection supports up to SHA256.
26
+ - Git module revbuild uses a Monitor for file write synchronization.
27
+ - TypeScript base version was changed to v6.0 with support for v7.0.
28
+ - Common base argument CHOICE can be set to Float::INFINITY.
29
+ - OptionPartition singleton does not include Common::Prompt.
30
+ - Docker command image action ls without arguments is interactive.
31
+ - Application banner attributes with project references are segregated.
32
+ - Docker private method dnsname is compliant with RFC 1035.
33
+ - Node task depend uses automatic CI detection for NPM install.
34
+ - Repo sync option --fetch-submodules was renamed --recurse-submodules.
35
+ - Ruby command script does not run code until it has passed validation.
36
+ - Ruby gem io-console is used for default console size.
37
+
38
+ ### Removed
39
+
40
+ - Common prompt method choice keyword auto is implied with a list.
41
+ - Docker private method emptyargs was replaced with OptionPartition.clear.
42
+ - Docker private method charname was replaced with subdomainname.
43
+ - Git command show was relocated into command git action show.
44
+
3
45
  ## [0.8.5] - 2026-09-23
4
46
 
5
47
  ### Added
@@ -658,7 +700,7 @@
658
700
 
659
701
  ### Fixed
660
702
 
661
- - See `0.4.32`.
703
+ - See `0.5.18`.
662
704
 
663
705
  ## [0.4.32]
664
706
 
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # squared 0.8
1
+ # squared 0.9
2
2
 
3
3
  * [source](https://github.com/anpham6/squared-ruby)
4
4
  * [docs](https://squared.readthedocs.io)
@@ -10,13 +10,14 @@
10
10
  | 2024-12-07 | 0.1.0 | 2.4.0 | 3.3.6 | |
11
11
  | 2025-01-07 | 0.2.0 | | 3.4.0 | |
12
12
  | 2025-02-07 | 0.3.0 | | 3.4.1 | |
13
- | 2025-03-06 | 0.4.0 | | 3.4.2 | * |
13
+ | 2025-03-06 | 0.4.0 | | 3.4.2 | |
14
14
  | 2025-06-16 | 0.5.0 | 2.5.0 | 3.4.4 | |
15
15
  | ---------- | ----- | ----- | ----- | --- |
16
16
  | 2025-08-23 | 0.5.5 | | 3.4.5 | |
17
- | 2025-10-31 | 0.6.0 | | 3.4.7 | * |
17
+ | 2025-10-31 | 0.6.0 | | 3.4.7 | |
18
18
  | 2026-01-07 | 0.7.0 | 2.5.0 | 4.0.0 | * |
19
19
  | 2026-06-16 | 0.8.0 | | 4.0.5 | * |
20
+ | 2026-10-12 | 0.9.0 | 2.7.0 | 4.0.7 | * |
20
21
 
21
22
  The range chart indicates the *latest* Ruby tested against at the time of release.
22
23
 
@@ -26,6 +27,41 @@ The range chart indicates the *latest* Ruby tested against at the time of releas
26
27
  gem install squared
27
28
  ```
28
29
 
30
+ ## CLI - sqd
31
+
32
+ There is an additional program wrapper for ``rake`` to be used when running batch commands and to enable global settings more easily.
33
+
34
+ ```xml
35
+ Usage: sqd [options] [rake options] [global...] [:targets...] -- [rake targets...]
36
+
37
+ -R, --ref STR,STR Run global commands by class reference
38
+ -G, --group STR,STR Run global commands by project group
39
+
40
+ -P, --project STR,PAT Run project commands with common arguments
41
+ -a, --project-args STR,STR Provide command arguments for :targets (multiple)
42
+ -e, --project-env KEY=STR Provide command ENV variables for :targets (multiple)
43
+
44
+ -s, --[no-]strict Do not run commands with invalid arguments
45
+ --update Use update strategy for applicable commands
46
+ -F, --force [STR,STR] Enable force through ENV by application
47
+ -y, --yes [STR,STR] Enable auto-approve through ENV by application
48
+ -d, --dry-run Run commands without any modifying actions
49
+
50
+ -S, --select PAGE:CHOICE Prompt menu selection pagination limits
51
+
52
+ -p, --pipe 0|1|2 Set file descriptor for communication
53
+ -o, --pipe-out FILE Write command data stream to a file
54
+ --fail 0..4 Set application exception level
55
+ --log-level SEVERITY Set logger and exception state (debug, info, warn, error, fatal)
56
+
57
+ --[no-]banner Display executing command attributes
58
+ -x, --[no-]color Use enhanced styling for terminal output
59
+ -X, --plain Disable banner and styling for all commands
60
+ -v, --verbose Increase output verbosity (multiple)
61
+ --version Print the current version
62
+ -h, --help Print the command line options
63
+ ```
64
+
29
65
  ## Example - Rakefile
30
66
 
31
67
  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.
@@ -54,7 +90,7 @@ require "squared/app" # All workspace related modules
54
90
  # sqd = /workspaces/squared/sqd
55
91
 
56
92
  # Load external Project classes (optional)
57
- Workspace::Application.load_ref("/home/user/.gem/ruby/4.0.0/gems/squared-0.7.0/lib/squared/workspace/project") # ref = :node => node.rb (absolute)
93
+ Workspace::Application.load_ref("/home/user/.gem/ruby/4.0.0/gems/squared-0.9.0/lib/squared/workspace/project") # ref = :node => node.rb (absolute)
58
94
  Workspace::Application.load_ref("lib/squared/workspace/project", gem: "squared") # bundle env (relative)
59
95
 
60
96
  Workspace::Application
@@ -69,46 +105,48 @@ Workspace::Application
69
105
  "CFLAGS" => "-fPIC -O1"
70
106
  })
71
107
  .add("optparse", doc: "rake rdoc", gemspec: "optparse.gemspec", group: "default") # Uses bundler/gem_tasks (without C extensions)
72
- .add("logger", copy: { from: "lib", glob: "**/*.rb", into: "/home/user/.local/gem/ruby/4.0.0/gems/logger-1.7.0" }, clean: ["tmp/"]) do # autodetect: true | "rvm" | "rbenv" | "asdf" | "bundler"
73
- self.gemdir = "/home/user/.local/gem/ruby/4.0.0/gems/logger-1.7.0" # Default for "into"
108
+ .add("logger", copy: { from: "lib", glob: "**/*.rb", into: "/home/user/.local/gem/ruby/4.0.0/gems/logger-1.7.0" }, clean: ["tmp/"]) do # autodetect: true | "rvm" | "rbenv" | "asdf" | "mise" | bundler"
109
+ self.gemdir = "/home/user/.local/gem/ruby/4.0.0/gems/logger-1.7.0" # Default for "into"
74
110
  end
75
- .add("e-mc", "emc", copy: { from: "publish", scope: "@e-mc", also: [:pir, "squared-express/"] }, ref: :node) # Node
111
+ .add("e-mc", "emc", copy: { from: "publish", scope: "@e-mc", also: [:pir, "squared-express/"] }, ref: :node)
76
112
  .add("pi-r", "pir", copy: { from: "publish", scope: "@pi-r" }, clean: ["publish/**/*.js", "tmp/"]) # Trailing slash required for directories
77
113
  .add("squared", init: "pnpm", script: ["build:stage1", "build:stage2"], group: "app") do # Use pnpm/yarn/berry for depend + Copy target (main)
78
114
  # Repo (global)
79
- as(:run, "build:dev", "dev") # npm run build:dev -> npm run dev
115
+ as(:run, "build:dev", "dev") # npm run build:dev -> npm run dev
80
116
  as(:run, { "build:dev": "dev", "build:prod": "prod" })
81
117
 
82
- add("publish/sqd-cli", "cli", exclude: [:git]) # rake cli:build
83
- add("publish/sqd-serve") # rake sqd-serve:build
118
+ add("publish/sqd-cli", "cli", exclude: [:git]) # rake cli:build
119
+ add("publish/sqd-serve") # rake sqd-serve:build
84
120
  add("publish/sqd-admin", group: "sqd", exclude: [:base])
85
121
  # OR
86
- with(exclude: [:base]) { add("publish/*", "packages") } # rake packages:sqd-serve:build
122
+ with(exclude: [:base]) { add("publish/*", "packages") } # rake packages:sqd-serve:publish
87
123
  # OR
88
- add(["publish/sqd-cli", "publish/sqd-serve"], true, exclude: [:base]) # rake squared:sqd-serve:build
124
+ add(["publish/sqd-cli", "publish/sqd-serve"], true, exclude: [:base]) # rake squared:sqd-serve:publish
89
125
 
90
126
  # Git
91
- revbuild(include: %w[src/ framework/ types/]) # Synchronous is recommended
127
+ revbuild(include: ["src/", "framework/", "types/"]) # Synchronous is recommended
92
128
  end
93
- .add("squared/sqd", exclude: :git, pass: [:node, "checkout", "bump"]) do # Skip initialize(:node) + squared:checkout:* + squared:bump:*
94
- apply :script, "build:sqd" # Override detection
95
- apply :depend, false #
96
- apply :clean, ["build/sqd/"] # variable_set (alias)
129
+ .add("squared/sqd", exclude: :git, pass: [:node, "checkout", "bump"]) do # Skip initialize(:node) + squared:checkout:* + squared:bump:*
130
+ apply :script, "build:sqd" # Override detection
131
+ apply :depend, false #
132
+ apply :clean, ["build/sqd/"] # variable_set (alias)
97
133
  end
98
- .with(:docker, only: ["build", "compose"], hide: [:windows?]) do # When true hide entire group (formerly pass 0.6.0)
99
- .add("squared", "docker", file: "Dockerfile", context: ".", tag: "latest", registry: "localhost:5000", username: "squared", # compose publish => { oci: "oci://docker.io" }
134
+ .with(:docker, only: ["build", "compose"], hide: [:windows?]) do # When true hide entire group
135
+ .add("squared", "docker", file: "Dockerfile", tag: "latest",
136
+ registry: "localhost:5000", username: "squared", # compose publish => { oci: "oci://docker.io" }
100
137
  args: "--ssh=default",
138
+ context: ".", # Optional
101
139
  client: { config: '/home/user/.docker', tls: true }, # global options
102
140
  secrets: ["id=github,env=GITHUB_TOKEN"],
103
- mounts: ["src=.,dst=/project,ro,bind-propagation=rshared"]) do # Docker
104
- series(:clean) do # run | depend | doc | lint | test | copy | clean
141
+ mounts: ["src=.,dst=/project,ro,bind-propagation=rshared"]) do
142
+ series(:clean) do # run | depend | doc | lint | test | copy | clean
105
143
  File.read(basepath("docker-bake.hcl"))
106
144
  .scan(/\btags\s+=\s+\["([^"]+)"\]/)
107
145
  .each { |val| image(:rm, tag: val.first) }
108
146
  end
109
147
  end
110
148
  end
111
- .pass("pull", group: "default") { test? || doc? } # rake pathname:pull | rake optparse:pull
149
+ .pass("pull", group: "default") { test? || doc? } # rake pathname:pull optparse:pull
112
150
  .style("banner", 255.255) # 256 colors (fg | fg.bg | -0.bg)
113
151
  .build(default: "build", parallel: ["pull", "fetch", "rebase", "archive", "clean", /^outdated:/], pass: ["publish"]) do |workspace|
114
152
  workspace
@@ -143,11 +181,13 @@ Python.options(:build, "build:dev", opts: ["no-deps"]) # inherits
143
181
 
144
182
  Workspace::Application
145
183
  .new(ENV["SQUARED_HOME"], prefix: "rb", common: false) # Local styles
146
- .group("ruby", "default", run: "rake build", copy: "rake install", clean: "rake clean", rubygems: 3, ref: :ruby, override: { # legacy: gem 3.6 | bundler 2.7 => ["3", "2.7"]
147
- pathname: {
148
- run: "rake compile" # rake rb:pathname:build
149
- }
150
- })
184
+ .group("ruby", "default", rubygems: 3, # legacy: gem 3.6 | bundler 2.7 => ["3", "2.7"]
185
+ run: "rake build", copy: "rake install", clean: "rake clean",
186
+ override: {
187
+ pathname: { run: "rake compile" } # rake rb:pathname:build
188
+ },
189
+ ref: :ruby
190
+ )
151
191
  .add("squared") do
152
192
  apply :run, proc { # rake rb:squared:build
153
193
  tsc(with: scriptname || "build:dev", verbose: true) # Repo (global)
@@ -165,7 +205,7 @@ Workspace::Application
165
205
  .each(&:join)
166
206
  }
167
207
  apply :lint, proc {
168
- bundle("exec", "-A --cache=true", with: "lint", verbose: true) # bundle exec --gemfile="/squared/Gemfile" rubocop --parallel -A --cache=true
208
+ bundle("exec", "-A --cache=true", with: "lint", verbose: true) # bundle exec --gemfile="/squared/Gemfile" rubocop --parallel -A --cache=true
169
209
  }
170
210
  end
171
211
  .with(:python, editable: false) do # ref=Symbol | group=String
@@ -207,8 +247,8 @@ Workspace::Application
207
247
  add("android-docs", "android", archive: "https://github.com/anpham6/android-docs/archive/refs/tags/v0.3.0.zip")
208
248
  add("chrome-docs", "chrome", archive: {
209
249
  uri: "https://github.com/anpham6/chrome-docs/archive/refs/tags/v0.5.0.tar.gz", # URI.open (required)
210
- digest: "e3d55d2004d4770dd663254c9272dc3baad0d57a5bd14ca767de6546cdf14680", # SHA1 | SHA256 | SHA384 | SHA512 | MD5
211
- digest: "rmd160:47b7790a511eed675fec1a3e742845fef058799b", # RMD160
250
+ digest: "e3d55d2004d4770dd663254c9272dc3baad0d57a5bd14ca767de6546cdf14680", # SHA1 | SHA256 | SHA384 | SHA512 | MD5 (length)
251
+ digest: "rmd160:47b7790a511eed675fec1a3e742845fef058799b", # RMD160 (prefix)
212
252
  ext: "tar.gz", # zip | tar | tar.gz | tgz | tar.xz | txz | 7z
213
253
  depth: 1, # nested directories (e.g. --strip-components)
214
254
  headers: { # URI.open
@@ -216,7 +256,7 @@ Workspace::Application
216
256
  }
217
257
  })
218
258
  end
219
- .add("squared", release: "https://github.com/anpham6/squared/archive/refs/tags/??") # squared:unpack:zip[v5.4.0,/tmp/squared]
259
+ .add("squared", release: "https://github.com/anpham6/squared/archive/refs/tags/??") # squared:unpack:zip[v5.8.4,/tmp/squared]
220
260
  ```
221
261
 
222
262
  ### Clone
@@ -229,8 +269,8 @@ Workspace::Application
229
269
  .git(
230
270
  "emc": "https://github.com/anpham6/e-mc", # rake emc:clone
231
271
  "pir": { # rake pir:clone
232
- uri: "https://github.com/anpham6/pi-r", #
233
- options: { #
272
+ uri: "https://github.com/anpham6/pi-r",
273
+ options: {
234
274
  "origin": "github", # --origin=github
235
275
  "recurse-submodules": false, # --no-recurse-submodules
236
276
  "shallow-exclude": ["v0.0.1", "v0.0.2"] # --shallow-exclude=v0.0.1 --shallow-exclude=v0.0.2
@@ -252,7 +292,7 @@ Workspace::Application
252
292
  )
253
293
  .with(:node) do # rake clone:node
254
294
  add("e-mc", "emc") do # https://github.com/anpham6/e-mc
255
- revbuild(before: %w[status squared:status], # emc:status + squared:status (always)
295
+ revbuild(before: ["status", "squared:status"], # emc:status + squared:status (always)
256
296
  after: "refresh") # emc:refresh (changed)
257
297
  end #
258
298
  add("pi-r", "pir") # https://github.com/anpham6/pi-r
@@ -295,7 +335,7 @@ Workspace::Application
295
335
  chain "all", "build", with: "pir" # step: 3
296
336
  end
297
337
  add("squared") do
298
- revbuild(include: %w[src/ framework/ types/]) # Git revision build command (optional)
338
+ revbuild(include: ["src/", "framework/", "types/"]) # Git revision build command (optional)
299
339
  chain "all", "revbuild", after: "express:build" # step: 4
300
340
  chain "publish", "bump:patch", "publish:latest", step: 0, sync: true # rake publish
301
341
  end
@@ -309,7 +349,7 @@ Workspace::Application
309
349
  chain "all", "doc", with: "squared", before: "squared:revbuild" # Same
310
350
  end
311
351
  end
312
- .chain("all", "status", with: "squared", after: "android-docs") # Global tasks (e.g. without ":")
352
+ .chain("all", "status", with: "squared", after: "android-docs") # Global tasks (without ":")
313
353
  .build
314
354
  ```
315
355
 
@@ -330,50 +370,50 @@ Threaded is the default when there are two or more tasks. Using ``with`` and eit
330
370
  ```ruby
331
371
  Workspace::Application
332
372
  .new(main: "squared")
333
- .graph(["depend"], ref: :git) # Optional
373
+ .graph(["depend"], ref: :git) # Optional
334
374
  .with(:python) do
335
- doc(windows? ? ".\make.bat html" : "make html") # rake android-docs:doc | rake doc:python
336
- add("android-docs", "android", venv: "/home/user/.venv") # rake android-docs:depend
337
- add("chrome-docs", "chrome", graph: "android", venv: %w[.venv --clear]) do # /workspaces/chrome-docs/.venv
338
- apply :dependindex, 1 # Use Poetry for dependencies (optional)
375
+ doc(windows? ? ".\make.bat html" : "make html") # rake android-docs:doc | rake doc:python
376
+ add("android-docs", "android", venv: "/home/user/.venv") # rake android-docs:depend
377
+ add("chrome-docs", "chrome", graph: "android", venv: [".venv", "--clear"]) do # /workspaces/chrome-docs/.venv
378
+ apply :dependindex, 1 # Use Poetry for dependencies
339
379
  end
340
380
  end
341
381
  .with(:node) do
342
- graph(["build", "copy"], on: { # Overrides "git"
382
+ graph(["build", "copy"], on: { # Overrides "git"
343
383
  first: proc { puts "1" },
344
384
  last: proc { puts "2" }
345
385
  })
346
- script("build:dev") # npm run build:dev
386
+ script("build:dev") # npm run build:dev
347
387
  # OR
348
- run([nil, "build:dev", { "PATH" => "~/.bin" }, "--workspace", "--silent"]) # PATH="~/.bin" npm run build:dev --workspace -- --silent
388
+ run([nil, "build:dev", { "PATH" => "~/.bin" }, "--workspace", "--silent"]) # PATH="~/.bin" npm run build:dev --workspace -- --silent
349
389
  # OR
350
- run({ # Same
351
- script: "build:dev", #
352
- env: { "PATH" => "~/.bin" }, #
353
- opts: "--workspace", #
354
- args: "--silent" #
390
+ run({
391
+ script: "build:dev",
392
+ env: { "PATH" => "~/.bin" },
393
+ opts: "--workspace",
394
+ args: "--silent"
355
395
  })
356
396
 
357
397
  add("e-mc", "emc") do
358
- first("build", "emc:clean", "emc:depend") # rake emc:clean && rake emc:depend && rake emc:build && echo "123"
359
- last("build", out: "123") { |out: nil| puts out } #
360
- error("build") { |err: nil| log.debug err } #
398
+ first("build", "emc:clean", "emc:depend") # rake emc:clean && rake emc:depend && rake emc:build && echo "123"
399
+ last("build", out: "123") { |out: nil| puts out } #
400
+ error("build") { |err: nil| log.debug err } #
361
401
  end
362
402
  add("pi-r", "pir", graph: "emc", first: {
363
- build: proc { puts self.name } # puts "pir"
403
+ build: proc { puts self.name } # puts "pir"
364
404
  })
365
405
  add("squared-express", "express", graph: "pir")
366
406
  add("squared", graph: ["chrome", "express"]) do
367
- first("git:ls-files") { puts "1" } # skipped
368
- first("git:ls-files", override: true) { puts "2" } # puts "2"
369
- last("git:ls-files") { puts workspace.root } # puts "/workspaces" (does not run when error is raised)
370
- error("git:ls-files") { |err| err.is_a?(TypeError) } # return true to suppress error
407
+ first("git:ls-files") { puts "1" } # skipped
408
+ first("git:ls-files", override: true) { puts "2" } # puts "2"
409
+ last("git:ls-files") { puts workspace.root } # puts "/workspaces" (does not run when error is raised)
410
+ error("git:ls-files") { |err| err.is_a?(TypeError) } # return true to suppress error
371
411
  end
372
412
  end
373
413
  .with(:ruby) do
374
- run("gem build") # gem build
414
+ run("gem build") # gem build
375
415
  # OR
376
- run("gem build", on: { first: -> { p "2" }, last: -> { p "4" } }) do # run | depend | graph | clean | doc | lint | test
416
+ run("gem build", on: { first: -> { p "2" }, last: -> { p "4" } }) do # run | depend | graph | clean | doc | lint | test
377
417
  p "1"
378
418
  end
379
419
  # OR
@@ -381,42 +421,42 @@ Workspace::Application
381
421
  p "1"
382
422
  end
383
423
  # OR
384
- run(["gem build", "--force", { "RUBY_VERSION" => "4.0.0" }]) # RUBY_VERSION="4.0.0" gem build --force
424
+ run(["gem build", "--force", { "RUBY_VERSION" => "4.0.0" }]) # RUBY_VERSION="4.0.0" gem build --force
385
425
  # OR
386
- run({ #
387
- command: "gem build", # RUBY_VERSION="4.0.0" gem build --silent --force
388
- opts: "--force", # composable
389
- env: { "PATH" => "~/.bin" }, #
390
- args: { silent: true } #
426
+ run({
427
+ command: "gem build", # RUBY_VERSION="4.0.0" gem build --silent --force (composable)
428
+ opts: "--force",
429
+ env: { "PATH" => "~/.bin" },
430
+ args: { silent: true }
391
431
  })
392
432
  # OR
393
- run(["gem pristine", ["gem build", "gem cleanup"], nil, "--debug"]) # gem pristine --debug && gem build --debug && gem cleanup --debug
433
+ run(["gem pristine", ["gem build", "gem cleanup"], nil, "--debug"]) # gem pristine --debug && gem build --debug && gem cleanup --debug
394
434
  #
395
435
  # All commands are either Array or Hash
396
436
  #
397
- run([ # PATH="~/.bin" GEM_HOME="~/.gems/ruby-4.0.0" (merged)
398
- ["gem pristine", "--all", { "PATH" => "~/.bin" }, "--silent"], # gem pristine --silent --all
399
- ["gem build", { strict: true }, { "GEM_HOME" => "~/.gems/ruby-4.0.0" }] # gem build --strict
400
- ]) #
437
+ run([ # PATH="~/.bin" GEM_HOME="~/.gems/ruby-4.0.0" (merged)
438
+ ["gem pristine", "--all", { "PATH" => "~/.bin" }, "--silent"], # gem pristine --silent --all
439
+ ["gem build", { strict: true }, { "GEM_HOME" => "~/.gems/ruby-4.0.0" }] # gem build --strict
440
+ ])
401
441
  # OR
402
- run([ # Same
403
- { #
404
- env: { "PATH" => "~/.bin" }, #
405
- command: "gem pristine", #
406
- opts: "--all", args: "--silent" #
407
- }, #
408
- { #
409
- env: { "GEM_HOME" => "~/.gems/ruby-4.0.0" }, #
410
- command: "gem build", #
411
- opts: { strict: true } #
412
- } #
442
+ run([
443
+ {
444
+ env: { "PATH" => "~/.bin" },
445
+ command: "gem pristine",
446
+ opts: "--all", args: "--silent"
447
+ },
448
+ {
449
+ env: { "GEM_HOME" => "~/.gems/ruby-4.0.0" },
450
+ command: "gem build",
451
+ opts: { strict: true }
452
+ }
413
453
  ])
414
454
 
415
- add("pathname", test: ["rake test", { jobs: ENV["RAKE_JOBS"] }]) # rake test --jobs 4
455
+ add("pathname", test: ["rake test", { jobs: ENV["RAKE_JOBS"] }]) # rake test --jobs 4
416
456
  add("fileutils", graph: "pathname")
417
- add("optparse", run: "gem build", env: { "PATH" => "~/.bin" }, opts: "-v") # PATH="~/.bin" gem build -v
457
+ add("optparse", run: "gem build", env: { "PATH" => "~/.bin" }, opts: "-v") # PATH="~/.bin" gem build -v
418
458
  add("rake", graph: ["fileutils", "optparse"])
419
- banner(command: false) # Always hide banner
459
+ banner(command: false) # Always hide banner
420
460
  end
421
461
  .build
422
462
  ```
@@ -536,32 +576,31 @@ Non-task:
536
576
 
537
577
  Most project classes will inherit from `Git` which enables these tasks:
538
578
 
539
- | Task | Git | Command |
540
- | :-------------- | :--------------- | :-------------------------------------------------------- |
541
- | branch | branch | create track delete move copy list current |
542
- | checkout | checkout | commit branch track detach path |
543
- | commit | commit | add all amend amend-orig fixup |
544
- | diff | diff | head branch files view between contain |
545
- | fetch | fetch | origin remote all |
546
- | files | ls-files | cached modified deleted others |
547
- | git | | add blame clean grep mv revert rm sparse-checkout status |
548
- | log | log | view between contain |
549
- | merge | merge | commit no-commit send |
550
- | pull | pull | origin remote all |
551
- | push | push | origin remote commit all tags |
552
- | range-diff | range-diff | view between contain |
553
- | rebase | rebase | branch onto send |
554
- | remote | remote | add select |
555
- | refs | ls-remote --refs | heads tags remote |
556
- | reset | reset | commit index patch mode undo |
557
- | restore | restore | source staged worktree |
558
- | rev | rev | commit branch build output |
559
- | sparse-checkout | sparse-checkout | add reapply list clean disable |
560
- | show | show | format oneline textconv |
561
- | stash | stash | push pop apply branch drop clear list all staged worktree |
562
- | submodule | submodule | status update branch url sync |
563
- | switch | switch | branch create detach |
564
- | tag | tag | add sign delete list |
579
+ | Task | Git | Command |
580
+ | :-------------- | :--------------- | :------------------------------------------------------------- |
581
+ | branch | branch | create track delete move copy list current |
582
+ | checkout | checkout | commit branch track detach path |
583
+ | commit | commit | add all amend amend-orig fixup |
584
+ | diff | diff | head branch files view between contain |
585
+ | fetch | fetch | origin remote all |
586
+ | files | ls-files | cached modified deleted others |
587
+ | git | | add blame clean grep mv revert rm show sparse-checkout status |
588
+ | log | log | view between contain |
589
+ | merge | merge | commit no-commit send |
590
+ | pull | pull | origin remote all |
591
+ | push | push | origin remote commit all tags |
592
+ | range-diff | range-diff | view between contain |
593
+ | rebase | rebase | branch onto send |
594
+ | remote | remote | add select |
595
+ | refs | ls-remote --refs | heads tags remote |
596
+ | reset | reset | commit index patch mode undo |
597
+ | restore | restore | source staged worktree |
598
+ | rev | rev | commit branch build output |
599
+ | sparse-checkout | sparse-checkout | add reapply list clean disable |
600
+ | stash | stash | push pop apply branch drop clear list all staged worktree |
601
+ | submodule | submodule | status update branch url sync |
602
+ | switch | switch | branch create detach |
603
+ | tag | tag | add sign delete list |
565
604
 
566
605
  You can disable all of them at once using the `exclude` property.
567
606
 
@@ -604,7 +643,7 @@ Common::PATH.update({
604
643
  gem: "~/.rvm/gems/ruby-4.0.0/bin/gem",
605
644
  bundle: "~/.rvm/gems/ruby-4.0.0/bin/bundle",
606
645
  rake: "~/.rvm/gems/ruby-4.0.0/bin/rake",
607
- npm: "/opt/node/v22.0.0/bin/npm",
646
+ npm: "/opt/node/v26.0.0/bin/npm",
608
647
  python: "#{ENV["PYTHONPATH"]}/bin/python"
609
648
  })
610
649
  ```
@@ -653,7 +692,9 @@ REVBUILD_FORCE=1 # Rebuild all targets (GIT_FORCE)
653
692
  REVBUILD_FORCE_${NAME}=1 # Rebuild project
654
693
 
655
694
  PREREQS_${NAME}=build,copy # Class method name to invoke
656
- PREREQS_${REF}=depend # e.g. Node
695
+ PREREQS_${REF}=depend # e.g. RUBY
696
+
697
+ DRY_RUN=true # 0,false (global: bin)
657
698
  ```
658
699
 
659
700
  ### Graph
@@ -747,8 +788,8 @@ DOCKER_Y=1 # confirm all
747
788
 
748
789
  TAG_${NAME}=1.0.0 # initialize
749
790
 
750
- BUILD_SQUARED_OPTS="NODE_TAG=24 RUBY_VERSION=4.0.0" DOCKER_SQUARED_OPTS="--no-cache --label=v1" rake squared:build
751
- docker build --no-cache --label=v1 --build-arg="NODE_TAG=24" --build-arg="RUBY_VERSION=4.0.0" .
791
+ BUILD_DOCKER_OPTS="NODE_TAG=26 RUBY_VERSION=4.0.0" DOCKER_DOCKER_OPTS="--no-cache --label=v1" rake docker:build # project: docker | ref: :docker
792
+ docker build --no-cache --label=v1 --build-arg="NODE_TAG=26" --build-arg="RUBY_VERSION=4.0.0" .
752
793
  ```
753
794
 
754
795
  | Command | Flag | ENV |
@@ -823,8 +864,8 @@ require "squared/workspace/repo"
823
864
 
824
865
  Workspace::Application
825
866
  .new(main: "squared")
826
- .repo("https://github.com/anpham6/squared-repo", "nightly", script: ["build:dev", "prod"], install: "#{ENV["HOME"]}/.bin", # install: first only
827
- ref: %i[node -docker]) # exclude: -docker
867
+ .repo("https://github.com/anpham6/squared-repo", "nightly", script: ["build:dev", "prod"], install: "/usr/local/bin", # first only (install)
868
+ ref: %i[node -docker]) # -docker (exclude)
828
869
  .repo("https://github.com/anpham6/squared-repo", name: "doc", doc: true, test: true, ref: :python)
829
870
  .add("squared", script: ["build:stage1", "build:stage2"])
830
871
  .with(:python) do